Drupal is an open-source content management system, widely used for developing complex and scalable websites. Installing Drupal on Localhost environment, such as XAMPP, is an excellent way to test, develop, or learn Drupal before deploying it live. This guide explains the complete installation process of Drupal on your local machine using XAMPP on Windows, providing detailed steps and practical guidance.
Prerequisites
Before beginning the installation process, make sure you have the following:
- A Windows 10 or later machine
- XAMPP is installed and configured
- Minimum 4GB RAM and at least 1GB free disk space
- PHP 7.4 or higher
- A modern web browser
- Drupal installation package (downloadable from drupal.org)
XAMPP users should start the Apache and MySQL services by using their control panel.
Step 1: Download and Install XAMPP
Go to the Apache Friends website and download the latest version of XAMPP for Windows. Run the installer and follow the prompts to install it in the C:\xampp directory (the default recommended location). Once installed, open the XAMPP Control Panel and click Start for both Apache and MySQL.
If you receive a Windows firewall prompt, allow access to Apache.
Step 2: Download Drupal
Visit the official Drupal website (https://www.drupal.org/project/drupal) and download the latest recommended release of Drupal, available in either .zip or .tar.gz format. Once downloaded, extract the .zip or .tar.gz.
Rename the folder to something simple, such as ‘drupal’, and move it into your C:\xampp\htdocs\ directory. This will be your local Drupal project directory.
Step 3: Create a Database in phpMyAdmin
Open your web browser and navigate to http://localhost/phpmyadmin.
- Click on the Databases tab.
- Enter a database name (e.g., drupal_db).
- Select utf8_general_ci as the collation.
- Click Create.
No need to create tables manually—Drupal will handle this during installation.
Step 4: Launch the Drupal Installer
In your browser, navigate to http://localhost/drupal (or the URL you assigned to your folder).
Drupal’s setup wizard will appear. Follow these steps:
- Choose a Standard installation profile.
- Select the language of your choice.
- Drupal will now check for system requirements.
If everything appears green, click ‘Continue anyway’.
Step 5: Configure Database Settings
Enter the following database credentials:
- Database name: drupal_db
- Database username: root
- Password: (leave blank)
Leave the host as localhost and keep the default table prefix unless you want to run multiple installations in a single database.
Click Save and continue.
Step 6: Final Site Setup
Drupal will now install core modules and configure your site.
Once complete, fill in the basic site information:
- Site name
- Site email address
- Admin username & password
- Default country and time zone
Click Save and continue. You’ll be redirected to your new Drupal site’s homepage.
Congratulations! Drupal is now successfully installed on your local XAMPP environment.
Troubleshooting Tips
- Blank Page After Installation:
- Ensure you have the correct PHP version (7.4 or higher).
- Enable mod_rewrite in Apache and restart the server.
- MySQL Connection Error:
- Ensure MySQL is running in XAMPP.
- Double-check the database name and user credentials to ensure accuracy.
- “Clean URLs” Not Working:
- Open the .htaccess file in the Drupal root folder and ensure that ‘RewriteEngine On’ is uncommented.
- Additionally, enable Apache mod_rewrite in httpd.conf.
- 403 or 404 Errors:
- Ensure Apache has the necessary permissions to access the htdocs/drupal directory.
- Restart Apache after any changes.
Frequently Asked Questions (FAQs)
Conclusion
Installing Drupal locally on XAMPP is a great way to explore and develop with this powerful CMS without the need for a live server. It gives you complete control in a test environment where you can build, break, and rebuild with no risk to production. Whether you’re a beginner learning Drupal or a seasoned developer building complex web apps, this local setup is a must-have for your workflow. Also Checkout our guide on ‘How to INSTALL PrestaShop on localhost‘
By following the steps above, you now have a fully functional Drupal installation on your Windows machine. Happy building!
About the writer
Hassan Tahir wrote this article, drawing on his experience to clarify WordPress concepts and enhance developer understanding. Through his work, he aims to help both beginners and professionals refine their skills and tackle WordPress projects with greater confidence.