How to Transfer Files via FTP or SFTP

NicolasBrondinBernard

Author
@NicolasBrondinBernard

Do you have shared hosting and want to transfer your files to it? Here's a quick tutorial!

Article published on 12/02/2022, last updated on 10/08/2026

The FTP protocol has a rather explicit name since it stands for "File Transfer Protocol" and is used to manage files (creation, modification, deletion) on a remote machine.

This protocol operates in connected mode, which means that you have to wait for the connection between the two machines to be established and stable before you can start any transfer, and it is encapsulated in the TCP/IP stack.

The SFTP protocol is a secure version of FTP stacked on top of the SSH communication protocol, and it stands for "SSH File Transfer Protocol"

It's the protocol mainly used for hosting websites and web applications on shared hosting, because it's simple to work with and FTP clients are fairly intuitive to use.

Using FileZilla

FileZilla is a cross-platform FTP client (Windows, Linux and MacOS), free and open-source (GPL License) but above all very easy to get to grips with and packed with very practical features.

Installing FileZilla

The first step is of course to download the latest version of the installer and run it on your machine.

The download link is directly available here: https://filezilla-project.org/download.php?type=client

Getting your FTP credentials

The next step is to get the credentials for the FTP space you want to connect to. Your hosting provider will supply this data, usually under the "FTP" section, though you may need to create a user first.

Once that's done, you should have access to this information:

Screenshot of FTP credentials on IONOS

Here the credentials are for an SFTP connection, but only the protocol (FTP) and the port (21) would be different.

The essential information is therefore: server (host), username and password, since the port is often the default one (21 for FTP, 22 for SFTP)

Connecting

Once you have the information, all that's left is to create a new connection in FileZilla. To do this, click on File > Site Manager and click the "New Site" button in the left-hand column.

Note that it's possible to launch a connection directly from the home screen, but in that case the credentials will be lost the next time you launch FileZilla.

Once the new site is saved, you'll just need to enter the information you gathered in the previous step. Make sure to select the "FTP" protocol, and switch the authentication type to "Normal" so you can enter your credentials.

Be careful, if you're on an unsecured internet connection and your FTP connection is made without encryption (TLS), your data could be intercepted.

This is why it's recommended to use SFTP whenever possible (this option is covered further down in the article).

Transferring files

Once the connection is made (if you run into a problem, go to the end of the article), you'll arrive at the main interface containing:

  • At the top, the logs of actions performed on the server
  • On the left, the files on your local machine
  • On the right, the files on your remote machine
  • At the bottom, the history of transferred files, in progress or failed

To transfer your files, simply navigate through the local and remote file trees to position yourself in the right directories, and drag and drop a file (or folder) from left to right to upload it, or from right to left to download it.

In SFTP mode

The SFTP protocol is recommended because it's more secure, but once the connection is established, the same FTP commands are executed, so there's no difference in how you use it.

To enable SFTP mode, simply select it from the list of protocols, change the port to 22 (default), and depending on the authentication method on your remote server, you'll likely need to use key file authentication.

Once you've chosen this type, simply click on "Browse..." to select your private key file ".ppk" to add it to the authentication.

And there you go!

In case of problems

If you run into issues during your first connections or your first file transfers, here are a few pointers to help you out:

Check permissions

If during a transfer, deletion, or modification of a file you get a "permission denied" error, this means that your FTP user doesn't have sufficient permissions on the file or folder.

This can happen in particular when you try to leave your user space to work too far outside it within the system. Going back to your user space (home) should fix the problem.

Cannot connect to the server

The first thing to check is that you actually have the correct connection information, and that it's properly configured with the right port.

But if that's already the case and the "Could not connect to server" error persists, then make sure to check whether the problem might be coming from a firewall, a proxy, or a VPN that could be filtering your connections (this is notably the case in many companies and schools).

Unstable connection

If your connection is too weak or too unstable, the connection to the FTP server may close too frequently and prevent you from starting your transfers.

One solution is to go to "Edit > Settings" and increase the timeout until you have a sufficiently stable connection.

The transfer is taking too long

The way FTP works is by transferring each file independently, which will result in slowing down the transfer of a very large number of files (transferring a 1GB file will be much faster than transferring 100 files of 10.24MB each).

The (hybrid) solution is to compress your files into an archive (a zip file, for example), transfer it via FTP, and use an SSH connection to extract the folder on the server (if you have that option available).


Viktor Talashuk sur Unsplash

Finished reading this article?
Our complete courses
Take it to the next level with our courses!

Complete courses, exercises and certificates to really learn programming!

4.8 average rating

Comments (0)

to leave a comment

No comments yet