When you’re setting out to do WordPress theme development, plugin development, or just offline site building, sooner or later you’ll have to learn how to install WordPress locally on your own machine, rather than awkwardly trying to work on a remote server.
To make that happen, you need a way to bring the server to you, and run the same type of infrastructure locally as is found on a typical WordPress host. One of the easiest ways to do that, especially on Windows, is to install WordPress on XAMPP.
XAMPP can automatically handle running the software prerequisites WordPress needs most, in typical cases that being Apache and MySQL. If you don’t know what these two things are don’t worry, you don’t really need to in order to get WordPress installed locally. All you need to know is they both need to be available, running, and then your good to go.
How to Install XAMPP, Ready for WordPress
XAMPP is available on all three desktop operating systems. However, in my experience XAMPP is the easiest to use on Windows, and for that reason this article will focus on Windows.
In Linux I feel it’s easier to manually install WordPress directly onto the operating system. On Mac it’s a little easier to use MAMP, which incidentally is also compatible with the new M1 chips.
We’ll also be assuming you’re doing just the one WordPress installation.
Head to https://www.apachefriends.org/download.html and download the installer for your operating system. You’ll probably want the one with the latest version of PHP, i.e. the one at the bottom of the list.
The installer is much the same as for any other software - just double click it to run then follow the prompts.
You won’t need to change any of the installation settings, the defaults are all good as is.
Of particular note, you should leave the installation drive as the
C:\ drive in order for things to function correctly.
You may also need to grant approval for XAMPP’s Apache installation to have network access through Windows Defender or any other firewall you might be running.
Continue following the prompts. When the installation is complete, leave the option checked that says “Do you want to run the Control Panel now?”, then close the installer and you’ll see the Control Panel appear. If you missed the chance to leave that box checked, just run XAMPP from your list of installed software to start the Control Panel instead.
There are really only two buttons on this Control Panel you need to know about, and they’re the two Start buttons next to Apache and MySQL. Click both of those buttons and you’ll see their labels change to Running, signifying your local server is now up and running, ready for WordPress to be added to it.
How to Install WordPress Locally with Bitnami
Let’s go through how to install WordPress on XAMPP in the easiest possible way: through the automated installer provided by Bitnami. By using Bitnami to install WordPress you don’t have to do any of the manual tasks otherwise needed, such as setting up databases and configuring WordPress install settings.
Head to https://bitnami.com/stack/xampp#wordpress and download the WordPress module.
Make sure you still see MySQL running on the XAMPP Control Panel, then double click the Bitnami WordPress module to run it as you would a regular software installer.
On the first page of the install wizard you’ll be asked to specify the XAMPP install directory, and the field should be correctly pre-populated with
On the next page you’ll setup the account details with which you’ll log onto your local WordPress site. Enter the login / user name you want to use, your full name or nickname, and an email address.
The next field will ask for you MySQL password. This is a trick question, because unless you went out of your way to change your XAMPP config, there’ll be no MySQL password. So just leave that field blank.
Finally, enter the password you want to use with your local WordPress site account, once in each of the two remaining fields.
On the next page give your local site a name. On the page after that, skip configuring email support by unchecking the box - you almost certainly won’t need it for typical theme or plugin dev tasks. In the following page, uncheck Launch wordpress in the cloud with Bitnami. You don’t need that for now either.
The last page just confirms installation is about to begin. Click the Next button and you’ll see Bitnami go to work installing WordPress.
When it’s done, click Finish, and you’re site is good to go.
How to Run WordPress Locally
Now that you have WordPress installed on XAMPP you’re ready to run it locally any time you need it.
The URLs to visit it are:
It’s a good idea to bookmark these links for easy action.
When you come back for another session in the future you’ll always need to make sure that XAMPP is running, along with its Apache and MySQL services. If you go to the links above and don’t see your site or admin panel, it’s likely because one of those three isn’t running.
How to Locate WordPress Files
Given the main reason you’re installing WordPress locally is probably so you can easily access and edit theme and plugin files, you’ll of course need to find those files.
The location of your WordPress installation’s root directory on Windows should be:
In that directory you’ll see the
wp-content sub-directory, and within that are the
plugins sub-directories. You can edit away on any of those files and see your changes immediately in your local WordPress site.
You’re All Set!
That’s everything you need to know about how to install WordPress locally on XAMPP. Have fun with local, offline development and file editing!