How to Install & Use WordPress Locally with XAMPP

use XAMPP with wordpress

WordPress is arguably the most flexible Content Management System (CMS) available. However, making changes to your site isn’t always a sure thing. In fact, changes to your website’s themes, plugins, or code can wreak havoc if not implemented properly.

Fortunately, it’s possible to test out changes before making them on your live site. This can be achieved with a local installation of WordPress, along with the help of a tool such as XAMPP.

In this article, we’ll introduce XAMPP and its various uses. We’ll then show you how to install it on your computer (both PC and Mac) and configure it properly with WordPress to create a local site. Finally, we’ll touch on ways you can use the local installation most effectively. Let’s get started!

What Is XAMPP?

Simply put, XAMPP is an open-source web server solution that enables you to create a local version of WordPress on your computer. This local version can be used without internet access, and it’s commonly referred to as a ‘sandbox’ or ‘local environment’. Essentially, you can play around with different options and settings without interrupting your live site.

Why Install a Local WordPress Site?

Given that a live WordPress site can be accessed on your computer without internet, the ability to test changes on your WordPress site without them affecting your live site is a huge benefit.

You can see how different changes will appear on your site, as well as whether they’ll cause any issues with your current setup. What’s more, you can ensure your site is properly optimized for a positive User Experience (UX), before letting real users loose on it.

WordPress XAMPP Tutorial

There are two major steps when using XAMPP to create a local WordPress site. The first requires the installation and configuration of the software, and the second involves installation of WordPress.

How to Install XAMPP

As open-source software, XAMPP is free to download and install on your computer. To begin, go to the XAMPP website and choose the version you need (Windows, Linux, or Mac):

how to install XAMPP

Once the file is downloaded, double-click it to open the Setup Wizard, and click Next. First, you’ll need to select the components to include in the installation. For WordPress, all you need is Apache, MySQL, and phpMyAdmin. Once you’re ready, click Next:

XAMPP download steps

Once you’ve selected a folder to save the installation to and clicked Next, your installation will begin – it should only take a few minutes:

xampp download tutorial

Once the installation is complete, you can open the Control Panel immediately, or uncheck the box and open it later. Opening it will display the following screen:

install and configure xampp

At this point, the installation and configuration of XAMPP is complete. It’s now time to move on to installing WordPress.

How to Install WordPress in XAMPP Locally

This will require a bit of file editing, although you should be up and running within the hour. Open the XAMPP Control Panel, then under Actions, select Start for both Apache and MySQL:

how to install wordpress in xampp

Once they’re both running successfully, you’ll need to create a database. To do so, click Admin next to MySQL:

install wordpress in xampp locally

A new browser window will open, and you’ll now have access to the phpMyAdmin tool, which in a nutshell, enables you to tinker under the hood of your server (in this case, your computer’s directory):

Install wordpress to use with xampp

Next, click Database in the top left corner of the interface and Create database by entering in the name of your choosing. Click Create:

how to install wordpress in xampp

With the new database in place, it’s time to install WordPress. Go to WordPress’s Download page and download the latest version. While the file will save to your computer’s dedicated download folder, we need to unzip it to the ‘right’ folder.

Find the XAMPP folder on your computer, and within that open the htdocs folder. Here, you’ll create yet another folder named after your database. Drag and drop the WordPress ZIP file you downloaded into this new folder, and right click. Choose Extract here.

Next, locate the wp-config-sample.php file, rename it to wp-config, then open the file and find the line reading // ** MySQL settings – You can get this info from your web host ** //:

step by step wordpress install with xampp

Here, replace the following placeholders:

  • database_name_here to the name of your created database.
  • username_here to root.
  • password_here should be left blank.

In all instances, keep the single quotation marks intact, save the edited file, then close the editor.

You can now install WordPress! Enter http://localhost/name-of-database/ into your browser’s address bar (replacing the name-of-database placeholder accordingly). You should see the WordPress translation screen. Choose your language, click Continue, then complete the rest of the installation process:

wordpress installation with xampp

At this point, your WordPress installation should be all set! You can now go to http://localhost/name-of-database/wordpress/wp-admin to log in to your local WordPress installation.

How to Install WordPress in XAMPP on MAC OS

Of course, WordPress can also be installed locally using XAMPP on macOS, with one key difference. When downloading the XAMPP software, select OS X from the versions area of the web page.

That’s it! The rest of the process follows a similar path. So, whether you have PC or Mac, you can enjoy the experience of using a local WordPress site.

How to Use WordPress with XAMPP

With WordPress and XAMPP configured, you can take website development to the next level. For example, you could work on a new design for your product landing pages, or install a new plugin to see how it works with your current plugins and setup.

You no longer have to worry about making changes that interrupt a user’s experience, or will potentially harm your site. If you want to test out your current website configuration, you can even upload the backup files from your current website to create a ‘mirror’ site. Your local site will now have everything your live site has – posts, pages, plugins, themes, and more.

WordPress is a robust CMS enabling you to develop a website that goes above and beyond. With this in mind, you need a host such as WP Engine. Take a look at our managed hosting plans – including free SSL certificates and automated site migration – to see what we have to offer!

Get started.

Build faster, protect your brand, and grow your business with a WordPress platform built to power remarkable online experiences.