A Guide to the Best Ways to Install WordPress
One of the many great features of WordPress is how easy it is to install. You can have a live site set up on your hosting platform before your coffee’s done brewing.
It really is that quick when you factor in the famous five-minute install. But not only that, there are so many alternate ways to install WordPress that are just as quick. Some of the most popular methods use different software and platforms including cPanel, phpMyAdmin, FTP with FileZilla, SSH, and MySQL.
In this post, I’ll show you how to install WordPress using all of these methods, including the famous five-minute install. I’ll also go through how to setup WordPress with an auto-installer, such as Softaculous, which takes just seconds.
Roll up your sleeves, fire up your hosting account and let’s get started.
What You Need
You should have a hosting account all set up, but you may not be ready to install WordPress just yet. Before you dive right in, there’s some software you need to have already installed and some decisions you need to make as to the type of WordPress installation that will suit your needs.
You need to choose whether you want a single site or a network of sites, called Multisite. While the main installation process is the same, there are some additional steps required for Multisite. If you’re not sure which option is right for your needs and need help deciding, check out The Ultimate Guide to WordPress Multisite.
If you decide what you need is a network of Multisite installs, there’s a plugin you can use to help you achieve this setup as well. You can learn all about it in How to Create a Network of WordPress Multisite Networks.
One of the other decisions you need to make is what you want your site address to be for your visitors. You can choose to have your site accessible through your main domain such as www.your-site.com or through a sub-directory such as www.your-site.com/wordpress/. Where you install WordPress on your server will dictate the URL where your visitors can access your site.
If you want to install Multisite, it’s recommended that your main site is accessible through your main domain since it won’t work with a subdirectory, though sites in your network could be set up to a sub-directory or sub-domain such as site1.your-site.com.
No matter which type of install and URL you choose, you need to have certain combinations of software and platforms and many of the ones you need wholly depend on your preference. You do need to have your favorite browser installed, but here are the main combinations of other software and platforms you could use:
- File Transfer Protocol (FTP) via FileZilla, a text editor and cPanel
- FileZilla, a text editor, and phpMyAdmin
- Shell Access (SSH) to your server via PuTTY for Windows or Terminal for Mac OS X and MySQL
Most hosting companies have some of these platforms already installed for you on your server and can vary from host to host. If you use a VPS or dedicated server, you may need to install some of these yourself, though FileZilla and PuTTY are both desktop applications that are installed onto your operating system and not your server.
If you want to use FTP and FileZilla but not sure how to, you can check out our comprehensive guide How to Use FTP Properly with WordPress.
Once you have your desired programs all set up and have decided what kind of domain path you want, you’re ready to Install WordPress through the famous five-minute install. You can scroll down through each section below to view the instructions for the specific software you chose.
1. Downloading and Extracting the Files
Exactly how you download and extract WordPress to your site depends on the method you choose. Let’s step through what’s available.
FTP and FileZilla
First thing’s first: You need to download WordPress to your computer from WordPress.org. Extract the compressed folder and don’t forget the path where it’s located on your computer.
SSH and PuTTY or Terminal
If you prefer using SSH, you can download and extract the files right onto your server using the
wget command. Keep in mind that when you extract the WordPress files via SSH, everything goes in a folder called wordpress so that means your site’s URL would automatically be a sub-directory and written similarly to www.your-site.com/wordpress/.
If this is your goal, then go ahead and start by logging into your server in the command prompt. After logging in, you start at the root of your server by default, but most hosting accounts have a folder in the root where all publicly accessible files and folders are located. This is where you want the WordPress files to go so your site can be visited by everyone so you need to go to this folder.
To do this, you need to know the name of this folder and by typing
ls into the command prompt, then pressing the enter key, you can view a list of the folders on your server. Once you have identified the public-facing folder where your site needs to be installed, you can enter the command below to access it. Just don’t forget to replace
public_html with the actual name of your folder if needed.
Next, type in the following command to download the latest version of WordPress into the folder you just selected:
You do need
wget installed on your server for this to work, but most of the time, your hosting company installs it for you. If this command doesn’t work, it may mean you don’t have it installed. If you’re not sure, open a support ticket with your hosting company and they can tell you what you need to know.
Finally, extract the files with this command:
Keep in mind that SSH commands may differ depending on the program you use so if you run into difficulties, consult your program’s documentation for the correct commands.
2. Creating a New Database and User
Your website also needs a database to hold important information such as usernames, passwords, post and page content, and many other key bits of information.
When you’re creating a new database and user, there are a few important things to keep in mind. While you can enter just about anything you want for your database or name, you should make sure any names you pick aren’t easily guessable in order to prevent hackers from being able to easily guess your credentials and force their way into your database. This means you should try to stay away from obvious names such as wordpress or your domain name.
Many hosts also add a prefix to your database name and username automatically, usually ending with an underscore. It’s used to distinguish your database from others on the server. You need to know both parts later on so make note of the names before continuing.
You also need to make note of your host name, which in most cases is localhost. Sometimes it’s also followed by a colon and a few numbers. If you’re not sure what your host name is, ask your hosting provider.
Log into your cPanel home screen and click the MySQL Database Wizard button under Databases. This wizard guides you through creating a database one step at a time. You can also create and assign a user for your database here, which you need in order to complete the installation.
On the first page of the wizard, type in a name for your database, then click Next Step.
On the next page, there should be a message toward the top of the page letting you know your new database has been created successfully.
Now it’s time to create a new user by entering your desired name and password. When you’re done, click the Create User button.
Once your user had been successfully created, you need to be grant full database privileges in order for WordPress to work. Click the All Privileges checkbox in the next step to automatically select all the available privilege levels then click the Next Step button at the bottom of the page.
You should see a “success” message on the next page to let you know everything went well. Now you’re done and you can move on to the next step in the installation process.
To create a database in phpMyAdmin, log in and click on the Databases tab to access the database creation form. If you only see a list of your current databases and no form, you can only create a database with an alternate method such as with cPanel.
Enter a name for your database in the first field. In the Collation drop down box, you will find a list of character sets. Click on it and scroll down to uft8 and see if you can find your language listed. If you find it, select that one. If you don’t see it, choose the
Finish by clicking the Create button. You should see a message appear to let you know that your database has been successfully created.
Next, click the User accounts tab toward the top of the page and click the Add user account button. Enter a username and password and be sure the corresponding drop down boxes have Use text field selected for each then click Go at the bottom of the page.
In the most recent versions of MySQL and since version 5.6.7, the host name option has been dropped altogether so it’s actually meaningless now. In earlier versions, the any host selection meant that you’re allowing your database to be potentially accessed from anywhere. If you chose any of the other options, you would be telling phpMyAdmin to only allow the database to be accessed from your computer or IP address. If you chose these options, it could be nearly impossible to access your database if you are traveling or using a different computer, for example.
Fortunately, it’s no longer necessary so you can just leave it at its default setting and move on.
On the next page, you can select the privileges for the new user you created. Click the Check all checkbox next to the Global privileges label and then click Go at the bottom of the page.
You should see a message appear that lets you know your changes have been accepted. You can also conveniently note that your host name is listed at the top of the page, directly after Server:.
SSH and MySQL
If you still have an SSH session open in your command prompt, go ahead and type in the following command to access MySQL:
Be sure to replace “yourusername” with your actual username that you use to access your databases. When you are prompted, enter your password. If all goes well, you should see some introductory information about MySQL.
Next, enter the query below:
Don’t forget to replace
databasename with the actual name you want to use for your database. If you get an error message, you may not have access to this feature and in which case, you can try one of the other methods such as through cPanel or phpMyAdmin.
Once a message appears saying Query OK, you can enter the next command:
You should change
databasename in this example to the name you chose in the previous query. You should also change
newusername to the username you want to create and also update
hostname to your actual host name.
When you have submitted that query, you can choose a password by entering the query below replacing password with the actual one you want to use.
When you see another Query OK message below your last query, you can go ahead and continue entering the next one:
Finally, enter the word
exit and you’re done. Your database and its user has been created and the user’s global privileges have been set.
3. Edit the wp-config.php File
At this point in the process, you should have your files and database ready to go. There’s still a crucial step you need to take. At the moment, your WordPress files and database aren’t able to communicate with each other. If you tried to view your site now, your would only see an error.
To fix this, you need to add your database information to your wp-config.php file. If you try looking for it right now, though, you won’t find it since it’s named wp-config-sample.php and it’s located directly in the forefront of the WordPress files and folders.
After you extract the compressed WordPress file, you should see a wp-includes, wp-content, wp-admin folders and many files. This is where the wp-config-sample.php file is held.
When you find this file and open it the section you need to edit is toward the top and looks exactly like this:
Before you go rogue and start editing with your preferred method, it’s important to understand what needs editing and why. When you have a good handle on this, making the changes is not only quicker, but you’re less likely to make a mistake that results in errors later on so let’s take a look at the edits you are going to be making.
The first change you need to make is to include your database name, which you created earlier. The specific section you need to focus on is this one:
database_name_here with the actual name of your database. Be sure to keep the quotation marks and other characters intact throughout this editing process.
On the next couple of lines, you need to replace
username_here with your database’s username that you created earlier. The line you need to edit looks exactly like this:
Once you’re done here, move on to the next couple of lines to enter your database password. This is the exact line you need to edit to include your password:
password_here with your actual database password. This is the one you created at the same time as your database user.
Next, check to see is your host name is correct. This is the line you need to locate:
By default, it’s set to
localhost and in most cases, you don’t need to change this, but in some cases, it may be necessary. If you haven’t been able to locate this information yet, check with your hosting provider since they can give you this information.
The final stretch of edits you need to make in this file have to do with authentication keys and salts. It’s the section that repeats
put your unique phrase here toward the end. This is a security feature that helps keep your WordPress site safe from hackers.
It’s by no means the only security precaution you need to take. For more information on keeping your site secure, check out some of our other articles: WordPress Security: Tried and True Tips to Secure WordPress, 12 Ways to Secure Your WordPress Site You’ve Probably Overlooked and A History of WordPress Security Exploits and What They Mean For Your Site.
To get your own set of fresh and unique authentication keys and salts, go to the WordPress online key generator to randomly generate keys for you. When you visit the generator, you should see a stretch of code that looks similar to this:
The generated code provides you with secure keys and salts that you can use. It’s important to never use the same generated code for more than one of your sites. Otherwise, this security feature won’t be secure anymore.
1.6 million WordPress Superheroes read and trust our blog. Join them and get daily posts delivered to your inbox - free!
You also shouldn’t share this information with anyone and you definitely shouldn’t use the example above since it’s publicly available for everyone to see. If you do use it, it would be that much easier for hackers to exploit your site since that’s one less thing they would need to figure out.
That’s the last of the edits you need to make in this file. You can save your changes from here. The final step you need to take here is to rename the file to wp-config.php. Of course, how you do this depends on what editor you use so you can scroll down below this section to find out how you can make these edits with different programs and platforms.
It’s worth mentioning that, technically, this step is optional. Later on, when you run the install script, it can try and complete this step for you so you don’t have to worry about digging into code.
Just keep in mind that you still need to know the database name, username, password and host name. While it works most of the time, there’s still a chance it may not. The only way to truly be sure your files and database connect correctly is to complete this step yourself.
So here’s the part where you choose your own adventure. You can either skip this step and move on to the next one or if you’re keen on giving it a try, let’s take a look at how you would edit this file with SSH and if you prefer FTP.
A Text Editor and cPanel for FTP
If you prefer to use FTP over SSH to handle file transfers, then you can either open the wp-config-sample.php file in your preferred text editor or you can also edit the file directly in cPanel.
I prefer to use Adobe Brackets much of the time because it works really well for editing code, it’s open source and it’s free. With Brackets, you can visually differentiate between different parts of the code since it’s color-coded whereas cPanel doesn’t have this feature. Brackets also has many other features that help you edit code faster and easier.
Of course, there’s no one-size fits all for editing code so choose the editor you like the best and go ahead and make the edits you need. If you prefer a text editor, open the wp-config-sample.php file and when you finish applying the edits that are needed, save it as wp-config.php in the same location as the original file.
If you prefer cPanel, log in and click Files > File Manager. Navigate to the wp-config-sample.php file, click on it once and then click Edit at the top of the page. When you’re finished making the necessary edits, click Save Changes at the top, right corner.
Select the file again if it’s not already highlighted and click Rename at the top of the page. Edit the field in the inline pop-up to read wp-config.php, then click Rename File to apply your changes.
SSH and PuTTY or Terminal
Start by logging into your server if you haven’t done that yet. To view and edit the contents of wp-config-sample.php, first navigate to its location within your server just as you did in the first step with the
Next, select the file for viewing and editing with the following command:
Press the arrow keys on your keyboard to navigate through the document to edit the necessary portions. When you’re done, click the “Esc” button, then enter
:wq anywhere in the file to save your changes and exit.
If pressing the escape button doesn’t do anything, just skip to saving and exiting the file. Not every SSH program is exactly the same so you may need to look up the commands as they correspond to the program you’re using if you’re not sure.
4. Uploading Files
Sure, you have your files on your computer, but if they’re not on your server then they won’t do you much good. Let’s remedy that, shall we?
FTP and FileZilla
Uploading your files with FileZilla is as easy as dragging and dropping, literally. If you’re not familiar enough with FTP or FileZilla yet or need a refresher, take a look at our comprehensive guide called How to Use FTP Properly with WordPress.
SSH and PuTTY or Terminal
Guess what? If you have been using SSH up until this point all your files have been already uploaded and you can skip over to the next step.
5. Running the Install Script
At this point, you’re on the home stretch of installing WordPress. To finish up the process, open your preferred browser and navigate to the install script. To access it, type in the path to your site then follow it with /wp-admin/install.php.
Depending on the path of your WordPress installation, the URL may differ in your specific situation. Here are some possibilities depending on where your WordPress files are located:
- Root of your server – www.your-site.com/wp-admin/install.php
- In the /wordpress/ folder – www.your-site.com/wordpress/wp-admin/install.php
- In a different sub-directory – www.your-site.com/sub-directory/wp-admin/install.php
Once you’re there, you first need to select your language, then click the Continue button.
You can change the language WordPress is in later under Settings > General so you don’t have to worry too much about it now. This also doesn’t affect the language your site is written in on the front end.
If you didn’t edit your wp-config-sample.php file earlier you should be prompted with a message next to let you know that you need to enter your database details. Click the Let’s Go button to continue to the next page.
The following page is where you can enter the necessary details to connect your WordPress files to your database.
It’s recommended that you change the table prefix to something less well-known if you feel comfortable with it. This is so it’s less guessable for hackers. Since most users have their table prefixes set to the default
wp_, it’s one less detail hackers need to figure out to try and force their way into your site and server.
The downside is there may be plugins and other scripts that won’t work because they are programmed to access your database and assume you are going to have your table prefixes set to its default. It’s important that you make this decision carefully since it could impact your site in the future.
When you’re done entering in all your details, click the Submit button at the bottom of the page to continue.
If you are met with an error message letting you know that the attempt to establish a connection between your files and database has failed, click the Try Again button to re-enter your database details.
If your database name and username contains a prefix, don’t forget to enter it in with the name you typed in when you created your database. That’s usually the most common mistake. If you know this information and your password is correct, make sure you have the right host name. You may need to contact your hosting provider or server admin if you don’t have this information.
When you receive a message letting you know the connection was successfully established, click on the Run the install button to continue.
If you went ahead and edited your wp-config-sample.php file already, you should automatically be sent to this next page to start installing WordPress.
Enter basic details such as your site’s name, the username and password you want to use to log into your admin dashboard and your email address. If you want your site to be indexed by search engines (read: Google) then leave the Search Engine Visibility checkbox unchecked.
A strong password is already generated for you, but you can enter your own in if you would prefer that.
When you’re done typing everything in, click the Install WordPress button at the bottom of the page. When you receive a message letting you know the install was a success, click the Log in button to be directed to the login page.
Enter in the username and password you just chose in the last step and click Log in. You’re now directed to your admin dashboard, you’re done installing WordPress and you’re ready to start fully customizing your site.
If the famous five-minute install isn’t fast enough for you, you can use an auto-installer and have your new WordPress site up and running in about one minute. In fact, the part that takes the longest is entering a few details such as your site’s name, and the username and password you want to use.
One of the most popular auto-installers is called Softaculous. Some hosting companies give you this option by default when you sign up while it may be an extra cost or not at all available with others. Some hosting providers provide their own auto-installer.
Some hosting providers provide their own auto-installer. If this is the case with your hosting plan, consult your hosting company’s documentation or contact them if you’re not sure how to use this feature.
Most auto-installers are fairly similar to Softaculous so you can generally learn how to use them all when you know how this one works.
If you have cPanel installed on your server as well, you can access the auto-installer by clicking the Softaculous Apps Installer button on your account home page.
WordPress should be listed right on the homepage. Click it to access its auto-installing process.
Click the Install tab to start the installation process. Fill out the information and when you’re done, click Install at the bottom of the page.
While the auto-installer is mostly straightforward to complete, some of the fields may be trickier than others if you’re not too familiar with WordPress.
Here’s an explanation of all the options:
- Choose Protocol – If you have an SSL certificate installed, you can choose to automatically apply it to your site. You can also set whether you want www. to used by default for your URL
- Choose Domain – You can choose from the domains you have already added to your account
- In Directory – You can choose to locate your site in a sub-directory by typing something into this field or leaving it at its default setting
- Site Name – This is the name of your site or blog
- Site Description – This is your site’s tagline
- Enable Multisite (WPMU) – You check click this checkbox to automatically install Multisite
- Admin Username – This is your desired WordPress username to access the admin dashboard
- Admin Password – Your desired password for your WordPress admin account
- Admin Email – The email where your site’s administrative email notifications are sent
- Select Language – The language your admin dashboard should be in
- Limit Login Attempts (Loginizer) – If checked, this option installs the Loginizer plugin to limit how many times a visitor can unsuccessfully try to log in to help prevent your site from getting hacked
- Database Name – If you want to specifically name your database, you can do so in this field or leave it up to Softaculous to create a random database name for you which is the default
- Table Prefix – If you want to change the prefixes of your database tables, you can change it in this field
- Disable Update Notifications – If checked, you won’t receive an email when there are updates available
- Auto Upgrade – When checked, Softaculous can automatically attempt to update WordPress when they become available
- Auto Upgrade WordPress Plugins – Softaculous can also attempt to update plugins if you check the box
- Auto Upgrade WordPress Themes – Similar to the previous option, you can also authorize Softaculous to attempt to update your themes automatically
- Automated backups – This drop down box contains the option to disable automatic backups of your installation or to choose how often backups should be made
- Backup Rotation – If the last option is enabled, this drop down box becomes accessible and you can choose how many backups for Softaculous to save at one time. Older backups are deleted when new ones roll in or you can choose to keep them all
- Select Theme – There are many free themes available in a carousel that you can choose to install. You can choose multiple themes if you want
- Email installation details to – You can enter an email here if you want the details of your installation and site to be sent to you including your username, password, URL and admin URL
When the installation starts, you are directed to a page with a progress bar. When the installation is complete, you’re redirected to a page with your site’s address and admin login page. At this point, your site was successfully installed and you can visit it right away.
When the installation is complete, you’re redirected to a page with your site’s address and admin login page. At this point, your site was successfully installed and you can visit it right away.
Depending on your internet connection, the auto-installer can take a few seconds or three to four minutes on slower internet connections so don’t panic if it seems to take quite a while. It also depends on the resources your server has available to run scripts such as Softaculous.
Wrapping Up – and Dealing with Errors
By now you have successfully installed WordPress and you’re ready to write posts or customize your theme. What seemed like a daunting task actually ended up being quite quick. That doesn’t mean you can necessarily get away with not receiving any errors at all.
If you do receive errors, make sure you didn’t mistype anything when entering your database details and also make sure they’re entered in correctly into your wp-config.php file. You can also create new passwords and re-enter them in if everything seems right, but still doesn’t work. You can also try generating new authentication keys and salts and replacing the old ones in your wp-config.php file.
In the event that none of these suggestions fix the issue, make sure you’re also running the latest versions of the software you’re using. If all else fails, try deleting everything you created and start again. When in doubt, you can also get in touch with the WordPress community in the support forums or also try contacting your host. It’s also worth a try to check out the WordPress Codex’s Installation Guide as well.
For the details on installing WordPress locally and not publicly on the internet, check out some of our comprehensive guides: How to Install XAMPP and WordPress Locally on PC/Windows, How to Develop WordPress Locally with MAMP and The Quick and Easy Guide to Migrating a Local WordPress Installation to a Live Site.
What’s your favorite method of installing WordPress? Do you find the famous five-minute install fast and easy? Would you change anything or add certain capabilities? Share your thoughts in the comments below.