Drupal installation on Linux



Drupal is a free and open-source content management framework written in PHP and distributed under the GNU General Public License. Nowadays It is widely used for Building Blogs and Personal websites.

In this article, We will be known about the installation drupal on Linux.


  • Apache web server
  • PHP
  • MariaDB

We can install apache web server, MariaDB, PHP as follows

 [root@localhost ~]#yum -y install httpd
[root@localhost ~]# rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
[root@localhost ~]# rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
 [root@localhost ~]# yum -y install php56w php56w-opcache php56w-mbstring php56w-gd php56w-xml php56w-pear php56w-fpm php56w-mysql
 [root@localhost ~]# yum -y install mariadb-server mariadb

Start the services httpd, MariaDB by using sysctl command as follows

systemctl start httpd mariadb

Now Configure the MariaDb for Drupal Installation as follows

Run the following command to set the password to root user for MariaDB.


Then create the database and user to access database for drupal.

Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> CREATE USER drupal_user@localhost IDENTIFIED BY 'password';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON drupal.* TO drupal_user@localhost;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> exit
[root@localhost ~]#

Now download the latest version of drupal from their official site by using wget command as follows

 wget https://ftp.drupal.org/files/projects/drupal-8.2.1.tar.gz

Sample Output:


Now Extract Drupal archive as follows

 [root@localhost ~]# tar -zxvf drupal-8.2.1.tar.gz

Now copy or move it to the directory /var/www/html

[root@localhost ~]# cp -rf drupal-8.2.1/ /var/www/html/

Now change the directory name to drupal as follows

[root@localhost html]# mv drupal-8.2.1/ drupal

Now run the following command to change the ownership of drupal directory

[root@localhost html]# chown -R apache:apache /var/www/html/drupal

Now change to the drupal directory and create new file settings.php by using the following command as follows

[root@localhost drupal]# cp sites/default/default.settings.php sites/default/settings.php

Now change the permissions of the files by using chmod command as follows

[root@localhost drupal]# chmod a+w sites/default/settings.php
[root@localhost drupal]# chmod a+w sites/default/

Now Open the http://localhost/drupal in web browser we will find the installation page for drupal as follows

If you got any 404 forbidden error run the command

restorecon -r /var/www/html

Now select the language and profile to install.


Then fill the fields in the database connection as follows


Then install site modules


Now configure the site like site name, mail-id, password etc.


Once the installation successfully completed we will get the window as follows


Now enjoy the Drupal On your machine, add the content Now.



Previous articleHow To Install WordPress On CentOS 7
Next articleGit installation on Linux
This is Naga Ramesh Reddy from Vijayawada (India).I have 4+ years of experience in System and Network Administration field. I like to read and write about Linux, Cisco, Microsoft technologies and the latest software releases. Particularly I am very interested about Linux flavors like Centos, RHEL, Ubuntu and Linux Mint.