Did you know that you can install WordPress on your own Windows computer for learning and testing? Working with WordPress for Windows is a great way to test plugins, updates, and other website changes before pushing them live to your audience. In this article, we’ll show you how to install WordPress locally using XAMPP.
Setting up XAMPP on your Windows machine is by far no easy feat, let me tell you! But once it’s installed, it’s a breeze to run and will save you a bunch of time if you need to run WordPress locally. In fact, you’ll forget it’s even there. Having a localhost environment is an essential part of my WordPress workflow – I couldn’t do my day job without it. I regularly set up new installs of WordPress to test and play with new versions of themes and plugins, and I have multiple Multisite installs set up, too.
What is XAMPP?
XAMPP, also called XMPP server, is a compilation of Apache web server, PHP and MySQL bundled for Windows computers. You need XAMPP to set up your own local server environment and install WordPress on Windows. There are other clients for Windows such as WAMP, but we use and recommend XAMPP. It is free and easy to use.
Installing XAMPP Server on your PC
The first thing you need to do is go to the XAMPP website and download the latest XAMPP. You will be presented with various options on their download page. Simply choose the one that applies to your Windows (64-bit or 32-bit). When in doubt, select the 32-bit version because it will also work on 64-bit versions of Windows.
Fixing Port Errors
The main reason why XAMPP throws up errors like this is due to another program on your machine using ports 80 or 443 – the ports Apache and MySQL need in order to run.
If you’re using Windows 10, World Wide Web Publishing Service is most likely using post 80. This program, which is for Internet Information Services (IIS) for Windows® Server, comes pre-installed and if you’re not using it, you can simply stop the service running on your machine or even delete it.
To stop the service running, do the following:
- Go to Start, type in “services.msc” and select the best match
- Scroll down in the Services window to find World Wide Web Publishing Service
- Right-click on it and select Stop
- This should free up port 80. When you restart XAMPP it should run without errors
If that doesn’t resolve the issue, you can set up a new firewall rule to forcibly unblock the ports:
- Open Windows Firewall on your machine and > click on Advanced Settings on the left
- Click on Inbound on the left, then on the far right click New Rule
- Click Port and then TCP. In the field below for Specific Ports type in “80, 443” and click Next
- Check Allow the Connection then click Next
- Make sure all options are checked and click Next
- In the name field, enter whatever you want, but for the sake of consistency let’s type in LOCALHOST1. Click Finish
- Now repeat steps 1-6, but name this new rule LOCALHOST2 and click Finish
- Restart your computer
Ports 80 and 443 should now be open locally on your computer.
I should also mention at this stage that if you get any security/firewall warnings while installing or using XAMPP (such as the prompt pictured below), make sure you check “Private networks, such as my home or work network” and click “Allow access.” This is very important. If you don’t allow access, XAMPP won’t work.
Setting Up Your MySQL Database
Before we install WordPress, we need a database.
In your XAMPP Control Panel, click the Admin button in the MySQL section.
A new browser window will automatically open with the phpMyAdmin interface.
Click on Databases near the top-left, and you’ll be prompted to create a new database. I’ve called mine “WP.”
When you’ve entered a name, click Create and close the window.
Installing WordPress on Windows with WAMP
The next step is to install WordPress. You will need to download a copy of WordPress from WordPress.org. Go ahead and extract the zip file and copy the WordPress folder.
After that, you need to navigate to the folder where you installed XAMPP.
In our tutorial, we installed it in C:\XAMPP, so we’ll refer to that folder going forward. But keep in mind, it may be different for you depending on where you installed the program.
Paste the WordPress folder into the C:\XAMPP\htdoc folder.
You can rename the WordPress folder to anything you want, such as mysite, cmsfolks, etc. This will be the URL of your local WordPress site, so be sure to choose something you’ll remember easily. For the sake of this tutorial, we renamed our WordPress directory to mysite.
Now open your web browser and go to http://localhost/mysite/
The WordPress database setup will start automatically. First, it will ask you to select your language. After that, it will show you some information about setting up your database. Click the Let’s Go button when you’re ready.
On the next screen, you’ll need to provide your database information. The database name will be the one that you entered in the last step. In our case, we called it test_db.
Your default database username will be root and you can leave the password blank.
Next, click on the submit button and WordPress will create a configuration file for you.
After this you will see a screen informing you that WordPress has successfully connected to your database, and you can proceed with the installation.
Go ahead and click the Run the install button.
On the next screen, you can fill out the installation form. You need to provide a title for your website, choose an admin username/password, and provide admin email address.
Once you’re ready, press the Install WordPress button.
You can also read: How to install Drupal on a Local PC
XAMPP provides an easy way to run a local server environment on your Windows machine, allowing you to test and develop locally, rather than installing WordPress on a live site. It will also save you a bunch of time since you won’t have to install and uninstall WordPress each time you test themes and plugins.
The great thing about XAMPP is it’s free and open source. You can set up as many installations of WordPress as you want and it’s just as easy to get Multisite up and running.