How to Install WordPress on XAMPP Locally How to Install WordPress on XAMPP Locally

How to Install WordPress on XAMPP Locally


Here’s how I install WordPress locally … on my own computer, with no web host, no risk, no cost, and nobody watching. The tool I use for this is called XAMPP. It basically makes your laptop act like a real server – albeit just locally. You can run WordPress on it just like it would online.

This guide shows every step you need to take to set up WordPress using XAMPP on your local machine. I also cover common XAMPP errors and how to fix them. When you finish, you’ll have a working WordPress site that lives only on your computer.

PRO TIP ⚡

If what you’re actually looking for is how to roll out WordPress for a live site, then you might want to consider going straight to a host like Bluehost and let them handle the technical setup for you. Bluehost is a web hosting firm. The way this works is that you select a hosting plan that fits your needs (most of the time it’s going to be the cheap plan at $3.79 / month), and then select the option to have WordPress installed on your setup automatically. Done and done.








Another pro tip 💪

Did you know that there is now more modern software that you can use to install WordPress locally? There are a couple of tools like that, actually, but my favorite and the one I recommend most people use is simply called Local. Here’s a guide on how to install WordPress with it.

Step 1: Download and install XAMPP on your computer

The first step on your way is to download and install the XAMPP software. This is the tool that’s going to allow all of it to happen!

Go to the 👉 official website here. There are versions of XAMPP available for all the major systems, so just pick the one that matches your machine. The installation process itself is similar on all of them, so don’t worry.

It’s a big file, though, about 150 MB, so it might take a minute or so depending on your connection:

download xamppdownload xampp

Once the download finishes, run the file you downloaded to launch the XAMPP installer. If you’re running antivirus software, you might get a warning, but you can ignore it (assuming you’re downloading the app from the official source).

You’ll see the XAMPP installer. To begin, just click on Next and follow the prompts:

xampp installerxampp installer

On the next screen, you can choose which components to install. To install XAMPP and WordPress, you do not need all of the components. You can deselect the developer tools.

xampp dev toolsxampp dev tools

Just click Next a couple times more to get the install process started.

xampp install processxampp install process

Be warned, though, the installation can really take a couple of minutes. It might even seem like it’s stuck. Just be patient and give it time. 👍

When it’s all done, you’ll see a screen like this:

install doneinstall done

Note: If you need a more general guide on installing WordPress in other environments – not just locally, but on live servers as well, then please hop over to our detailed guide on the topic here.

Step 2: Start the modules and test your server

Even though after launching XAMPP all might look like it’s been fully set, there are actually still a couple of steps for you to take care of.

First, go to the Manage Servers tab. Once there start all the services on the list:

xampp servicesxampp services

Simply select each service one by one and click the Start button.

Once you launch them, you should see their status turn to green:

services greenservices green

And now you should be able to test that your local server is working by going to http://localhost/ in your web browser of choice. You’ll see something like this:

server readyserver ready

If all went well, you now have a functioning XAMPP server on your local computer!

Now it’s time to install WordPress!

Step 3: Add the WordPress files

If you’ve ever installed WordPress manually, the rest of the process should feel pretty familiar. First, you need to go to wordpress.org and download the latest version of WordPress.

Then, navigate to the folder where you installed XAMPP. The easiest way to find it is to go back to the main screen of the XAMPP app and click on Open Application Folder:

open app folderopen app folder

Then, open a subfolder called htdocs. Once there, create your own subfolder. This subfolder is going to serve as the home of your website files, so it’s best to give it a descriptive-enough name. I went with myblog:

myblogmyblog

This folder is where you should put all your WordPress files from the WordPress archive that you just downloaded. So first unpack the WordPress ZIP and then move all the contents to your new website folder.

Later on, you will use that folder’s name to navigate to your local site. For example, mine is going to be: http://localhost/myblog

Step 4: Create a database for WordPress

Next, you need to create a database for your WordPress install. To do that, go to http://localhost/dashboard/ and from there click on phpMyAdmin, which is in the top menu:

launch phpMyAdminlaunch phpMyAdmin

Then click on Databases at the top:

phpMyAdmin databasesphpMyAdmin databases

Enter a name for your database and click Create. Your name can be anything – just remember it because you’ll need it for the next step:

create databasecreate database

Unlike installing WordPress on a live web server, when you install it on XAMPP, you don’t need to worry about creating a database user.

Step 5: Install WordPress locally via the on-screen installer

When you visit your test site now, you should see the normal WordPress installer. Remember, your test site is just http://localhost/YOUR_FOLDER_NAME. In my example, that’s http://localhost/myblog

You’ll see this:

main wp installmain wp install

