How to Install Drupal on CentOS 7

r00t December 27, 2017

Install Drupal on CentOS 7

In this tutorial we’ll learn how to install Drupal on CentOS 7. We will also install and configure its prerequisites. Drupal is one of the greatest free and accessible content management methods that used to create many of the sites you find daily. Easy content authoring, superb security, and reliable performance are a few of the most important benefits of using Drupal, but the most important quality of Drupal that sets it apart from other CMS is the flexibility and modularity that’s one of the core principals of it. It’s also an excellent choice for creating integrated electronic frameworks. You can extend it to anybody, or most, of thousands of add-ons. Modules expand Drupal’s functionality.

I recommend to use a minimal CentOS server setup as a basis for the tutorial, that can be a virtual or a root server image with an CentOS 7 minimal install from a web hosting company or you use our minimal server tutorial to install a server from scratch.

Install Drupal on CentOS 7

Step 1. First, ensure your system and apt package lists are fully up-to-date by running the following:

yum -y install epel-release
yum -y update

Step 2. Installing LAMP on Ubuntu 16.04.

You should check out this LAMP stack install tutorial for Ubuntu 16.04, if you haven’t installed LAMP yet. Once it’s installed, come back here and read on. We also will install the required packages for LAMP stack and the important PHP extension that Drupal relies on:

apt-get install php7.0-mysql php7.0-curl php7.0-json php7.0-cgi php7.0 libapache2-mod-php7.0 php7.0-mcrypt php7.0-gd php7.0-mbstring php7.0-zip php7.0-dom php7.0-xml

Step 3. Installing Drupal.

First, download Drupal from the official web site. The latest stable release is 8.4.3 so you can download it with the following command:


You should unpack the tar.gz archive:

tar -zxvf drupal-8.4.3.tar.gz
mv drupal-8.4.3 drupal
mv drupal /var/www/html/

Now you can navigate to the /var/www/html/drupal/sites/default/ directory on your server, make a copy of the default.settings.php named settings.php and make that directory and file writable to all:

cd /var/www/html/drupal/sites/default/
cp default.settings.php settings.php
chmod 666 settings.php
chmod 777 /var/www/html/drupal/sites/default

Step 4. Create a database for Drupal.

Next, we need to create a database for the Drupal installation:

mysql -uroot -p

Run the following command to create a database for Drupal:

MariaDB [(none)]> CREATE USER db_user@localhost IDENTIFIED BY 'Durpal@123#';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON drupal_db.* TO db_user@localhost;
MariaDB [(none)]> exit

Step 5. Accessing Drupal Web Installation.

Now you can access the Drupal web install wizard in your browser by entering the domain name or http://server_IP/drupal/ to continue your Drupal installation.

Congratulation’s! You have successfully install and configured Drupal on your CentOS 7 server. Thanks for using this tutorial for installing Drupal content management on CentOS 7 system.

The Tags:

Leave a Comment

Comments are closed.