In this lesson, we’ll walk you through installing WordPress on your server, with the end result being a live, working WordPress website.
An alternative: utilize a host company’s WordPress-quick-install feature
Many hosts offer tools to install WordPress automatically, or offer to do it for you, and you may want to consider that route. If you install WordPress yourself, you’ll have a better understanding of your website and more control over it. But if you want to side-step the installation process, using an automatic installer or letting a host handle it may be a decent option.
The installation process may seem a bit daunting at first, but these are typically the only tasks you’ll be required to do in your work with WordPress which are this technical and unfamiliar. And you’ll learn a lot.
Step 1: Preparation
Check to be sure that you’re set up with all of the Requirements.
Locate your web host company’s support phone number, email address or support-ticket page. Before you start the installation, contact them, tell them you’re installing WordPress, and ask for these pieces of information:
- FTP connection info
- Name servers
- Procedure for creating a database
- Database host name.
Locate your domain registrar’s support system, contact them, and ask, “How do I point my domain name to my web host’s name servers?”
name server: a specialized server on the Internet that handles queries from your local computer about the location of a domain name’s services
Point your domain name to your web host’s name servers. This is normally done by logging into your account at the domain registrar. It’s not difficult, but the process will be a little different for each registrar and host. As mentioned just above, contact Support at your web host and ask “What name servers should I use?” They will give you several short strings of letters and numbers. Then ask your domain registrar, “How do I set name servers for my domain name?” and they will tell you where to go on their website to paste in those short strings of letters and numbers (the name servers).
Please be sure that you have a website info sheet, a single document where you maintain all logins and notes for this particular website.
On your hard drive, create a folder (a directory) which will be the central location for the files for this website. Inside this folder, create another folder and name it “site”. This is the root directory for your local copy of the website, and corresponds exactly to the root directory of the remote web hosting account. The files in this folder should be identical to those in the remote root directory.
We recommend also creating an “assets” folder to contain any and all files which are important, but not actually part of the website itself, and locate that folder outside of the local root directory.
This lesson assumes that you are installing WordPress into the root directory of your web hosting account. Lots of other configurations are possible, but this is the simplest.
Download the latest release of WordPress.
Unzip the WordPress .zip file. It contains a folder named “wordpress”, which in turn contains a number of files and folders. Copy the contents of the folder “wordpress” into the local site root directory you created.
Step 2: Creating a Database
Next, you’ll need a new MySQL database on your host server. The procedure will be different on each web host, so please either check your web host’s support pages or contact them directly for specific instructions.
In most cases, you’ll be creating the database yourself. If your host provides you with cPanel, a brand of control panel, you can follow these instructions on creating a database in cPanel from WordPress.org.
Other web hosts may require that you use a program called phpMyAdmin to create your database. If so, use these directions on creating a database with phpMyAdmin from WordPress.org.
Or, your web host may have another method of database creation. If in doubt, please contact your web host’s support desk and ask “How do I create a MySQL database, user and password for my WordPress website?”
The Database User you create will need to be given all privileges to access and modify the database – a setting – and a Database User Password. Please be sure the password is a strong one.
You will need to record several pieces of information carefully on your website info sheet, being meticulous about the precise characters. Those are:
- The database name
- The database user name
- The database user password.
Step 3: Editing wp-config.php
Here’s where you get to be a coder. This should be simple if you follow the directions carefully and be meticulous.
In the list of files that comprise WordPress, you’ll see one with the file name wp-config-sample.php. Rename that file to wp-config.php and open it in your text editor (not a word processor). You should see about 179 lines of PHP code.
Near the top of the page, find this line:
// ** MySQL settings - You can get this info from your web host ** //
Just below it, you’ll see this:
/** The name of the database for WordPress */
Go to where you recorded your database name and carefully copy it to your computer’s clipboard. Then carefully paste that string between the two single-quotes, replacing the words database_name_here, but retaining the single-quotes. Be sure not to miss a character or include any blank spaces.
Just below that, you’ll see:
/** MySQL database username */
Copy-paste your Database User Name, replacing the words username_here, but retaining the single-quotes.
Just below that is:
/** MySQL database password */
In the same way, paste your Database User Password in the corresponding location.
And just below that:
/** MySQL hostname */
With many web hosts, this can remain exactly as it is (‘localhost’). Contact your web host’s support desk and ask what the correct Database Host setting is for your WordPress installation.
Save wp-config.php and continue editing.
A few lines further down in the code, find this:
* Authentication Unique Keys and Salts.
This is a good security measure which only takes a few seconds. Just point a browser to the URL provided, https://api.wordpress.org/secret-key/1.1/salt/. Copy the entire block of code that results, and use it to replace the block already on the page, which looks like this:
define('AUTH_KEY', 'put your unique phrase here');
define('SECURE_AUTH_KEY', 'put your unique phrase here');
define('LOGGED_IN_KEY', 'put your unique phrase here');
define('NONCE_KEY', 'put your unique phrase here');
define('AUTH_SALT', 'put your unique phrase here');
define('SECURE_AUTH_SALT', 'put your unique phrase here');
define('LOGGED_IN_SALT', 'put your unique phrase here');
define('NONCE_SALT', 'put your unique phrase here');
So that this block now looks similar, except that there are long strings of letters, numbers and characters in place of each ‘put your unique phrase here’.
When editing this or any code, be sure to be exacting. A lot of hassle can be avoided by simply not making sloppy coding mistakes.
Last of all, there is another security measure you can, and should, take. The WordPress database consists of tables, and each table has a name. Giving your tables a unique table prefix makes it harder for hackers to target your database. You can set this unique table prefix to something difficult to guess, and it will be applied to all of your WordPress database tables.
Find this line:
* WordPress Database Table prefix
and a few lines lower, this line:
$table_prefix = 'wp_';
Between the two single-quotes, add a few (4-8 is good) random characters either before or after the wp and before the underscore. Do not include capital letters or special characters here.
The same line now looks something like this:
$table_prefix = 'wp3nm92b_';
You’re done editing wp-config.php! Save the file, close it, and make sure it is still included with the stack of WordPress core files.
Step 3: Uploading the Files
Next you need to upload (transfer) all of the WordPress files from your local hard drive to your remote web server. This is normally done via FTP, which stands for File Transfer Protocol, using an FTP program (or FTP client). An FTP program allows you to move files back and forth between your hard drive and the remote server provided by your web host.
If you’re already familiar with a particular FTP program, set it up to connect to your remote server’s root directory and upload the WordPress files.
If you’re new to FTP, please follow these instructions.
First, collect the following information and record it on your website info sheet. You may need to contact your web host to obtain these:
- FTP Host, usually a string such as ftp.mydomain.com, or an IP number like 220.127.116.11
- FTP User Name, usually a text string, might be your own user name
- FTP Password
- Remote Directory, which may be “public_html”, or a string including your site name or user name, depending upon your web host.
Now set up your FTP program.
- Download Filezilla, a free program which has versions for both Windows and Mac.
- Install the program on your computer. Open it.
- Choose File > Site Manager, or click Control-S, to open the Site Manager panel.
In the Site Manager, you’re going to input the information that allows the program to provide direct access to your remote server. This can seem a little tricky at first, but it’s only a matter of getting the correct information into the correct fields. Sometimes a little trial-and-error is required.
- Click New Site to set up a connection.
- On the left, click in the field to replace the words “New Site” with a name for this site/connection.
- On the right, in General tab, in the Host field, type or paste the FTP Host string.
- Also on the right in the General tab, set Protocol to FTP (File Transfer Protocol), Encryption to Use Plain FTP, and Logon Type to Normal.
- For User, type or paste your FTP User Name.
- For Password, type or paste your FTP Password.
- Switch to the Advanced tab. Under Default Local Directory, browse your local hard drive to find the folder which is your website root directory, and select it.
- Also on the Advanced tab, under Default Remote Directory, type the path on the remote server to your website’s root folder. If not sure, contact your web host for the correct string.
- Click Connect. You’ll be sent back to the Main Screen, and some scrolling text near the top will tell you whether the connection was successful or not.
- If the connection didn’t work, check all of your settings carefully and try again until you hit it.
If this connection-setup process seemed like a lot of work, know that Filezilla will save your site/connection under the name you gave it, so you should only need to do the above steps once.
However, make sure the FTP information you have recorded on your website info sheet is entirely accurate, so that if/when you need to set up this program, or another, it will go smoothly. You might want to make screen shots of the Filezilla connection screens.
Now that you’re connected, stay on the Main Screen, and note the left “Local” and right “Remote” panes. You should see a directory tree at the top of each pane, and below those, some files displayed.
The connection setup that you just created determines which files show in the Local and Remote panes by default. It’s very important to be sure you have the connection set up so that the site root directory content are displayed in each one. If this isn’t set up correctly, files could be transferred to the wrong locations and nothing will work. If it isn’t set up correctly, you will need to change the settings in the Site Manager screen on the Advanced tab.
Checking the Local directory tree, you should see the directory which is selected as the Local root folder, whose files are displayed just below. You should see the WordPress core files there.
In the Remote pane, the directory tree may not tell you much, since you probably don’t have access to directories above your own account directory on the server. (On the other hand, if you have an account which allows you to create multiple domain accounts, you may see them all in the directory tree.)
In the Remote pane below the directory tree, you should see whatever files are present in the remote root directory. If the remote server is a brand-new hosting account, there may not be much in the root directory, or sometimes there are a few files or directories put there by the host. If it’s a server you’ve been using, you should recognize files already present in the root directory.
If you’re not sure whether the Remote pane is pointed to the right directory, first make sure the Local setting is correct. Then place a simple file with a recognizable name (test.txt or the like) in the local root directory and upload it to the Remote root directory. If the file appears in the Remote root directory, your setup is correct.
Be certain that you have these settings correct before you move on.
Then, in the Local pane, select all of the files in your local root directory – the complete set of WordPress core files, including the wp-config.php that you edited – and drag them to the right pane. This queues this set of files, and the transfer begins. Depending on your Internet connection speed, this could take up to twenty minutes or more.
When the program indicates that the files are transferred successfully, move on to the next step.
Step 4: Run the installation script
To complete the installation, access the site URL in a web browser. This is the address to the location where you uploaded the WordPress files. If you uploaded them to the root directory, point your browser to http://yourdomain.com, replacing yourdomain.com with your actual domain name.
If all is well, you should see a WordPress welcome/installation screen which instructs you to fill in a few fields – the site name, your user name and password, an email address, and whether or not you’d prefer that search engines index your site at this point. These can all be changed later, so don’t worry too much about them. But be sure to record the user name and password you create.
Click “Install”, and the next thing you see should be a screen announcing, “Success! WordPress has been installed.” From that screen, you can log in with your new user name and password.
Congratulations! You now have a WordPress website.
If instead of the Welcome Screen, you see an error message or obvious failure of some kind, don’t panic. Very likely, a minor mistake caused the problem.
First, re-do the uploading of all of the WordPress files; sometimes one or more files fail to be transferred. Then try accessing the Welcome/Installation screen with your browser again.
If that doesn’t work, open wp-config.php and very carefully check the database name, database user and password fields to be sure they are absolutely correct. Upload the changed file and point your browser to the root directory again to see if the Welcome/Installation screen works correctly now.
If you’re still stuck, you might contact your web host, explain briefly and accurately what you’re trying to do and what happened, and just ask if they have any suggestions. Some hosts will help with this, but likely some will not.
Consider starting over completely from scratch, clearing out both the local and remote site root directories, and deleting and re-downloading WordPress.