How to FTP

Updated: 03/05/2023 by Computer Hope
FTP cloud

On this page are steps required to utilize FTP (File Transfer Protocol) to transfer files from your computer to another computer or server (e.g., a web server hosting your website).

Note

This page does not show how to create an FTP server, but rather, using a client to connect to one.

Installing FTP client software

We recommend using FTP software, such as FileZilla, to connect to an FTP server. That said, using FTP from a command line is possible. For steps on using the FTP command line, see: How to use FTP from a command line. For a list of all available FTP programs, see the following link.

In the next sections, we go through the steps of utilizing FileZilla to send and receive files using FTP. If you don't have FileZilla on your computer, it can be downloaded and installed for free from FileZilla's website.

Note

When downloading from FileZilla, choose the FTP client and not the FTP server. The FTP server download is for users wanting to run an FTP server.

Also, if you're using FileZilla, many of the steps suggested on this page should be similar to other GUI (graphical user interface) FTP clients.

Adding server information

After FileZilla is installed and launched, enter the server address. You can obtain the server address from your web host or through a web client, such as cPanel.

To enter and save the server address information, click File and select Site Manager to open the Site Manager window, or use the keyboard shortcut Ctrl+S.

Example of FTP server information

FTP host address: 192.168.1.1
Username: mrhope
password: example123

In the Site Manager, click the New site button and give the server a name. In our example, we named our site "Example site." Next, enter the host address, which could be a hostname (e.g., ftp.computerhope.com) or an IP address (e.g., 192.168.1.1). If you're given a full address like "SFTP://192.168.1.1," leave out the protocol information (e.g., SFTP://).

Next, select a protocol (FTP, SFTP, Storj), and if the server is not using one of the default ports (20, 21, 22, or 115), enter the unique port. If you're unsure or the port is not mentioned, leave it blank.

Note

FTP is not an encrypted transmission, which means any data sent over it, including your username and password, could be read by anyone. Always use SFTP (secure file transfer protocol) instead of FTP, if available.

Finally, enter the username in the User field. You can also enter and save the password in FileZilla. However, for extra security, we recommend leaving the Logon Type as "Ask for password," which means you are asked for a password the first time you connect to the server. Below is an example of the Site Manager window with the server settings for our example entered.

FileZilla Site Manager window.

Tip

Clicking the Advanced tab while in Site Manager lets you specify the local and remote directories. It can save you a lot of time if you specify these directories now instead of changing them manually each time you connect to the server.

After entering all the settings in the Site Manager, click the OK button.

Connecting to the server

After the site is added to FileZilla, it remains saved and doesn't need to be entered again. However, keeping a record of the information in case it's lost or needed for other computers is still a good idea.

FileZilla FTP server down arrow selection in toolbar.

To connect to the saved server, click the down arrow next to the Site Manager icon on the toolbar and select your server's name. If you did not have FileZilla save your password, a server password prompt appears before FileZilla attempts to connect.

When establishing a connection, if you're connecting to a secure server, a window similar to the following example is shown.

Unknown host key in FileZilla FTP client.

The Unknown host key window appears any time you're connecting to an unknown server to help ensure you're really connecting to the server you want. Verify the host address is correct, and then check the "Always trust this host, add this key to the cache" box and click OK. As long as the host remains the same, you are not prompted again in the future.

Once connected, a local list of files is displayed in FileZilla on the left side and the remote (server) files on the right side.

Sending and receiving files over FTP

Once connected to a server, you can send files to that server (upload), receive files from the server (download), edit files, and adjust the file and folder permissions on the server.

Browsing FTP

Browsing the files in FTP is much like browsing files in most file managers. FileZilla shows the files and folders of your computer on the left side and can be browsed by clicking any folder. You can do the same on the server (remote) side by opening the folders on the server to see the files contained in each folder. If no files are listed on the remote side, you're not connected. View the server's status in the top box to see if an error was reported while attempting to connect.

Upload files using FTP

Most of what you do in FTP is upload files to a server. For example, if you're creating a website, the HTML (hypertext markup language) files and pictures used for the website are uploaded to the web server using FTP. Once files are moved to the server, they are accessible to those visiting your server or website.

To upload a file to the server, locate the file on the left side (local) by browsing to the directory containing the files. Next, make sure the server (remote) is in the correct directory you want the files to appear on the server.

