Skip to content
Follow
Windows

How to Set Up WordPress on Your Windows 11 PC Using XAMPP

Richard
Written by
Richard
Jan 31, 2026 Updated Oct 4, 2026 6 min read
How to Set Up WordPress on Your Windows 11 PC Using XAMPP
How to Set Up WordPress on Your Windows 11 PC Using XAMPP

Run WordPress locally on your Windows 11 PC, offline, using XAMPP. XAMPP is a free tool that turns your computer into a local web server. It is a good way to build or test a site without paying for hosting.

Advertisement
⚡ Quick Answer

Install XAMPP, then create a database for WordPress using the XAMPP Shell or phpMyAdmin. Download WordPress, extract its files into the C:xampphtdocs folder, and then run the WordPress installer via your browser at http://localhost/wordpress.

Advertisement

What is XAMPP?

XAMPP turns your Windows 11 PC into a local web server, so you can set up WordPress without a live website. It bundles three things WordPress needs:

  • Apache (the web server)
  • MariaDB (the database where WordPress stores your content)
  • PHP (the language WordPress is written in)

XAMPP also runs on other systems, but this guide covers Windows 11 only. Everything here runs on your own machine, so only you can see the site, and it keeps working with no internet connection once the downloads are done.

Step 1Install XAMPP

Installing XAMPP is the first step. Follow our guide to install it, using the link below. When it finishes, open the XAMPP Control Panel . It is where you start and stop Apache and MariaDB, and you will use it for the rest of this tutorial.

How to Install XAMPP on Windows 11

Keep the Control Panel handy. If WordPress ever stops loading, the first thing to check is whether Apache and MySQL (the MariaDB module) show as running in it.

Advertisement

Step 2Create a Database for WordPress

WordPress needs a database to store your posts, pages and settings. You will create it with XAMPP's own tools. The command-line method comes first, and a graphical alternative follows.

  1. Open the XAMPP Control Panel.
  2. Click Start next to Apache and next to MySQL. The module names turn green when they are running. MySQL here is the MariaDB database server.
  3. Click the Shell button (see image below). A command window opens.
XAMPP Shell Button
XAMPP Shell Button
  1. In the shell window, type this command to open the database, then press Enter:

mysql -u root

If it asks for a password, press Enter. A fresh XAMPP install has an empty password for the root account. You should now see a database prompt where you can type commands.

  1. Enter the commands below one by one, pressing Enter after each. Replace your_password_here with a password you will remember. You need it again in the WordPress setup.
⚠️Warning

CREATE DATABASE wordpressdb CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
CREATE USER 'wordpressdbuser'@'localhost' IDENTIFIED BY 'your_password_here';
GRANT ALL PRIVILEGES ON wordpressdb.* TO 'wordpressdbuser'@'localhost';
FLUSH PRIVILEGES;
exit

Advertisement

Each command should answer with a short confirmation. If one returns an error, read it before moving on. A typo or a missing semicolon at the end of a line is the usual cause.

If you prefer a graphical interface, click the Admin button next to MySQL in the XAMPP Control Panel. This opens phpMyAdmin in your browser, where you can create a new database and a user with full permissions using its visual interface (see image below). MySQL must be running for this button to work. Use the same database name, username and password you will enter in the WordPress setup.

Create Database in phpMyAdmin
Create Database in phpMyAdmin

Step 3Download and Set Up WordPress

Before installing WordPress, download the latest version and put its files in the right folder. XAMPP serves websites from its htdocs folder, so WordPress goes inside that.

  1. Open File Explorer and go to the folder C:\xampp\htdocs on your PC.
  2. Create a new folder inside it called wordpress. Right-click an empty area, choose New, then Folder, and type the name.
  3. Download WordPress from the official WordPress download page. You get a ZIP file.
  4. Extract the WordPress files into the wordpress folder you just created. The ZIP contains its own wordpress folder, so make sure the files themselves, such as wp-admin and wp-config-sample.php, end up directly inside your new folder and not one level deeper.
