Skip to content
Follow
CMS Windows

Set Up WordPress Locally Using XAMPP on Windows 11

Richard
Written by
Richard
Mar 3, 2025 Updated Sep 15, 2026 3 min read
Set Up WordPress Locally Using XAMPP on Windows 11
Set Up WordPress Locally Using XAMPP on Windows 11

Local WordPress development on Windows 11 using XAMPP (a free tool bundle that includes the Apache web server, MariaDB database, and PHP) lets you build and test websites offline without a live server.

Advertisement

XAMPP version 8.2.4 or a later release provides the exact environment needed to run a complete website right from your PC, acting as a practice area before you publish content online.

⚡ Quick Answer

Install XAMPP, create a database using the XAMPP shell or phpMyAdmin, and then download WordPress files into the 📁C:\xampp\htdocs folder. Finally, run the WordPress installation from your web browser.

Advertisement

Why use a local environment?

Running WordPress locally lets you test themes, try plugins, or build a site from scratch away from public view. Once you’re done, you’ll have a fully functional website ready to be moved to a live server.

Step 1Install XAMPP

XAMPP includes Apache web server software and a database, providing everything you need to run WordPress. If you have not yet installed XAMPP, our guides offer instructions for installing XAMPP.

Install XAMPP on Windows 11

Install XAMPP on Ubuntu 24.04

Advertisement

Step 2Create a WordPress Database

Creating a WordPress local installation database happens inside phpMyAdmin, a tool bundled with XAMPP. You make a new database by opening http://localhost/phpmyadmin/ in your web browser, clicking the Datasets tab, typing a name for your site storage, and clicking Create. This gives WordPress a place to store your posts, pages, and settings before you run the installer.

XAMPP shell button
XAMPP shell button
📝NoteThis step requires administrator privileges.

Open your terminal and run this command to log in to your database server:

mysql -u root

Now, run these commands to create your database and a secure user account:

Advertisement
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

Remember to replace type_your_password_here with a password you'll recall. If you prefer a visual interface, click the 'Admin' button next to MySQL in the Control Panel to use phpMyAdmin instead.

Create databse phpMyAdmin
Create databse phpMyAdmin

Step 3Download and Set Up WordPress

Setting up your WordPress local installation files requires downloading the official software package and moving it into your XAMPP directory. You grab the latest zip file from the official WordPress site, extract the contents, and paste the resulting folder into C:\xampp\htdocs. XAMPP reads these files to run your website locally on your computer.

XAMPP WordPress folder
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 have your browser open your site automatically, find the index.html file in C:\xampp\htdocs and replace its contents with this code:

Advertisement
<?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 4Complete the WordPress Installation

Completing your WordPress local installation involves opening your browser and entering your database details on the setup screen. You go to http://localhost/wordpress to launch the setup wizard, type in the database name, username, and password you made earlier, and let WordPress connect to XAMPP to finish building your site.

Wordpress select installation language
Wordpress select installation language

Click "Let's go" to start.

WordPress begin installation
WordPress begin installation
⚠️WarningEnter the database name (wordpressdb), the username (wordpressdbuser), and the password you created earlier.
Advertisement
WordPress set up database connection
WordPress set up database connection

Click "Run the installation".

WordPress set up begin installation
WordPress set up begin installation

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

WordPress install wordpress
WordPress install wordpress

You are all set!

WordPress set up complete
WordPress set up complete

Summary

By installing XAMPP and setting up a local database, you've 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 migrate your local site to a live web host.

[C:xampphtdocswordpress]









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

How to Install Drupal Locally with XAMPP on Windows 11
Windows How to Install Drupal Locally with XAMPP on Windows 11
Windows 11 Control Panel Shortcuts Guide
Windows Windows 11 Control Panel Shortcuts Guide
Installing Joomla Locally with XAMPP on Windows 11
CMS Installing Joomla Locally with XAMPP on Windows 11
How to Open Windows Terminal as Admin Automatically
Windows How to Open Windows Terminal as Admin Automatically

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

Leave a Comment

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