Installing Drupal on Centos 7

April 2, 2025

Table of Contents

Drupal is an open-source Content Management System(CMS), written in PHP, used by many organizations to build and maintain their data and websites.

In this article, we will learn how to install Drupal on Centos 7 V.M created on E2E Cloud Service.

Pre-requisites:

  1. Centos 7 server with static IP

  2. Apache 2.4

  3. PHP 5.5 or higher

  4. Mysql or MariaDB

Steps:

Install httpd service using below command


# yum install httpd


Then start and enable the httpd service.


# service httpd restart
# systemctl enable httpd

Install PHP and it modules using below command


# yum install php php-mbstring php-gd php-xml php-pear php-fpm php-mysql php-pdo php-opcache


If you want to install PHP 7.0 then need to install its repository first.


# rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
# rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
# yum install php70w php70w-opcache php70w-mbstring php70w-gd php70w-xml php70w-pear php70w-fpm php70w-mysql php70w-pdo -y


Now install mariadb server for the database and start the service.


# yum install mariadb mariadb-server -y
# service mariadb restart
#systemctl enable mariadb


To secure the mariadb server and set mariadb root password, run below command


# mysql_secure_installation


Now to install Drupal on centos 7 run below commands


# yum install wget gzip
# wget -c https://ftp.drupal.org/files/projects/drupal-8.2.6.tar.gz

Unzip the installed drupal package and move the setup to the document root.


 # tar -zxvf drupal-8.2.6.tar.gz
 # mv drupal-8.2.6 /var/www/html/drupal
 


Then create the settings file and give the appropriate permission.


# cd /var/www/html/drupal/sites/default/
# cp default.settings.php settings.php
# chown -R apache:apache /var/www/html/drupal/


  1. Login to mysql and create database and user and grant required privileges to the user for the database.
  2. Now open URL http://serverIP/drupal

    Scroll down and click on “Continue Anyway”.
  3. Then fill the details as per your requirement.
  4. Once the setup is done. Open the website in the browser.

Conclusion: Drupal is successfully installed on CentOS 7.

Introduction to Drupal :
 

Latest Blogs

A vector illustration of a tech city using latest cloud technologies & infrastructure