This post will show you how to install WordPress over FTP or SFTP. But why should you install WordPress manually? After all, there are lots of hosts out there providing scripts that allow you to install WordPress with just a few clicks.
First of all, installing WordPress manually barely requires more clicks than an automatic install. Basically, the only additional actions from your side when installing WordPress yourself are uploading a copy of WordPress, and you creating a database.
When you install WordPress with an auto-installer, the script will take care of this. But even with a script install, you need to provide all the necessary details like a database name and user.
A big plus of being able to install WordPress manually is that your hosting options increase tremendously. You no longer need to limit yourself to web hosts offering installers like Fantastico or Softaculous.
When you are able to install WordPress manually, you can consider every hosting company supporting PHP and allowing you to create a MySQL database.
More importantly, by installing WordPress yourself, you leverage your understanding of WordPress and you gain more control over how your website works.
Add to this that sooner or later you will have to check out or update the wp-config.php – WordPress configuration file. When you have installed WordPress yourself, you already know what it is and where to find it. Knowledge is power.
FTP versus SFTP
In this post, I am going to install WordPress over SFTP. The difference between FTP and SFTP is the S, which stands for secure.
When you login over FTP, you use the default FTP port 21. When connecting over SFTP, you actually use SSH. While 22 is the default SSH port, hosts can alter this number for increased security. When 22 is not working, check the knowledgebase of your host, or contact a support agent.
So, all it takes to use SFTP instead of FTP, is use not using port 21, but port 22 – or whatever port number your hosts has assigned for this purpose.
Preparing the Install
Okay, so what do you need when installing WordPress over SFTP?
Here is your shopping list:
- a web host
- an FTP client
- a copy of WordPress
The good news is that, except for the hosting, you can get it all for free.
When you do not have a host yet, you can check out the web hosts mentioned in the footer of this page. Generally, web hosts allow you to manage websites over (S)FTP and a control panel.
Although, I have not been able to trace down market share numbers, I guess it is safe to say that the cPanel is the most used control panel. For that reason, we will be using cPanel here.
You definitely need an FTP client. An FTP client lets you copy files to and from your web server, and browse files on that server as well as on your local machine. FileZilla is a great – and free – choice.
Last, but certainly not least, you need a copy of WordPress. You can grab the latest English version from the homepage of WordPress.org. For this post, I will be using the English version of WordPress 3.8.2.
When you prefer a localized version, you can visit your local WordPress.org site, like nl.wordpress.org or br.wordpress.org. In case there is no WordPress.org site in your language (yet), you can check out WP Central.
And of course, you need a web browser, but you already have one of those otherwise you would not be able to read this post.
We are going to complete our installation of WordPress over SFTP in three stages:
- creating the database
- uploading WordPress
- configuring WordPress
Creating the Database
WordPress stores all data in a database. Not only the content – the posts and pages – of your website, but also the WordPress, theme and plugin settings. So the first thing to do is creating the database.
Creating a database with cPanel is a four step process:
- create the actual database
- create a user with a password
- add user to the database
- assign privileges to the user
Please note that you need to remember the names of the database and the user as well as the user’s password, since you need to enter these details while configuring WordPress. Although you do not need to know these details by heart, it is always better to make a note and put it somewhere safe with the other records of the website.
Login to the the control panel of your web host and scroll down to the Databases section.
In case you do not remember the user name and password, you will probably find these in the welcome e-mail you received from your host when you signed up for the service.
On the home page of the cPanel, scroll down to the section Databases and click on the option MySQL Databases.
Step 1 – Create the database
Now we are going to create the actual database.
Under Create New Database, in the form field New Database, you have the opportunity to enter an extension. Just an extension, since this will be added to your account name (separated by an underscore) to compose the full database name.
In this example, the extension used is m345 which will be added to the account name webpoli. Hence, the full database name is webpoli_m345.
Basically, you can use any combination of letters, numbers, underscores (_) and hyphens (-) for the extension.
The white check mark on the green background indicates that your database name is okay. When you are satisfied, just click the [Create Database] button.
When the confirmation page appears, click [Go Back].
Step 2 – Create the user
The next step is creating a database user.
Like with the database, you only have to come up with an extension for the user, which is added to your account name.
Besides the user, you also have to enter a password for that user.
The user password has to be at least 5 characters. As you will understand the stronger the password, the better. Optionally, you can have the control panel generate a password.
Hit the [Create User] button. On the confirmation page, click [Go Back].
Step 3 – Add a user to the database
The third and last step is assigning a user to the database.
When there is only one database and only one user, cPanel suggests to link these two with each other. In case there are more databases and/or users, you can make your choice with drop-down menus.
Click the [Add] button.
Step 4 – Assign privileges
The Manage User Privileges screen appears.The cPanel screen above displays a subset of the available MySQL commands.
Initially, it was sufficient to grant only four privileges; SELECT, INSERT, UPDATE and DELETE.
However, without CREATE, you are stuck with an empty database, which does not make sense of course. And especially plugins, might require more privileges.
So in this stage, you can take two routes:
In case you prefer the strict route, grant only the following privileges; ALTER, CREATE, DELETE, DROP, INDEX, INSERT, SELECT, and UPDATE.
With the practical approach you grant the sixteen privileges as listed above in the screenshot by checking the ALL PRIVILEGES box. These privileges are also assigned in case of auto-installs.
When you are done, click [Make Changes] and after that [Go Back] .
Now that we are done creating the database, we have also accomplished the most difficult step.
As mentioned earlier, you will need the database name, database user and the database user’s password when configuring WordPress – when we create the wp-config.php file – in stage three.
Now we need to upload our copy of WordPress. It is not possible to unpack an archive file with FileZilla, so we have to unpack the zip file locally prior to uploading WordPress to the SFTP server. When you are done, fire up FileZilla and login in to your host.
In order to login with FileZilla you need:
You have already used the username and password to login to the control panel.
For the name of the host, you can either use the domain name of your website or the IP address of your web server.
It is my habit to use the IP address, since it not always possible to use the domain name – for example, when the website is already live somewhere else.
Once logged in, click on the public_html folder in the Remote site section of FileZilla – that is at the right.
At the left, in the Local site section, browse to your unpacked copy of WordPress.
Select all WordPress files and folder, and drag these from the Local site to the Remote site.
During the transfer, you are able to follow the transfer in the Transfer Que at the bottom of the FileZilla windows. You will see the number of Queued Files decreasing and the number of Successful Transfer increasing. The number of Failed Transfers should remain 0.
As soon as FileZilla has completed the transfer, you are already done with phase two and ready to configure WordPress.
In this phase there are just two more steps:
- creating the WordPress configuration file
- configuring your WordPress website
Technically, it is possible to create the WordPress configuration file – the wp-config.php file – with a plain text editor. However, it is much easier though to complete the steps in this stage with the browser.
The easiest path is using the domain name of your site. However, this is only possible when a) the website regarding is not live somewhere else, and b) the domain propagates – directs – to the IP address of the webserver where you want to install WordPress.
Most web hosts also provide a temporary URL in case you cannot use the domain name at this stage The format of the temporary domain name is usually a combination of the IP address of the webserver and your account name. So something like http://220.127.116.11/~hostingcaddie.
Depending your situation, enter either the domain name or the temporary URL in the address bar of your browser.
WordPress alerts that this is no wp-config.php file, so we are going to create that file. Hit the [Create a Configuration File] button.
The next screen informs us about the necessary details for the next step:
- Database name
- Database username
- Database password
- Database host
- Table prefix
We have already encountered the database name, database username and database password while creating the database in stage 1.
Unless the host has informed you otherwise, the database host is localhost.
WordPress’ default table prefix is wp_, but you are allowed to pick your own. From a security point of view, it is better to create your own table prefix.
Ready, to enter the above mentioned details? Click [Let ‘s go!].
Here we need to enter the database name, user name and password that we used when we created the database in stage 1.
Replace the details as suggested by WordPress by your own, and hit [Submit].
The “All right, sparky!” message that appears. This message confirms that we have successfully created the wp-config.php file.
By clicking the [Run the install] button, we start the famous five minute WordPress installation process. This is where the fun really begins.
It is possible that you do not get an “All right, sparky!”, but an “Error establishing database connection”. This means that WordPress is not able to connect to the database.
When this happens, double check the database name, username, and password with the database details when you created the database with the cPanel. Even a typo can cause such an error.
When all these details are okay, check the name of the database host. Still everything correct? Then check with you host since there might be a technical problem with the database server.
Clicking the [Run the install] button, launches WordPress’ famous five minute install process.
For this form you need:
- Site Title
- Your E-mail address
The Site Title is of course the name of your website. You can change this title anytime within the General Settings of your WordPress site.
Next you enter the username, password and e-mail address of the first WordPress user, the administrator. This WordPress user has no relationship with the database user, so you can enter anything you want.
The username is basically the ID of the user and cannot be changed afterwards. What you always can change are the Nickname, the Display name, the password and the e-mail address of a user.
Make sure the username is not something obvious like ‘wordpress’ or ‘admin’. This is even more true for the password of course. Believe it or not, the most used password in 2013 was ‘123456’.
The most important rules for running a secure WordPress site are basically quite simple:
- do not use obvious usernames and passwords
- keep WordPress, themes and plugins up-to-date
In case you forget your strong password, no worries; the e-mail address you enter here can be used for password resets – just make sure it is a valid e-mail address.
When you are ready completing the form and click [Install WordPress], you are done!
Clicking the [Log In] button brings you to the login screen.
Have fun with WordPress!