How to transfer files between remote server and local computer

When your hosting provider gives you Cpanel access to remote server, you can transfer files using Cpanel File Manager. You can also create FTP client access to use FTP client software to transfer files.

But when you are working with AWS, Digital Ocean etc. hosting providers which only provides command line servers, So there needs to transfer files between local computer and remote server.

There are also many ways to transfer files between remote server and local computer. Most easy and convienient way is using SFTP in FilZilla. The other option is using command line tools like scp, rsync or git. We will discuss few ways to wowrk with Filezilla and scp.

Using Filezilla

FileZilla is open source and free FTP transfer application. You can install FileZilla in your debian based Linux distributions. Once you have installed Filezilla, you need to configure FileZilla.

First of all, open FileZilla and in the Edit menu select Settings option. In the connection option, click SFTP option, you will see like below screen.

Now locate and your server private key. You can find it to ~/.ssh/id_rsa.pub. Now save the settings and add new site in FileZilla Site Manager.

Press CTRL+S or File > Site Manager and add your remote server details.

Host: Your remote server IP address
Port: 22(Default)
Logon Type: Interactive
User: Your server username(default root)

Now click Connect button to check the connection. Now if everything is OK, you will connected with remote server. You can navigate to local and remote files and transfer files between local computer and remote server.

Command line tool

If you are comfortable with command line tools, then there are many softwares installed with them you can transfer files. For scp file transfer, you can send loca file to remote server using below command.

scp image.jpg [email protected]:/server/path/image.jpg

If your remote server folder doesn't have appropriate permission, then first transfer file to anywhere and then login to remote server through ssh and move to that folder.

ssh [email protected]
sudo mv image.jpg /var/www/html

Same way you can download remote server file to local computer using command:

scp [email protected]:/server/path/uploads.zip /var/www/html

There are more command tools available by which, you can transfer files between remote server and local computer. Comment below which one you are using.