How to Download or Upload Files via SSH / SCP

Jian Jye • December 4, 2015

ssh

Too lazy to download a specialized FTP app? No worries. You can download or upload files to your server directly via your terminal / SSH with these few simple commands.

To download from the server

$ scp [email protected]:/var/www/remote_file.txt local_file.txt

With custom port number (eg. 2222):
$ scp -P 2222 [email protected]:/var/www/remote_file.txt local_file.txt

To upload to the server

$ scp local_file.txt [email protected]:/var/www/remote_file.txt

With custom port number (eg. 2222):
$ scp -P 2222 local_file.txt [email protected]:/var/www/remote_file.txt

That's all!

Sign up for our newsletter