WordPress folder inside XAMPP
WordPress folder inside XAMPP

Next, change what XAMPP shows when you visit your local server. By default it opens the XAMPP dashboard. You will make it go straight to WordPress.

Advertisement
  1. Open the file C:\xampp\htdocs\index.php with a text editor like Notepad. This file controls what shows up when you visit your local server. If Windows asks which app to use, choose Notepad.
  2. Select everything in the file and replace it with this code, which makes your browser go directly to the WordPress site:

<?php
if (!empty($_SERVER['HTTPS']) && ('on' == $_SERVER['HTTPS'])) {
$uri = 'https://';
} else {
$uri = 'http://';
}
$uri .= $_SERVER['HTTP_HOST'];
header('Location: '.$uri.'/wordpress/');
exit;
?>

If you ever see the message "Something is wrong with the XAMPP installation :-(" when you open the local server, the default page could not find its dashboard. Replacing the file as shown here avoids that.

  1. Save the file. If Notepad asks you to save as a new file, you opened the wrong location, so check that you are editing the file inside the htdocs folder.

Step 4Restart Apache Server

Go back to the XAMPP Control Panel and restart Apache so your changes take effect.

  1. Click Stop next to Apache and wait for the green highlight to disappear.
  2. Click Start again. Apache should turn green once more.

Step 5Install WordPress

With the files in place, you finish the installation in your web browser. Open this address to launch the WordPress setup wizard:

Advertisement

http://localhost/wordpress

The WordPress setup screen should appear. If you see an error page or nothing loads, check that Apache is running in the Control Panel. Then follow these steps:

  1. Choose your language and click Continue.
  2. Click Let's go! to start.
  3. Enter the database details you created earlier:
    • Database Name: wordpressdb
    • Username: wordpressdbuser
    • Password: the password you set
    • Database Host: localhost
    • Table Prefix: leave it as wp_
  4. Click Submit. If WordPress says it cannot connect to the database, go back and check the name, username and password, and make sure MySQL is running.
  5. Click Run the installation.
  6. Fill in your site title, choose an admin username and password, and enter your email. Pick a password you will not forget, because there is no live site to reset it by email.
  7. Click Install WordPress.

If everything is correct, WordPress finishes the installation and you can log in to your new site. To work on it again later, open the XAMPP Control Panel, start Apache and MySQL, and visit the same local address.

WordPress Setup Complete
WordPress Setup Complete

Summary

  • You installed WordPress on your Windows 11 PC using XAMPP, with no internet needed once the downloads are done.
  • You created a database for WordPress to save your website data.
  • You downloaded WordPress and set it up to run on your local server.
  • You installed WordPress through the web setup wizard.

You now have a working local WordPress site on your Windows 11 PC. The process covered installing XAMPP, creating a database, downloading the WordPress files and running the web setup wizard. Remember that Apache and MySQL must be running in the XAMPP Control Panel whenever you want to use the site.

Was this guide helpful?

Was this helpful?
Richard

About the Author

Richard

Tech Writer, IT Professional

Richard is a writer at Geek Rewind who turns complex IT tasks into clear, step-by-step guides. He draws on years of hands-on experience in system administration and enterprise IT operations, focusing on Windows, Linux and WordPress: the problems people actually run into, and the fixes that work. His server and WordPress guides come from systems he runs himself. Richard builds and maintains the platform behind Geek Rewind, from its Ubuntu servers and Nginx configuration to its custom WordPress plugins. Many new tutorials start with readers' questions, and he's always glad to answer them in the comments.

Advertisement

📚 Related Tutorials

Accessing the Windows Studio Effects Settings in Windows 11
Windows Accessing the Windows Studio Effects Settings in Windows 11
How to Send Files Directly Through Email in Windows 11
Windows How to Send Files Directly Through Email in Windows 11
How to Delete Files in Windows 11
Windows How to Delete Files in Windows 11
How to Access Settings in Windows 11
Windows How to Access Settings in Windows 11

No comments yet — be the first to share your thoughts!

Leave a Comment

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