CMS Windows

Set Up WordPress Locally Using XAMPP on Windows 11

Richard
Written by
Richard
Mar 3, 2025 Updated Apr 17, 2026 4 min read

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:

Install XAMPP on Windows 11

Install XAMPP on Ubuntu 24.04

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.

XAMPP shell button

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.

Create databse phpMyAdmin

Step 3: Download and Set Up WordPress

Go to your computer’s folder at C:\xampp\htdocs and create a new folder named wordpress.

XAMPP WordPress folder

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.

Wordpress select installation language

Click “Let’s go” to start.

WordPress begin installation

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

WordPress set up database connection

Click “Run the installation”.

WordPress set up begin installation

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

WordPress install wordpress

You are all set!

WordPress set up complete

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?

To install XAMPP on Windows 11, download the installer from the official XAMPP website, run the downloaded file, and follow the installation prompts. Make sure to select the components you want to install, such as Apache, MariaDB, and PHP.


What is the purpose of creating a database for WordPress?

Creating a database for WordPress is essential as it stores all your website content, including posts, pages, and user information. Without a database, WordPress cannot function properly.


How do I create a WordPress database using XAMPP?

You can create a WordPress database using XAMPP by accessing the MariaDB command line through the XAMPP Control Panel. Use the command 'CREATE DATABASE wordpressdb;' to create the database and then set up a user with the necessary permissions.


Where do I download WordPress files for local installation?

You can download the WordPress files for local installation from the official WordPress website. Once downloaded, extract the files into the 'C:xampphtdocswordpress' folder to set up your local site.


How do I access phpMyAdmin in XAMPP?

To access phpMyAdmin in XAMPP, open the XAMPP Control Panel and click on the 'Admin' button next to MySQL. This will open phpMyAdmin in your web browser, allowing you to manage your databases easily.

Was this guide helpful?

Richard

About the Author

Richard

Tech Writer, IT Professional

Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.

Leave a Reply

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

Exit mobile version