How to Install WordPress Locally with XAMPP?

If you are a routine website developer, installing WordPress on your local machine can be very useful. It helps you test new features such as themes and plugins without interfering with the live site. Moreover, running your site in a local server environment allows you to learn WordPress development without the fear of messing up things. In this article, we will learn how to install WordPress and set up a website locally using XAMPP.

What is XAMPP?

To run a WordPress site locally, you need to have web server software (Apache, PHP and MySQL) on your PC. Installing each software independently is both tedious and time-consuming. XAMPP is a cross-platform that installs Apache distribution with MySQL, PHP and Perl. It is lightweight localhost that enables you to develop WP sites locally. Besides, XAMPP is available for various OS including Windows, Linux and macOS.

How to Install WordPress Locally with XAMPP?

  1. Download and Install XAMPP on Your PC
  2. Starting Modules and Testing XAMPP Server
  3. Setting up a Database for WordPress
  4. Download and Add WordPress Files to XAMPP
  5. Installing WordPress with XAMPP

1. Download and Install XAMPP on Your PC

Downloading XAMPP is free and straight forward, but you need to select the right version for your system. Visit the Apache Friends website and click the download link for your platform.

XAMPP Download
XAMPP Download

Run the downloaded file to launch the XAMPP installer. Depending on your system settings, you may receive warning prompts. Continue through the prompts to open the setup wizard. Click the “Next” button on the setup screen to continue with the installation.

Welcome Screen
Welcome Screen

Related: Install WordPress using Local by FlyWheel.

Related:  How to Install and Uninstall Apps in Mac?

The resulting window allows you to select components that you would like to install. Since you need XAMPP to run local WordPress sites, you can check MySQL and phpMyAdmin only. Note that, you cannot uncheck PHP and Apache as both are basic components for running XAMPP.

Select Components
Select Components

Next, you will need to select a folder where you want to install XAMPP. You can choose a folder or leave it as default and then click “Next”.

Installation Folder
Installation Folder

On the next screen, the installer prompts whether you want to install Bitnami, a free tool that offers free installers for WordPress, Joomla and Drupal. Since you want to install WordPress manually, uncheck the option and continue.

Uncheck Bitnami
Uncheck Bitnami

Now the setup is ready to install XAMPP. Click “Next” to start installing and wait for a few minutes to complete the installation. Once it finishes, check the option for starting the control panel and click the “Finish” button.

Complete Installation
Complete Installation

Related: How to move live WordPress site to local server?

2. Starting Modules and Testing XAMPP Server

If the XAMPP was installed and everything is running properly the updates text at the bottom of the control panel will be in blue and black. Any issues are indicated in red text. You can now start the modules:

  • Click on the “Start” button next to “Apache” and “MySQL” modules.
  • If you get firewall prompts, click “Allow Access” for both modules to run on your PC.
  • You will notice a green colour highlighting both names when they start successfully.
Start Services
Start Services
  • On your browser, visit http://localhost to test the XAMPP server.
Test Server
Test Server

3. Setting up a Database for WordPress

Before you create a local WordPress site, you should create a database with MySQL.

  • To do so, click the “Admin” button for the “MySQL” module to launch the phpMyAdmin page on your browser.
Mysql Admin
Mysql Admin
  • Click the “New” option on the left panel of the phpMyAdmin dashboard, type a name for the database and click “Create”.
DB Setup
DB Setup

4. Download and Add WordPress Files to XAMPP

Visit the WordPress official website and download the latest version of WordPress. Now open the zip file, extract and copy the “wordpress” folder (contains the WordPress files). Navigate to the folder where you installed XAMPP (C:\xampp for our case). Open the “htdocs” sub-folder and paste the “wordpress” folder; you may rename the folder. 

Related:  How to Install or Uninstall Programs in Windows 10?

This will be the sub-name for accessing your local WP site i.e. ‘http://localhost/mysite’ if you renamed the folder to “mysite”.

Add WP Files
Add WP Files

5. Installing WordPress with XAMPP

Now visit your local site from the browser using the URL, ‘http://localhost/’ and click “Let’s go” to configure. Enter the database details as follows:

  • Database name: the name of the database you created in step 3 above.
  • Username: type ‘root’.
  • Password: leave the password field blank.
  • Database Host & Table Prefix: leave the default settings and click “Submit”.
DB Details
DB Details

On the welcome, click the link to run the WordPress installation. Fill in the WordPress site details in the next page and click the “Install WordPress” button.

Install WP
Install WP

After successful installation, your local WP website is ready for use. You can now log in to the admin dashboard and start building your site.

Summary

XAMPP offers a local server environment to enable you to develop WordPress websites locally. This allows you to learn and test various features like plugins and themes without breaking the live site.

Recommended Articles:

Leave a Comment