How to Install Drupal Locally to Build a Test Site?

To install and run Drupal on a local or personal machine will be quite helpful if you want to explore the basic use of Drupal without having to sign up with a web host. In this post, we’ve put together a step-by-step reference on how to install your Drupal locally for development purpose. Note that, the all-in-one XAMPP application can simplify the task of setting up a local testing environment greatly.

Preliminary Matters before You Starting Out

To install your Drupal on a local machine is somewhat similar to the manual web host installation, but you should perform the added steps of installing and configuring the MySQL, PHP and Apache to set up a local development environment. Although installing those three components can be a chore, you can create such a runtime environment automatically using a robust package called as XAMPP.

In the following, we will demonstrate how it is easy to set up a local server for your Drupal installation, taking the example of XAMPP. If you don’t want to take the pain to install and configure any packages, we recommend you to go with the top 5 Drupal web hosts that have taken the hard work of installing MySQL, Apache and PHP.

How to Install and Download the XAMPP?

As is known, it’s more or less difficult to install an Apache web server and it would be much harder for you to add PHP, MySQL and Perl. The aim of XAMPP is to set up a completely free and easy-to-install Apache distribution that contains MySQL database and PHP/Perl programming language. Note that, this application can work across many different platforms, including Linux, Windows and Mac OS X.

Download URL: https://www.apachefriends.org

What Is XAMPP

Step 1:
The first important thing that you must implement is to choose and download the correct version of XAMPP to your local computer. Assuming that you’ve downloaded this “XAMPP for Windows” package, you ought to double-click the “exe” file to start installing it. At the beginning of this setup process, it will prompt you to select the components to install. If you have no clue about those options, just keep them intact. Do press the “Next” button to continue.

Select Components to Install

Step 2:
The second step is to select a folder where your XAMPP will be installed. Here, you’d better use the default location like “c:\xampp”, or better yet change the drive to “d:\xampp”. If you are ready to continue, just press the bracketed “Next” button.

Select a Installation Folder

Step 3:
Before installing XAMPP on the local hard drive, you can also choose to install many popular applications like WordPress and Joomla on the current XAMPP installation.

Choose Other Applications

Step 4:
Once done with above settings, a “Ready to Install” window will pop up to let you begin the installation. This will take a while to accomplish, and all you need to do is to wait patiently until the “Finish” option appears. Be sure to press the “Yes” button to enter the XAMPP control panel unless you’d like to use the shortcut on the desktop.

Complete Processing Bar

Step 5:
From here, just press the “Start” buttons next to “MySQL” and “Apache” options to enable them. Till present, your local host is ready to use, and you can access any site through “http://localhost” by putting it into the “htdocs” folder of XAMPP.

Enable Apache & MySQL Modules

How to Install Your Drupal on a Local Machine Using XAMPP?

Now that Apache and MySQL modules are started, it’s time to install the newest version of Drupal from this Download Page. In the meantime, you also need to create a database within this phpMyAdmin interface. Under this “Database” tab, just create a database name and select a “Collation” before pressing this “Create” button.

Create Database Name

To proceed, you should extract the compressed file to the “htdocs” folder and then rename it to “drupal”. Now, copy and paste this local host address “http://localhost/drupal” in the web browser to go through the Drupal installation process. Generally there are a total of 7 steps to be performed, including:

  1. First of all, choose an installation profile. Here, click the radio button next to “Standard” and then click “Save and Continue” button.
  2. Choose Installation Profile

  3. By following the given instructions, you will be able to install and use a language other than the default “English”. At this place, we prefer to “Install Drupal in English”.
  4. Choose Drupal Language

  5. Next, Drupal would automatically check whether or not your host meets the listed system requirements, such as “Web Server”, “PHP”, “PHP Extensions”, “File System” and “Settings File”, etc. If nothing goes wrong, you can go straight into the next step.
  6. Drupal System Requirements

  7. The below “Database Configuration” requires more database information. Just set the “Database Type” to the default “MySQL, MariaDB or equivalent”. Keep in mind that the “Database Name” should be the filled-in database name you’ve specified in the installation stage (here is “drupal”), and the “Database Password” can be left to be empty. Do remember to press the “Save and Continue” button to go on.
  8. Set Database Configuration

  9. Now, Drupal begins the installation process, and you would be taken to the next “Configuration Site” tab as long as the processing bar reaches 100%.
  10. Start Drupal Installation

  11. As you may notice, this tab has been divided into the following minor sections:
  12. Set Site Configuration

    Site Information – that allows you to pick a name for your website and enter an email address to receive Drupal notifications. This can be the same email address used to maintain the website, which is totally up to you.
    Site Maintenance Account – that allows you to use “admin” as the “Username” and set the “Email Address” to the one that is used for site email address. Without doubt, the “Password” would be verified to avoid potential security issues.
    Server Settings & Update Notifications – that allows you to customize the “Default Country” and “Default Time Zone” to your liking. Note that, you will be informed of Drupal alters for updates if you check all boxes there. However, it is recommendable to uncheck them if you have a restricted Internet connection.

  13. The last step will take few minutes to complete, and you will be notified with a “Finished” message if there are no problems or errors during this process. Until now, you are officially done! Do remember to “Stop” the MySQL and Apache modules and “Quit” XAMPP at length.
  14. Finish Drupal Installation

    Important to Note: Being similar to XAMPP, MAMP would also set up a local server environment within a matter of seconds on a MAC OS X computer. Most importantly, installing Drupal on MAMP works very similarly with XMAPP, which requires you to create and modify a database using the inbuilt phpMyAdmin tool. Whichever CMS you decide to use, pointing your web browser to the right address will always let you go into the installation progress.

    About MAMP