Just click on Let’s go!

The only step where this process will differ from a normal install is the database details. You can simply enter the following:

  • Database Name = Name of the database you created in PHPMyAdmin
  • Username = “root”
  • Password = leave blank

For me it’s this:

my wp databasemy wp database

If all goes well, you’ll see the success screen.

🆘 Possible issue

If the installer cannot write the config file, you’ll see something like this:

cannot write configcannot write config

If that’s the case, just copy the contents of the config, paste it into a new file and save it as wp-config.php – save it in the main folder of your WordPress install. Click on Run the installation once you do that.

At this stage, all that’s left is to set your site title and add your WordPress admin user – this is the user account that will be used to interact with your WordPress install. Simply pick a username and password and click on Install WordPress.

set WordPressset WordPress

When done, you’ll see the final confirmation screen and a link to log in to your site. Click on it and then enter the username and password that you just set a second ago.

That is it! You’ve just installed WordPress locally using XAMPP! You’ll see the main WordPress dashboard.

WordPress dashboardWordPress dashboard

Troubleshooting common XAMPP errors

If you followed this tutorial above, you should hopefully be up and running without any issues. However, in rare cases, you might run into some XAMPP errors which require troubleshooting.

Here are some tips for fixing common XAMPP errors… ⚠️

XAMPP Maximum PHP Execution Time Exceeded error

The Maximum PHP Execution Time Exceeded error is a known issue on WordPress installs created with XAMPP.

Thankfully, you can usually fix it just by editing a single line in one of the XAMPP configuration files.

To begin, open the main XAMPP app again and click on that Open Application Folder button.

open app folderopen app folder

Then, go into a subfolder called etc.

From there, open a file called php.ini in a simple text or code editor like Notepad or Sublime Text.

In the file, search for the following line:

max_execution_time

You should see something like max_execution_time=120.

To fix the maximum execution time error, all you need to do is increase the value of that number. For example, you could try doubling it to 240.

XAMPP Maximum File Size Exceeded error

The Maximum File Size Exceeded error is another issue you might come across, but only once you try to upload files to your local WordPress install later on.

Thankfully, it’s easy to fix, too. In fact, you can fix it from the exact same spot where you fixed the previous error – the php.ini file.

To begin, open the php.ini file (you can follow the steps in the previous section).

Then, search for the following line:

upload_max_filesize

You might see something like upload_max_filesize=40M.

To increase the upload limit and fix the error, all you need to do is increase the number. For example, you could make it upload_max_filesize=80M.

While you’re editing the php.ini file, you’ll also want to make the same change to the post_max_size value.

XAMPP Apache Shutdown Unexpectedly error

This error means that something went wrong with Apache that caused it to crash. Apache is the webserver that XAMPP relies on, so a crash in Apache means your local development sites will stop working.

Because this is such a critical error, we have an entire guide on how to fix the XAMPP Apache Shutdown Unexpectedly error.

Error 403 – XAMPP access forbidden error

Another error message you might get is the XAMPP access forbidden error, which typically manifests as a 403 error when you try to access your database with phpMyAdmin (or sometimes other pages).

Typically, this happens because of a misconfiguration in one of the XAMPP configuration files.

To fix this, open the main XAMPP app again and click on that same Open Application Folder button. Then, go to the etc/extra folder.

Once there, open the httpd-xampp.conf file with a simple text or code editor.

Look for a line of code that starts with Alias /phpmyadmin.

Within that code block, you should see a line that says Require local. Change that line to say Require all granted instead. Like so:

Require all grantedRequire all granted

That should fix the database access error.

What about multisite or staging?

How to install XAMPP and WordPress multisite

If you want to play around with WordPress multisite, it’s also possible to configure that to work on your local host. Rather than duplicating information, though, I’ll just direct you to Vishnu’s post on how to do it.

Should you use XAMPP and WordPress for staging?

While running WordPress on your localhost is a great way to experiment and try things with WordPress, you shouldn’t use it as an actual staging site for a live site.

That’s because it has a different hardware configuration than your live site. So just because something works or doesn’t work on your XAMPP WordPress install doesn’t mean it will be the same on your live production site.

Instead, using your host’s staging service is a much better way to approach this. Or, alternatively, you can set up a staging site directly within WordPress. Here’s a guide on how to do that.

Wrapping things up on how to install WordPress locally on XAMPP

Once you learn how to install XAMPP for the first time, you can quickly spin up new test sites whenever needed.

👉 If you’re interested in some other ways to create local WordPress development sites, we also have a lot of other useful guides:

Do you still have any questions about how to install WordPress locally with XAMPP? Let us know in the comments!

Yay! 🎉 You made it to the end of the article!