Write Review

How to install Drupal 8.4.5 on Ubuntu 18.04

Drupal is a free and open source content management system. It is getting popular and used by many people and organizations around the world due to its efficiency and scalability.

This framework is written in PHP. It helps the people or organization to create and deliver customized and digital content for web and mobiles. The content includes many types like text, media, customized forms and many more. It has powerful editing tools to maintain the content in no time.

In this guide, we will learn how to install Drupal version 8.4.5 on Ubuntu 18.04. I will provide the installation process step by step.


  • Curl
  • Tasksel
  • Ubuntu LAMP
  • Drupal PHP module php-fdomdocument

Step 1: Commands to set up the pre-requisites

To install Curl and Tasktel, use the following linux command.

$ sudo apt install -y curl tasksel

After the above, we need to install Ubuntu LAMP stack (Linux, Apache, MySQL, PHP). It will use tasksel to do so. We will also enable rewrite code. The following commands will perform these steps.

$ sudo tasksel install lamp-server
$ sudo a2enmod rewrite

Now we have to install PHP module. The following command is required.

$ sudo apt install php-fdomdocument php-gd

There is a configuration which will be required for Drupal installation. It is to enable “Clean URLs”. For this, we have to edit Apache’s default site configuration file. The following command serves the purpose.

$ sudo nano /etc/apache2/sites-enabled/000-default.conf

Next we need to add the following code below DocumentRoot/var/www/html line:

<Directory /var/www/html/>

Options Indexes FollowSymLinks

AllowOverride All


Now we need to restart the Apache server to apply the changes, the following command will serve the purpose. After this step, we will be able to download and install Drupal.

$ sudo systemctl restart apache2

Step 2: Download Drupal package

In this step, we will download the package using Curl command as follows.

$ curl --output/tmp/drupal.tar.gz 

Now download the Drupal files into Webserver’s root directory. Change the file ownership to www-data. The following are commands to serve the purpose.

$ sudo rm -fr /var/www/html
$ sudo tar xf /tmp/drupal.tar.gz -C /var/www/
$ sudo mv /var/www/drupal-8.4.5/ /var/www/html
$ sudo chown -R www-data:www-data /var/www/html

Step 3: Configure Database

The following commands will create a database “Drupal” and create credentials for it.

$ sudo mysqladmin create drupal
$ sudo mysql -e "CREATE USER 'admin'@'%' IDENTIFIED BY 'pass';"
$ sudo mysql -e "GRANT ALL PRIVILEGES ON drupal.* TO 'admin'@'%' WITH GRANT OPTION;"

Step 4: Installing Drupal

Open the browser and enter the URL http://drupal-ubuntu. An installation wizard will be opened.

How to install Drupal 8.4.5 on Ubuntu 18.04

After choosing a language, we click on save and continue. After that choose profile will be visible. There we can choose installation with standard or minimal. Choose which option suits us.

How to install Drupal 8.4.5 on Ubuntu 18.04

After that, we will verify the requirements and then give database credentials as we added in step 3.

How to install Drupal 8.4.5 on Ubuntu 18.04

How to install Drupal 8.4.5 on Ubuntu 18.04

Drupal will be installed after filling all the details. After the installation, we will configure our website with site maintenance account.

How to install Drupal 8.4.5 on Ubuntu 18.04

How to install Drupal 8.4.5 on Ubuntu 18.04


To install Drupal 8.4.5, we need to set up its prerequisites first. Then we will configure the database. The installation is simple as it will be a wizard, after filling the appropriate details in the wizard, we will be able to use this software for our digital sites.

Check out these top 3 Drupal hosting services:

Was this article helpful?