This article explains how to install Drupal locally with XAMPP on Windows 11.
XAMPP is a free and open-source cross-platform web server solution stack package developed by Apache Friends. It consists primarily of the Apache HTTP Server, MariaDB, and interpreters for scripts written in the PHP and Perl programming languages.
You can install XAMPP on Windows or Ubuntu to run PHP apps locally on your computer.
Drupal is an open-source content management system (CMS) that allows users to build and manage websites. The following steps guide installing Drupal with XAMPP on a Windows machine.
Install XAMPP
XAMPP is a single package with Apache, MariaDB, and PHP components. After installing XAMPP app on Windows or Ubuntu, you can install and manage other PHP-based apps like WordPress, Drupal, and Joomla.
If you haven’t already installed XAMPP on your machine, read the post below to learn how to install it.
Create a Drupal database
As part of the XAMPP installation, a MariaDB database server was installed along with Apache and PHP.
Now, create a blank database to store Drupal content.
First, click the ‘Shell‘ button on the Control Panel on the left to launch the XAMPP command shell.

For this setup, we will create a database named ‘drupaldb ‘. Additionally, we will create a corresponding user account called ‘drupaldbuser ‘.
Finally, we’ll grant the drupaldbuser full access to the drupaldb database.
All the database steps above can be done using the commands below:
But first, log on to the MariaDB database server:
mysql -u root
Then run the commands below to complete the steps:
CREATE DATABASE drupaldb CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
CREATE USER drupaldbuser@localhost IDENTIFIED BY 'type_your_password_here';
GRANT ALL ON drupaldb.* TO drupaldbuser@localhost;
FLUSH PRIVILEGES;
exit
Ensure to replace ‘type_your_password_here‘ with your password.
If you cannot use the command line, click the phpMyAdmin [Admin button] next to MySQL in the Control Panel.
Create a new database. Create a new user. Then, give (grant) the user full access to the database.

Continue below to download Drupal files.
Download Drupal files
Let’s begin straightforwardly downloading and configuring the Drupal files on Ubuntu Linux.
First, navigate to the C\:xampp\htdocs directory and create a folder for Drupal called [drupal].

Download the Drupal files from the official download page and extract them into the drupal folder created earlier.
Extract the downloaded files and copy all the contents into the Drupal folder created earlier [C:\xampp\htdocs\drupal].
After copying the Drupal content to the folder, navigate to the root directory [C:\xampp\htdocs] and edit the index.html file.
By default, all requests to the server hostname are redirected to the [/Dashboard/]. This file is responsible for that.
You can change it to [/drupal/] to bring up your Drupal site instead of the dashboard.
<?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 and exit.
Return to the XAMPP Control Panel and stop and start Apache to apply the changes.
After restarting the Apache web server, open your browser and navigate to the server hostname or IP address specified in the Apache server block.
http://drupal.example.com
A new Drupal installation wizard will appear. Choose a language and continue to the next page.

Next, select the installation profile.

Then, type in the database name, username, and password created above.

Finally, set up your site name and create an admin account to log in.

Your new Drupal site should be created and ready to use.

That should do it!
Conclusion:
Installing Drupal locally with XAMPP on Windows 11 is a straightforward process. Following these steps will help you set up a local environment efficiently:
- Download and install XAMPP: Ensure you have XAMPP installed on your Windows machine.
- Create a database: Use the command line or phpMyAdmin to create a database and user for Drupal.
- Download Drupal: Obtain the latest version of Drupal and place it in the appropriate XAMPP directory.
- Configure the server: Modify the index file to redirect to your new Drupal installation.
- Access the installation wizard: Open your browser to complete the Drupal setup process through the installation wizard.
- Set up site details: Provide necessary information and create an admin account.
By completing these steps, you’ll have a fully functional local Drupal site ready for development and testing.
Leave a Reply