Set Up WordPress Locally Using XAMPP on Windows 11
This guide explains how to set up a private, local version of WordPress on your Windows 11 computer using XAMPP.
XAMPP is a free tool that turns your computer into a web server. It lets you run software like WordPress locally without needing a live internet connection.
You can also use XAMPP on Windows or Ubuntu to achieve similar results.
Why use a local environment?
Running WordPress locally is perfect for testing new themes, trying out plugins, or building a website from scratch without the public seeing your work in progress. When you are done, you have a fully functional website ready to be moved to a live server.
Step 1: Install XAMPP
XAMPP packs together everything needed to run WordPress, including Apache and a database. If you do not have it yet, follow the instructions in these guides:
Step 2: Create a WordPress Database
WordPress needs a database to store all your text and settings. Open your XAMPP Control Panel and click the ‘Shell’ button to start.

Note: This step requires admin privileges.
Log into your database server with this command:
mysql -u root
Now, run these commands to create your database and a secure user account:
CREATE DATABASE wordpressdb CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
CREATE USER wordpressdbuser@localhost IDENTIFIED BY 'type_your_password_here';
GRANT ALL ON wordpressdb.* TO wordpressdbuser@localhost;
FLUSH PRIVILEGES;
exit
Make sure to change type_your_password_here to a password you will remember. If you prefer a visual interface, click the ‘Admin’ button next to MySQL in the Control Panel to use phpMyAdmin instead.

Step 3: Download and Set Up WordPress
Go to your computer’s folder at C:\xampp\htdocs and create a new folder named wordpress.

Download the latest version of WordPress from official download page. Extract the files and move them into your new wordpress folder.
To make sure your browser opens your site automatically, find the index.html file in C:\xampp\htdocs and replace its contents with this code:
<?php if (!empty($_SERVER['HTTPS']) && ('on' == $_SERVER['HTTPS'])) { $uri = 'https://'; } else { $uri = 'http://'; } $uri .= $_SERVER['HTTP_HOST']; header('Location: '.$uri.'/wordpress/'); exit; ?>
Save this file and restart Apache in your XAMPP Control Panel.
Step 4: Complete the WordPress Installation
Open your web browser and go to http://wordpress.example.com. You will see the WordPress setup screen.

Click “Let’s go” to start.

Enter the database name (wordpressdb), the username (wordpressdbuser), and the password you created earlier. Click “Submit”.

Click “Run the installation”.

Fill in your site title and create your admin login details, then click “Install WordPress”.

You are all set!

Summary
By installing XAMPP and configuring a local database, you have created a private environment to build your website. This setup allows you to develop and experiment safely on your own machine. When you are finished, you can easily migrate your local site to a live web host.
[C:xampphtdocswordpress]
How do I install XAMPP on Windows 11?
What is the purpose of creating a database for WordPress?
How do I create a WordPress database using XAMPP?
Where do I download WordPress files for local installation?
How do I access phpMyAdmin in XAMPP?
Was this guide helpful?
Leave a Reply Cancel reply