- 5 steps
- Needs administrator rights
Local WordPress development on Windows 11 with XAMPP lets you build and test websites offline, without a live server. XAMPP is a free bundle of the Apache web server, the MariaDB database and PHP. You install it once and it runs on your PC like any other program.
XAMPP version 8.2.4 or a later release gives you everything needed to run a complete website from your own machine. Treat it as a practice area: you can break things, fix them and try ideas before anything goes online. You need a Windows 11 PC, an administrator account and a browser. Both Home and Pro editions work the same way here.
Install XAMPP (version 8.2.4 or later) on Windows 11, start Apache and MySQL in the XAMPP Control Panel, then create a database at http://localhost/phpmyadmin/. Next, download WordPress and place its files in the htdocs folder, such as 📁C:\
Why use a local environment?
Running WordPress locally lets you test themes, try plugins or build a whole site away from public view. Nothing you do is visible to visitors, and a mistake can’t take down a real site. When you finish, you’ll have a fully working website that you can later move to a live server.
Step 1Install XAMPP
XAMPP includes the Apache web server and the database software, so it covers everything WordPress needs. If you have not installed XAMPP yet, our guides below explain how to do it. Install it first, then come back here.
Once XAMPP is installed, open the XAMPP Control Panel and click Start next to both Apache and MySQL. Their names should turn green and show a port number. If a module won’t start, another program is probably using the same port, and the Control Panel log at the bottom will tell you which one. WordPress can’t work until both modules are running.
Step 2Create a WordPress Database
WordPress keeps your posts, pages and settings in a database, so you create that database before you run the installer. phpMyAdmin is the tool bundled with XAMPP for this job. Follow these steps:
- Make sure Apache and MySQL are both running in the XAMPP Control Panel.
- Open http://localhost/phpmyadmin/ in your web browser. You should see the phpMyAdmin home page with a list of existing databases on the left.
- Click the Databases tab.
- Type a name for your site’s database in the field under Create database. This guide uses wordpressdb, so use the same name if you want the later steps to match.
- Click Create. The new database appears in the list on the left.
That is enough for a local test site. The next section shows a second way to do the same thing from the command line, and it also creates a dedicated database user. You only need one of the two methods.

Open the terminal as an administrator. If you get a permissions error, close the window and reopen it with admin rights. MySQL must be running in the XAMPP Control Panel, or the login will fail.
Open your terminal and run this command to log in to your database server. If it asks for a password and you have not set one, press Enter. A default XAMPP install leaves the database root account without a password. After a successful login you should see a database prompt instead of the normal Windows prompt.
mysql -u root
Now run the commands below, one after another, at the database prompt. Together they create your database and a separate user account that WordPress will use. Using a dedicated user is safer than letting WordPress log in as root, and it is how a live host will work too.
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. You will type it again in the WordPress setup screen, so write it down somewhere. If you prefer a visual interface, click the Admin button next to MySQL in the XAMPP Control Panel to open phpMyAdmin and work there instead.

Step 3Download and Set Up WordPress
WordPress is a set of files that Apache serves from XAMPP’s web folder. So this part means downloading the official package, extracting it and placing the folder in 📁C:\
Start by opening 📁C:\

Download the latest version of WordPress from official download page. You get a zip file. Right-click it, choose Extract All, and open the extracted wordpress folder. Select everything inside that folder and move it into your new wordpress folder in 📁C:\
To have your browser open your site automatically when you visit http://localhost, find the index.html file in 📁C:\
<?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. Then go to the XAMPP Control Panel, click Stop next to Apache, wait for it to stop, and click Start again. Apache should show green again.
Step 4Complete the WordPress Installation
The last part runs in your browser. You open the WordPress setup wizard, enter the database details you created earlier, and WordPress connects to the database and builds your site. Before you start, check that Apache and MySQL are still running in the XAMPP Control Panel.
Open your browser and go to http://localhost/wordpress. The setup wizard should load with a language list or a welcome screen. If you see a “not found” error instead, check that the WordPress files are directly inside 📁C:\

Click Let’s go to start. If the wizard asks you to pick a language first, choose one and continue. The next screen asks for your database details.

Enter the database name (wordpressdb), the username (wordpressdbuser), and the password you created earlier. Leave Database Host set to localhost and leave Table Prefix at its default unless you have a reason to change it. Click Submit. If WordPress reports that it can’t connect, the usual causes are a typo in the password or MySQL not running. Fix that and try again.

Click Run the installation. WordPress now confirms it can talk to the database, and the next screen asks about your site.

Fill in your site title, then create your admin username and password and enter an email address. Even on a local site, use a password you won’t forget, because you will log in with it every time. Click Install WordPress.

You are all set! WordPress shows a success message. You can click Log In and sign in with the admin details you just created. After that, you can reach the dashboard at http://localhost/wordpress/wp-admin and the site itself at http://localhost/wordpress.

Summary
By installing XAMPP and setting up a local database, you’ve created a private environment to build your website. You can develop and experiment safely on your own machine. The site only works while Apache and MySQL are running, so start them in the XAMPP Control Panel whenever you want to work on it. When you are finished, you can migrate your local site to a live web host.
[C:xampphtdocswordpress]Have a question about this guide?
Answered by AI from this guide. Good questions may be added to this page — please don't include personal details.
Did this guide fix your problem?
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.
No comments yet — be the first to share your thoughts!