Home » Blog Posts » Technology Articles » How To » How to install Drupal on CentOS 7

Drupal, one of the most popular content management systems (CMS), allows users to create dynamic websites and powerful online applications. If you’re planning to install Drupal on a CentOS 7 server, this guide will walk you through the step-by-step process. By following these instructions, you’ll have Drupal up and running in no time.

A Comprehensive Guide How to Install Drupal on CentOS 7

Before diving into the installation process, ensure that you have the following prerequisites in place:

  1. A CentOS 7 server with root access or a user with sudo privileges.
  2. A web server (Apache or Nginx) is installed and running.
  3. PHP 7.2 or later installed on your server.
  4. MariaDB or MySQL database server installed.

Now, let’s get started with the installation process.

Step 1: Update System Packages
First, it’s essential to update your system packages to the latest versions:

sudo yum update

Step 2: Install the Required Packages
Next, install the necessary packages to set up Drupal:

sudo yum install -y wget unzip

Step 3: Download Drupal
In this step, download the latest version of Drupal. Visit the Drupal website to find the latest stable release:

cd /var/www/html
sudo wget https://www.drupal.org/download-latest/tar.gz -O drupal.tar.gz

Step 4: Extract Drupal
After downloading Drupal, extract its contents using the following command:

sudo tar -xvzf drupal.tar.gz

Step 5: Create a Database for Drupal
Now, it’s time to create a MySQL or MariaDB database and user for Drupal. Use the following commands as a guide, but replace your_database_name, your_username, and your_password with appropriate values:

mysql -u root -p
CREATE DATABASE your_database_name;
CREATE USER 'your_username'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON your_database_name.* TO 'your_username'@'localhost';

Step 6: Configure Drupal
Navigate to the Drupal installation directory:

cd /var/www/html/drupal-X.X.X  # Replace X.X.X with the Drupal version you downloaded

Copy the default configuration file:

cp sites/default/default.settings.php sites/default/settings.php

Make the sites/default directory writable:

sudo chmod 777 sites/default

Step 7: Complete the Installation via Web Browser
Open your preferred web browser and access your server’s IP address or domain name. You’ll be redirected to the Drupal installation page.

Select your preferred installation profile and click on the “Save and Continue” button. On the following page, enter your database details: database name, username, and password. Leave the Database host field as “localhost” unless you’re using a remote database server.

After filling in the required information, click on the “Save and Continue” button. Drupal will then complete the installation process.

Step 8: Finalize the Installation
Once the installation is complete, you’ll be redirected to the Drupal administration dashboard. Set up the site name, admin account, and other necessary configurations.

Remember to remove the write permissions for the sites/default directory:

sudo chmod 755 sites/default

Congratulations! You have successfully installed Drupal on CentOS 7. You can now begin building your website or web application using the powerful features and flexibility offered by Drupal.


Installing Drupal on CentOS 7 is a straightforward process if you follow the steps outlined in this guide.

By setting up the necessary prerequisites, downloading Drupal, configuring the database, and completing the web-based installation, you can have Drupal up and running on your CentOS 7 server in no time. Enjoy building your dynamic websites and online applications with Drupal!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Become a Guest Author, Submit Your Tech Post