How to Install WordPress on your Windows localhost Using XAMPP(4 Steps)

To build a complete website you need to buy a domain name and a server to host your website files. But if you don’t want to launch your website right away and want to set it up completely before going live, set up everything locally.

Why you should install WordPress on localhost?

When you set up WordPress locally, all the files will be stored on your local computer, and this means only you will be able to access your website. This is a great way for you to learn, making a website for free of cost. Also, this gives you a great testing environment that doesn’t affect your live website.

Step 1 – Download and install XAMPP server on your PC

To install WordPress, you need an Apache web server, PHP and MySQL database. All are separate open-source software and installing this software one by one will be a difficult job for beginners. This is where XAMPP comes into the picture.  XAMPP is an easy to install Apache distribution containing Apache web server, PHP and MySQL bundled together. 

Download XAMPP from XAMPP’s official website. Select your operating system and click on the download button.

Download XAMPP from XAMPP's official website
Download XAMPP from XAMPP’s official website.

Wait a few moments after hitting the download button. Because the file is around 150 MB in size, it will take some time to download. After downloading the file, double click the executable file and follow the installation process. 

Xampp setup on Windows
XAMPP serve setup on Windows

Click on the Next button.

Xampp server setup on Windows
Select the required components to install

On this screen, some of the checkboxes will already be checked. It is enough to select Apache, MySQL, PHP and phpMyAdmin and click on the Next button. On the next screen, select the path where you want to install the XAMPP server. You can leave it as default c:\xampp. Click on the Next button.

Xampp installation on Windows
Xampp installation is in progress
Start Xampp server
Remove the tick mark and click the finish button

Once the installation is complete, remove the tick mark “Do you want to start the control panel now?” and click on the Finish button. We have to run the XAMPP control panel as administrators.

Step 2 – Run the XAMPP server and test it

Once the XAMPP installation is complete, you will need to run XAMPP as an administrator on Windows. To do that, click Start, find XAMPP Control Panel in your Programs list, then right-click and select Run As Administrator. Another option is to go to C:/xampp where you have installed the XAMPP server, run xampp_start.exe as administrator.

Run xampp as administrator
Run XAMPP as administrator

This will launch the XAMPP Control Panel.

Run Apache and MySql server on windows xampp
XAMPP Control Panel

First, run Apache and MySQL services on the left side in the Control panel. Observe the green tick mark. This will register the Apache and MySQL server as service and it will start the server on every system reboot. Now click on the Start button for both Apache and MySQL which should look like the below image.  You can track the green running status near to it.

Configure Apache and MySql server on localhost
Start Apache & MySQL in the XAMPP Control Panel

Now is the time to test the XAMPP server. Open http://localhost, if everything is good then it should open the page like the below image. 

Testing XAMPP on localhost
Testing XAMPP on localhost

Step 3 – Download the latest WordPress Version

The next step is to get the most recent version of WordPress from the WordPress.org website. It will be downloaded in a zip format. Open to https://wordpress.org/download and click on Download WordPress.

Download WordPress to localhost
Download WordPress to localhost

This will download a zip file. Extract the files to C:/xampp/htdocs folder as shown below. You are free to change the folder name from wordpress to anything else.

copy wordpress to htdocs folder
Copy WordPress files to htdocs folder

Step 4 – Create a Database

WordPress uses a database to store the text contents. We will create a MySQL database using the phpMyAdmin tool. Open http://localhost/phpmyadmin to launch phpMyAdmin.

phpmyadmin setup on localhost
PHPMyAdmin setup on localhost

Click on the tab Databases, enter the database name and click on create button. This will create a database. You can name the database whatever you want.

Step 4 – Install WordPress on Localhost

We have set up the server and a database. Now is the time to install WordPress. Open http://localhost/wordpress on your browser. This will redirect to the WordPress installation wizard. Follow the below-given steps to install WordPress. 

install wordpress on localhost
Select the language on this installation step
Setup wordpress on localhost
We have everything handy! Let’s start the WordPress installation

On the next step, enter the database name(it is “wordpress” in our case), root as username, leave the password blank as we have not set any password for root user. Click on the Submit button. 

configure wordpress database
Provide the database details for installation
Run wordpress installation
Run WordPress installation

Provide the Website title, a username and a strong password, email id. For security reasons, don’t use admin as a username.

configure wordpress
configure WordPress

After a successful installation, the success message should show.

 WordPress installation success
WordPress installation success

Click on the login button or open the URL http://localhost/wp-admin to log in. Enter the provided username and password, click the login button.

Wordpress login
WordPress login

This will open the WordPress dashboard. This is your backend dashboard or admin panel, from where you would control everything.

wordpress installation success
WordPress installation success

Now is the time to visit your local website. Open http://localhost/wordpress

WordPress website frontend

So, give it a shot and let me know if you have any questions in the comments section below. I’ll be happy to assist you!

Ranjith Kadamboor
Ranjith Kadamboor

Programmer with 15+ years of broad experience in Software Design and Development, Interested in Blockchain and Crypto.

Leave a Reply

Your email address will not be published. Required fields are marked *

Get the latest updates on your inbox

Be the first to receive the latest updates from Codesdoc by signing up to our email subscription.

    StudentProjects.in