How To Install WordPress Locally (Step-By-Step)

Having WordPress installed locally gives you a controlled environment to safely build and test new features without messing with a live environment. This is your sandbox, and it’s a great way to get your practice in without accidentally taking down your website.

Whether your a full-time blogger or a hobbyist, you might want to master WordPress, like, the back of your hand. Since blogs are living documents, they will need updating constantly. And while it is not required, having some knowledge as to how all the pieces fit together allow you to manage your website more effectively. It pays many times over to be astute with the WordPress skill.

So here’s how you do it. You will need two pieces of software. Namely, WordPress software and a webserver software. Both are opensource and freely available for download. See links below:

  1. Get the WordPress software from wordpress.org (Official Website) 
  2. Get the webserver software (XAMPP) from apachefriends.org (Official Website) 

Note: XAMPP is a cross-platform open-source Apache webserver solution; this software package will run locally on your computer. While there are multiple modules in this software package, the two main modules or components you will need are the Apache webserver and MySQL database server. (Want more info?) Follow Wikipedia for more information on XAMPP. Also note that while the instructions here are written for Windows computers, the same concept is applied to Mac or Linux computers. 

Directions:

After you’ve downloaded the software, follow the instructions below to set it up. There are a few steps to accomplish this, so let’s unpack all of that. Step 1: Install the webserver (XAMPP). Step 2: Install WordPress on your computer. Step 3: Connect WordPress to the database on the XAMMP webserver.

Step 1: Install The Webserver (XAMPP)

Install XAMPP. Locate the installer file and run it. The installer filename should look something similar to this: “xampp-windows-x64-8.1.6-0-VS16-installer.exe

Once launched, you will see a popup dialog box similar to the one below.  

1.1. Select “OK”  
1.2. Select “Next” 
1.3. Here, just select the basic components above (Apache, MySQL, PHP, and phpMyAdmin). No need to install the others (you can always add them later on an as needed basis). Then select “Next” 
1.4. Leave the default location. But if you prefer, you can change the location to your preference. Then select “Next” 
1.5. Click “Next” 
1.6. Uncheck “Learn more…” You can always look it up as needed. Then select Next 
1.7. Select “Next” to install XAMPP (crossed-platform Apache server)
1.7. Installation continues…
1.7. And continues…
1.8 If firewall popup-dialog box appears like this one, select “Private networks…”, then click on “Allow access” 
1.9 Select “Finish” and launch the XAMMP Control Panel 
1.10 Start the web (Apache) server. Then the database (MySQL) server 
1.11 Toggle on “Private networks…”. Then select “Allow access” 
1.12 Click on “Admin” for MySQL (see picture above) to set up a blank database for WordPress. You can also achieve this by keying the following from a browser: “http://localhost/phpmyadmin/” 
1.13 Click on the “Databases” tab to create a blank database for WordPress. It’s important to get this correct! 
1.14 Then, give the database a name like “database4wordpress” or any name you like, then click “Create”.

This is the database that will hold all your posts, pages, media, and WordPress related components, etc. At this point, you are done with the database server and the web server. 

Note: Remember the database name (“database4wordpress”), as you will need it later when you set up WordPress. This is necessary and important, as WordPress will need to know where to store its data. So it needs to connect to the database you just created. 

STEP 2: Copy The “wordpress” Folder To “C:\xampp\htdocs”

Locate and unzip the WordPress file that you downloaded earlier and just copy the entire “wordpress” folder and paste it in the “C:\xampp\htdocs” folder. See below: 

2.1 Copy the “wordpress” folder 
2.2 And paste it into “htdocs” folder (C:\xampp\htdocs), like example above 
2.3 It should look something similar to this when you’re done with copying the folder.

You can rename it to anything you like or just leave the default (“wordpress”). Here, it was left alone with the default name. Remember to note down the name, as this is the name of your test website that lives on your local computer.

STEP 3: Set Up WordPress And Link It To The Database You Created Earlier

From a browser, type in the following URL: “http://localhost/wordpress/wp-admin” to set up your WordPress website. 

3.1 Enter the following URL: “http://localhost/wordpress/wp-admin” to set up WordPress
3.2 You should land on a page like this. Click “Continue” 
3.3 Click on “Let’s go!” 
3.4 Connect WordPress to a database by typing in the information above and click on “Submit”. Also, see table below.
Database Name:  database4wordpress 
Username:  root 
Password:  Leave the password blank for now 
3.4 Database information you created earlier in step 1.13
3.5 Next, click on “Run the installation” 
3.6 Set up a WordPress admin account by filling in the information above. Then click on “Install WordPress” 
3.7 You should get the “Success!” dialog box similar the one above, if all went well.

It will ask you to log in with the username and password you just created. So click on “Log In” above to go to the logon page. 

3.8 Here, enter your credentials and log in.
3.9 Once logged in, you should get a welcome page similar to this one. Toggle the “Collapse menu” if necessary.

Your set up is now complete. You now have a working WordPress website installed locally on your computer. This is your proving ground! 

If you need multiple websites running on your local webserver, you can. Just place another copy of the “wordpress” you previously downloaded into “C:\xampp\htdocs“. Remember to rename it to something else, so you don’t overwrite your current one.

Click on “Pages“, it should look similar to below. This is your proving ground. And if it crashes, no one gets hurt. 

3.10 Here’s how the “Pages” console should look like.

Your WordPress website is now ready and you can use it with the default. However, I would change the naming convention for the permalinks.  

3.11 From “Settings”, select “Permalinks”, then choose “Post name”. Then scroll toward the bottom and click “Save Changes” to update your preference.