How to zip and unzip files and folders on your remote server
When installing, lets say, a WordPress, you naturally need to move the files to the server. It's about ~100 times faster to move one big compressed file than a folder containing literally thousands of small files. But, you can't unzip anything from your FTP client. Here's all about zipping and unzipping.
Ideally you have an
SSH access to your server (
SSH means Secure shell, read more about it). Meaning that you log into your server using the Terminal (Mac) or Putty if your on Windows. If you don’t have
SSH access, don’t worry, there is another way.
Login with SSH
If you’re not sure how to login, here’s how that happens:
ssh email@example.com // Or using an IP ssh firstname.lastname@example.org // Or if custom post is defined ssh -p 5555 email@example.com
There’s many packaging algorithms, zip is one of them. It has
.zip file extension.
Compress a folder using zip
$ zip -r archive.zip foldername
-rinclude all files and directories
archive.zipname of the zip file you want to do
foldernamename of the folder you want to zip
If you don’t have zip installed, in Ubuntu and Debian it can be installed with apt-get:
$ sudo apt-get install zip
Decompress with zip
$ unzip archive.zip
This post looks into the GNU tar application to do Gzipping. GNU tar supports both archive compressing through gzip and bzip2.
It’s very similar to Zip, but is more effective. Gzip files have
.tgz extension, and are usually called tarballs.
Compressing with Gzip
Gzip has a ton of option. Here’s the basic command:
$ tar -zcvf compressed-file.tar.gz /directory/needing/compression
Decompressing with Gzip
$ tar -zxvf compressed-file.tar.gz
Unzipping using a PHP script
I’ve been using this script PHP Unzipper. Just unzip it and throw to your server and navigate to
Or you can use some other script, like this. I haven’t tested it.