Having a local WordPress installation is imperative for people who are working with a WordPress-based website. It will help you save time by allowing you to modify files faster and easier as you don’t have to upload and/or download files from a web server to make changes.
To install WordPress locally, first you need to have a running local web server. We’re going to see how to install a local web server on your PC and then install WordPress on it in this article. If you are having issues, refer to the troubleshooting section at the end of the article.
In order to run WordPress locally, you need to install a web server on your PC. There are several software packages that you can use to install a local web server, but for this article we’ll only be covering XAMPP and WAMP as they are the most popular choices.
We’re going to learn how to install and configure XAMPP first.
First, download XAMPP from this link. We’re going to walk through XAMPP installation. Follow the instructions below to install XAMPP and configure it to work flawlessly with WordPress.
Double click on your downloaded file and click yes if prompted by UAC.
Once you have accepted all of the prompts, you’ll be greeted with a screen similar to the one above. Click Next.
For WordPress, we only need Apache, MySQL, PHP, and phpMyAdmin. If you plan to develop other kinds of web applications or if you need the other features here, feel free to check them. Once you are done, click Next.
In the next part, we’re going to choose which folder to install XAMPP in. The default is fine. Click Next.
Since we are learning how to install WordPress locally manually, uncheck the box “Learn more about Bitnami for XAMPP.” Click Next. Click Next again and XAMPP will begin installing.
During the installation process, a firewall prompt might pop up asking you if you want to allow Apache to communicate on your networks. Choose Allow access.
Once installed, you’ll be prompted to indicate whether you want to start XAMPP’s control panel. Leave it checked and click Finish.
After clicking Finish, you might also receive a prompt to choose which language you want XAMPP to use. I’m assuming you want to choose English, so select the US flag and click Save.
After all of those steps, you should now see XAMPP’s control panel start up.
Now, start Apache and MySQL. You might get another firewall prompt for MySQL, just choose Allow access.
After starting Apache and MySQL, XAMPP’s control panel should look similar to the image below:
If the words Apache and MySQL are highlighted with green, it means that everything is running fine and no problems are detected. Alongside them are their PID and their active ports. To verify that the server is working, open your favorite browser and point it to localhost. You should be greeted with a web page similar to the one below:
Great! We now have a local web server up and running! Time to install WordPress!
It’s time for the encore! To install WordPress in XAMPP, download the latest version from the WordPress.org website.
After downloading the archive, move it into XAMPP’s htdocs folder. You can find this folder inside XAMPP’s installation directory.
You may want to delete everything inside the htdocs folder to make it clean and install WordPress in the root of htdocs. If you do that, opening localhost in your browser while the server is running will immediately open WordPress. But for the sake of simplicity, we’re going to leave everything as it is and extract the contents of the WordPress archive into a folder that we’re going to call “wp.”
Now, we’re going to create a database for our WordPress site. Open your favorite browser and navigate to: localhost/phpMyAdmin or you can open the XAMPP control panel and click the Admin button in the MySQL section.
Your default browser should open phpMyAdmin.
From there, we will be able to access phpMyAdmin, which we’ll use to create a database for our local WordPress installation. Click on Databases near the top left corner.
From there, you will be taken to a page where you can create a new database. Let’s name it “localwp,” then click Create and we’re done.
Now, it’s time to install WordPress. Open your browser and go to localhost/wp/. If you used a different directory name, use that directory name in place of /wp/.For example, if you named your WordPress directory “wordpress,” you should open localhost/wordpress/. After typing the correct URL, you should now be redirected to a page similar to the one below:
Click the Let’s Go button. You will be taken to the database configuration page. Enter the name of the database you created earlier in the database. If you followed the tutorial, it should be localwp. For the database username, use “root” and for the password, leave it blank. Leave the others at their defaults.
Click Submit once you are done. WordPress will then greet you with a message similar to the one below if it successfully connected to your database.
Time to run the install! After that, you will be asked to supply additional information.
Pick whatever username and password you want, add a site title if you want, then add a dummy email. After that click Install WordPress. Once the installation is finished, you will be greeted with a welcome screen stating that the installation is a success.
And that’s it! You now have a working local server with WordPress installed! Pro tip: you can use your local server just like a live server: you can install other web applications on it or you can use it to start paving your way to becoming a professional web developer!
In this section, we are going to learn how to install WAMP on your computer and install WordPress on it. The first step is to download WAMP and the latest version of WordPress. Once you’ve downloaded them, we will install WAMP first and then WordPress.
Once you have downloaded WAMP’s installation file, double click on it and choose Yes when prompted by UAC. After that, you will choose what language you want to use for your installation.
After choosing the language comes the license agreement. Read it, choose I accept, and click Next. Now here’s the important part. WAMP’s installer gives us a fair bit of warning before proceeding. It tells us to make sure that we have VC9, VC10 and VC11 installed, or else WAMP won’t run. In addition to that, it also tells us that we need to have VC13 and VC14 installed if we want to use PHP 7 and Apache 2.4.17. If you have them already installed, you can skip this part, but if not, continue.
Upon scrolling down WAMP’s installation window, you’ll be able to find the links for the required visual studio redistributables.
Download and install both 32bit and 64bit versions of the required VC packages if you don’t have them installed. After you finish installing all of them, you might need to reboot your PC before continuing. Remember to install these required files before proceeding with the installation to avoid any problems.
To verify that all of the requirements are installed, right click on the start menu, then choose Apps and Features. (This is for Windows 10, for other versions of Windows, just locate “Control Panel > Programs”)
A new window will open. From there, click on Programs and Features.
This will show you all currently installed programs on your computer. Check if the following are installed:
If all of them are present (take note that yours might have different versions as they might already be updated at the time of your reading), then you’re good to go. We can now proceed to install WAMP.
Continuing where we left earlier, it’s now time to choose the destination folder. You can either leave it to default or change it.
Once you’re done, click Next and then choose whether to create a start menu shortcut or not. Once you’re done with that, verify your settings and continue the installation. It might take a while.
Once the installation is finished, it will ask you what default browser to use. Let’s see how to change it to use Google Chrome. Choose Yes when prompted as shown in the image below:
Navigate to Chrome’s installation folder and locate its executable. It should look like this:
The typical path of Google Chrome installation is C:\Program Files (x86)\Google\Chrome\Application. Once you have located Chrome’s .exe file, select it and then click open. Now, Google Chrome will be WAMP’s default browser.
After that, it will ask you for the default text editor. For the sake of simplicity, we’ll leave it to the default, but feel free to change it to whatever text editor you’re using by doing the same thing that we did with the browser.
For the next step, another prompt will appear, asking if you want to allow WAMP to communicate through the Firewall. Of course, we’ll choose Allow Access.
Finally, the installation window will provide a bit of information about WAMP server’s usage. Read it so you fully understand how to use WAMP and click next.
Finally, click Finish. Now we have WAMP installed. It’s time to test it out. Double click on WAMP’s icon in the start menu or from a desktop shortcut. You will then see the “W” icon in your taskbar and it will turn green, meaning that it’s now running in the background. If it doesn’t turn green, there are issues that you need to resolve. Refer to the troubleshooting section below.
To test it out, click on the icon and choose localhost.
If you followed the steps earlier, it should open up Google Chrome and point to localhost. If everything is working correctly, you will see a page similar to the one below:
You can see WAMP server’s information and status from here. There will be things such as loaded Apache extensions, what versions of PHP and Apache are running, and the links for other important tools that you might need in the future.
All right, now we have a local web server up and running! It’s time to configure our database for WordPress. Scroll down until you see the link to phpMyAdmin and click it.
You will be taken to the phpMyAdmin interface. Log in using root as username and no password. Take note: for a local development server, it’s okay to leave it as it is, but for a production server, you should change phpMyAdmin’s login credentials.
Now, it’s time to create a database.
Click on the Databases menu option as shown in the image below:
From there, we have the option to create our new database. For this tutorial, let’s call our database “local_wordpress.” Feel free to call it whatever you want, but make sure that you remember it. Once you’ve chosen a name, click create.
Once it succeeds, you should see your new empty database listed on the left side panel.
Now, it’s time to install WordPress. Extract WordPress to the root of WAMP’s www folder.
Now, open your browser and navigate to localhost/wordpress/ and you will be redirected to WordPress’s setup page. The first part of the installation is choosing your language.
Choose your language and click next. This time, you’ll be presented with a welcome page telling you what’s going to happen on the next steps. Read it, then click Let’s Go.
On the next page, you’ll have to enter your database details. If you followed this tutorial word for word, you should use the following options (adjust accordingly if you changed something; for example, the database name).
Once you click submit, you should see a message similar to the one below:
Click Run the Install. In the next step, you’ll provide WordPress with additional necessary information such as site title, username & password, email, etc.
Note: the values above are for reference only. Choose whatever values you want to use here.
Once you’re done filling up the details, click Install WordPress. If all goes well, it will be a success and you will be greeted by WordPress with a link to the login page.
One of the most common issues with WAMP and XAMPP is the port. Sometimes, you might have software installed that uses the default ports used by Apache and MySQL. The default ports used by Apache is port 80 and MySQL uses port 3306. If any other installed application uses those ports, Apache and/or MySQL simply won’t work properly.
To check whether an application uses those ports, run the following command in an elevated command prompt:
Once you run that command, you will see a list of all running process along with other bunch of information about them including the port number that they occupy. In the following screenshot, you can see that httpd.exe and mysqld.exe use their original port (80 and 3306) with no problem.
However, if other applications are running occupying any of those ports, these applications won’t start.
Skype is one of the prime causes of port problems in web servers. If you have Skype installed, you need to disable the option “use port 80 and 443 for additional incoming connection” as shown in the image below:
Go to Skype’s Options > Advanced > Connections. Untick the option and restart Skype. Now your problems should be resolved.
Alternately, you can change what ports are used by Apache and MySQL. For XAMPP, open the control panel and then click config and then open Apache (httpd.conf):
A text editor will open up loading the httpd.conf file. Find the line that specifies which port Apache uses. Refer to the image below:
Change it to other ports such as 8080, etc. Just make sure to choose an open port. Do the same for MySQL:
Then find the following line and change it to other port:
For WAMP, we can do the same. WAMP, however, makes changing ports easier. Start WAMP and then right-click on its icon in the taskbar. From there, click Tools and you can see options to use other ports:
Clicking on either option for Apache and MySQL will open up a dialogue box where you can directly input your alternate desired port:
Once you are satisfied, hit OK. To test and confirm that WAMP is using your specified port, right click on its icon in the taskbar again and choose test port [your chosen port number]. In the example below, the custom port was 1665.
You can test the port or change it. You can also verify that it’s using your custom port by seeing the heading which says “Port used by Apache: [your custom port]”, which in this example, is 1665. Upon clicking the Test port used option, a command prompt will open up and test if the port is open or not. If the port is successfully configured and working, you should see a message similar to the one below:
And that’s it! Now you know how to resolve port conflicts and how to specify custom ports for both WAMP and XAMPP!