How to Install Drupal Locally with XAMPP on Windows 11
Installing Drupal locally on Windows 11 with XAMPP lets you build and test websites right on your computer, without needing to go online.
Drupal is a popular tool, like a website builder, that helps you create all sorts of websites. XAMPP is a free package that includes everything you need to make your PC act like a web server. This means you can run Drupal and see your website work locally.
Using XAMPP to set up Drupal is perfect for trying out new features or making custom designs before putting your site on the internet.
Install XAMPP, create a Drupal database via its shell or phpMyAdmin, and download Drupal files into a htdocs/drupal folder. Restart Apache, then access http://localhost in your browser to complete the Drupal setup.
What is XAMPP?
XAMPP is a free package that lets you run websites, like Drupal, on your Windows 11 computer without needing the internet. It bundles together Apache for showing web pages, MariaDB for storing data, and PHP, which Drupal needs to function. This makes it easy to test your Drupal site locally.
- Apache (the web server that displays your website)
- MariaDB (a database that stores your website’s information)
- PHP (the programming language that Drupal uses)
With XAMPP, you can run Drupal and other websites without needing an internet connection.
Step 1Install XAMPP
Don’t have XAMPP yet? Follow this guide first:
Step 2Create a Database for Drupal
Drupal needs a database to keep all your website’s information, and you can easily set one up using XAMPP’s tools right on your Windows computer. You’ll open the XAMPP Control Panel, click the Shell button, and use simple commands to create a new database specifically for your Drupal site.
What you’ll do:
- Open the XAMPP Control Panel.
- Click the Shell button on the left side. A command window will open.
- Type this command and press Enter to open the database tool:
mysql -u root - Type these commands one at a time. Press Enter after each one. Replace
your_password_herewith a password you choose. Remember this password!CREATE DATABASE drupaldb CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;⚠️WarningCREATE USER 'drupaldbuser'@'localhost' IDENTIFIED BY 'your_password_here';GRANT ALL ON drupaldb.* TO 'drupaldbuser'@'localhost';FLUSH PRIVILEGES;exit

Step 3Download and Prepare Drupal
Getting Drupal ready for your local site involves downloading its files and placing them in a specific folder so XAMPP can access them. You’ll create a new folder named ‘drupal’ inside your 📁C:\xampp\htdocs folder and then extract all the downloaded Drupal files into this new directory.
- Open your
C:\xampp\htdocsfolder on your computer. - Create a new folder called
drupalinside thehtdocsfolder. This is where your Drupal files will go. - Download the latest Drupal version from here: Drupal Downloads
- Extract the Drupal files you downloaded directly into the
drupalfolder.

Step 4Change Apache’s Default Page to Your Drupal Site
You can make your Drupal site show up automatically when you visit your local server by changing XAMPP’s default page. This means opening the ‘index.html’ file found in your 📁C:\xampp\htdocs folder using a simple text editor like Notepad and replacing its current content with code that sends visitors straight to your Drupal site.
What you’ll do:
- Go to
C:\xampp\htdocsand open theindex.htmlfile with a text editor like Notepad. - Replace everything in the file with this code:
<?php
if (!empty($_SERVER['HTTPS']) && ('on' == $_SERVER['HTTPS'])) {
$uri = 'https://';
} else {
$uri = 'http://';
}
$uri .= $_SERVER['HTTP_HOST'];
header('Location: '.$uri.'/drupal/');
exit;
?>
Something is wrong with the XAMPP installation :-( - Save the file.
Step 5Restart Apache
What happens when you do this? Apache will apply the changes you just made.
What you’ll do:
- Go back to the XAMPP Control Panel.
- Stop Apache by clicking the Stop button.
- Start Apache again by clicking the Start button.
Step 6Start Drupal Installation
Once everything is set up, you can start the Drupal installation directly on your Windows 11 computer by simply opening http://localhost in your web browser. You’ll then be guided through picking your language and choosing an installation type to begin building your new Drupal website.
- Open your web browser and go to:
http://localhost - You should see the Drupal setup page.
- Choose your language and click Save and continue.
- Select the installation type (usually “Standard” works fine) and continue.
- Enter the database information you created earlier:
- Database name:
drupaldb - Username:
drupaldbuser - Password: (the password you chose in Step 2)
- Database host: leave this as
localhost
- Database name:
- Continue and fill in your website’s name.
- Create an admin username and password for yourself.
- Finish the setup. You now have your own Drupal site running locally!





Summary
- Install XAMPP on your Windows 11 computer.
- Create a database and user for Drupal using XAMPP’s Shell or phpMyAdmin.
- Download Drupal and put the files in a
drupalfolder insidehtdocs. - Change the default page to redirect to Drupal.
- Restart Apache to apply the changes.
- Open your browser at
http://localhostto complete Drupal setup.
To install Drupal locally with XAMPP on Windows 11, first install XAMPP. Then, create a database and user for Drupal using XAMPP’s tools. Download Drupal and place its files into a ‘drupal’ folder within the 📁C:\xampp\htdocs directory. Next, change XAMPP’s default page to redirect to your Drupal site and restart Apache. Finally, open your browser to http://localhost to finish the Drupal setup.
Does Drupal run on Windows?
It is recommended to use Linux or a similar operating system for hosting Drupal websites. Windows is only supported for development environments. Running Drupal directly on Windows in a production environment is not supported.
Is XAMPP available for Windows?
XAMPP is a very easy to install Apache Distribution for Linux, Solaris, Windows, and Mac OS X.
Was this guide helpful?
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.
… liked this!