Using FTP with WordPress

Last Updated on

File Transfer Protocol (FTP) is one of the methods we have to manage our website files. Transferring the files using this protocol is simple, secure, fast and free.

In this article


The following hosting services offer maximum compatibility with Jupiter and provide exclusive discounts to Artbees Themes users:

InMotion > Up to 50% Discount
WPEngine > 20% Discount
DigitalOcean > $10 Discount
MediaTemple > 2 Months free on Annual Plan


Setting up the FTP Client

You will need the following details regarding the FTP account on the server:

  • The website FTP address (usually ftp://example.com if the URL is http://example.com)
  • The FTP username
  • The FTP password

In order to transfer files to and from the server, you’ll first need to download and install an FTP client onto your computer. There are a number of different clients available and no real right answer when it comes to choosing. Here is a list of the most popular FTP clients:

  • FileZilla
  • CuteFTP
  • Cyberduck
  • MacFUSE
x
Note: We will use FileZilla for the example(s) included in this article. It is free to use and can be downloaded from here.
x
Note: If you do not already have an FTP account on your server, use your cPanel or website administration tool to set one up — it will have all the information needed. If in doubt, ask your host for directions or help regarding an FTP account for your use to access your webspace.

Moving the Files from Localhost to Web Host

1
Open the FileZilla FTP Client.
2
Fill in the connection details.

ftp

3
Navigate to the correct path.
x
Note: The website files are usually located in the public_html folder or htdocs, but the FTP login can also navigate you directly to the website root folder.
4
Drag all the website files into the server.
5
Wait for the queue to finish its task.
x
Beware! It may take hours to finish the transfer since all the files have to be moved one by one.
6
Make sure all the files have been successfully transferred.

Common Issues

You may face some issues when uploading files via FTP. We’ll list them below and describe how to fix them.

Permissions Denied Error

Sometimes you may get a “Permission Denied” error when uploading the files. File and folder permissions tell the server who can read, run, or modify files hosted on your account. WordPress needs permissions to manage files and create folders on the server. The following settings are recommended for most users.

755 for all folders and sub-folders.
644 for all files.

To set these settings, follow the steps below:

1
Connect to your FTP client as described above.
2
Select all folders in your site root directory and then right click to select File Permissions. This will bring up the file permissions dialog box.
3
Now enter 755 in the numeric value field.
4
Click on the Recurse into Subdirectories checkbox and then select the Apply to Directories Only option.
5
Click on the OK button to continue.

Your FTP client will start setting file permissions to folders and subfolders. You will need to wait for it to finish.

Then, select all files and folders in the site root folder and right-click to select the file permissions. This time enter 644 in the numeric value field. After that, click on the Recurse into Subdirectories checkbox and then select the Apply to Files Only option. Click on OK to continue.

x
Note: You can read about permissions in WordPress Codex

If you experience problems trying to set permissions, you’ll need contact your hosting provider support for a solution.

Connection timed out error

If you receive a Connection Timed Out error while trying to access your account, there may be several causes:

  • Your Internet Service Provider is blocking the port you’re trying to use to connect via FTP – Port 21. This tool can help you find whether the port is blocked or open.
  • Your FTP client is not set to work in Passive mode – please, refer to your FTP client documentation on how exactly you can switch between different FTP modes. Here is the documentation for the FileZilla client https://wiki.filezilla-project.org/Network_Configuration#Setting_up_FileZilla_Client ;
  • Your domain name is expired or is resolving incorrectly. You can eliminate this issue by accessing your account directly via its IP address.

Country Blockage

When connecting to your FTP account, you may receive the error, “Connection closed by server”. This could be related to your hosting service provider and their it’s firewall, as your country IP may be blocked. In this case you’ll need contact your hosting provider support and ask them to unblock your country.

SFTP SSH Keys

SFTP (Secure File Transfer Protocol) offers the ability to transfer files through a secure, encrypted connection. SFTP uses an SSH connection which requires a special public/private key pair that you will need to generate on your local computer. When you generate a key pair, it will have two halves , a public half and a private half.

x
Note: The private half must never be shared and must always remain on your local computer.

The public half of the key goes on the host machine you’re trying to connect to. You can email it, paste it publicly online and so on.

To learn how to generate an SSH key and use it in FileZilla, read the FileZilla documentation.

Was this helpful?
Previous Article:
Next Article:

Can't find what you're looking for?

Open New Ticket