Tip

On a Linux server using Apache, the default starting directory for web pages is the public_html directory.

Once the file is located and the remote side is in the correct directory, right-click the file and select Upload.

Tip

To upload a single file, double-click it.

Tip

If you're uploading large files or many files that you want to all appear at once, select Add files to queue. Once all files are added to the queue, you can right-click a file in the Queued files and choose the Process Queue option to start sending all queued files.

If you're uploading a file that already exists on the server, a prompt similar to the following example is displayed. If the file you're uploading is newer than the old version on the server, choose the Overwrite option and click OK.

FileZilla target file already exists window.

Tip

If you're updating several files, it's also a good idea to check the Always use this action box to prevent this prompt from appearing on every duplicate file.

Download files using FTP

In addition to sending new files to the server, the server may contain files you want to view or process on your computer. To download files from the server, change the local directory (left side) to where you want the new file to appear. Next, browse to the location on the server (right side) containing the file you want to download.

Once the local and remote directories are correct, right-click the file on the server and select Download.

Tip

To download a single file, double-click the file.

Tip

If you're downloading large or many files, select Add files to queue. Once all files are added to the queue, you can right-click a file in the Queued files and choose the Process Queue option to start downloading all queued files.

View and edit files in FTP

FTP is only designed to manage files. However, using a program like FileZilla also lets you view and edit files by the program handling the downloading and uploading in the background. To view or edit a file on the server, right-click a file on the server (remote) side and select View/Edit.

After selecting the View/Edit option, the file opens in the default editor on your computer. For example, if the file is a text file, it opens in your default text editor, like Notepad or Notepad++.

Tip

To change the editor FileZilla uses, in FileZilla, click Edit and then Settings. In the Settings window, select File editing and then choose your editor.

Once the file is open, you can view the file's contents and make changes. If any changes are made to the file, FileZilla prompts you about uploading the new changes to the server. If the file is uploaded, your changes are saved to the file on the server.

Note

When you edit a file from the server, only the server version gets changed. If you have a local copy, it does not get updated. If you changed the file and have a local copy, download the edited file from the server to keep a backup of your changes.

Setting file and folder permissions in FTP

Files you upload to a server have the default read permissions, allowing everyone to see the new files. However, some files (e.g., scripts) need the ability to execute. If you're uploading a script file that needs to run on the server, its permissions must be changed after it's uploaded to the server.

To change file permissions, right-click the file and select File permission. In the Change file attributes window, check each of the Execute boxes or enter the numeric value 755.

Tip

See our chmod command page for further information about file permissions and what the numeric value represents.

Viewing results

At the bottom of FileZilla is the status of queued files or files currently being processed. If you added files to the queue, right-click one of the files and select Process Queue to start the file transfer. Any files that fail during transit show in the Failed transfers tab, and all successful files show in the Successful transfers tab.

Troubleshooting

While using FTP to send and receive files, you may encounter any of the following problems.

Unable to connect to the server

Problems with connecting to the server can be caused by many different factors. Try the following suggestions if you're having problems connecting.

  • If you never connected to the server before, verify the address, username, password, protocol, and port are all correctly entered in the Site Manager.
  • If you were able to connect in the past but can no longer connect, verify your home IP address is not blocked by the server. Unplug your home router, leave it unplugged for a minute, and then plug it back in again in case it's the problem.
  • There are times when FileZilla may be having software issues. To ensure that's not the case, close all programs, including FileZilla, and reboot the computer.

Frequently disconnected

An active FTP connection uses server resources, so most FTP servers automatically disconnect (timeout) you from the server if you are inactive. This behavior is normal as long as you only get disconnected when inactive.

Unable to see changes to files uploaded

If you're uploading updated files for a web page, and the new version is not appearing in a browser, you may have any of the following problems.

  • File uploaded to the wrong directory (folder) — In FileZilla, open the Successful transfers tab at the bottom of the window and verify the local and remote paths are correct.
  • Encountering a browser caching issue — Attempt a hard refresh in your browser by opening the page and pressing Ctrl+F5 to get the latest file from the server.
  • Server or proxy caching issue — If you're using a caching service on your server or a service like Cloudflare, ensure their cache is cleared.