Drupal 7.31 Released – Installing and Configuring on Debian/Ubuntu

Drupal is an open-source content management system (CMS), written in PHP and released under GPL. It was first released in January 2001 to power personal blogs, corporations websites and any kind of websites that people may need. Today, Drupal is one of the most famous CMS in the world running millions of websites worldwide.

Install Drupal in Ubuntu
Install Drupal in Ubuntu and Debian


  1. Free and open-sourced.
  2. Basic features like the ability to publish posts, pages, and a comment system, RSS feed, users registration. install and modify templates & add-ons.
  3. More than 30000 available modules to download for free from the Drupal store.
  4. Available in more than 110 languages with support for RTL languages like Arabic.
  5. Multi-site support and Multi-user content editing and creation support.
  6. Support for creating blogs, forums, polls using modules that are installed by default.
  7. Customized Drupal releases called “Distributions”, like Linux distributions, Drupal distributions are a pre-configured Drupal installations for specific kind of websites, they have some pre-installed modules and templates as well.
  8. Very-well updates system to notify you about security updates.
  9. Many other features.

This article will guide you to install the latest version of Drupal 7.31 on Debian/Ubuntu Server.

Step 1: Install Apache, PHP and MySQL

1. To install Drupal, you will require a running web-server and a database server, in this article we will work with Apache2, PHP5 and MySQL, you can install them easily with the help of package manager tool called apt.

$ sudo apt-get install apache2 php5 php5-mysql mysql-client mysql-server
Install Apache PHP and MySQL in Ubuntu
Install Apache PHP and MySQL

2. During package installation, it will ask you about the password for the MySQL root user. Enter the new password for MySQL root user.

Set MySQL Password in Ubuntu
Set MySQL Password

Retype the password again.

Repeat MySQL Password
Repeat MySQL Password

That’s it, you’ve successfully installed all the required packages and also added MySQL password. Now it’s time to move forward and create database for drupal installation.

Step 2: Create Drupal Database

3. We’ll need to create a database for our Drupal installation, to do so, run the following command to connect to the mysql shell.

$ mysql -u root -p

Note: It will ask you to enter the MySQL root password, that you’ve entered while installing MySQL package, enter it and you will be prompted to the mysql terminal.

Connect to MySQL
Connect to MySQL

4. Next, run the following series of commands on the MySQL terminal to create new ‘drupal‘ user, database and grant privileges.

## Creating New User for Drupal Database ##
CREATE USER drupal@localhost IDENTIFIED BY "your_password_here";

## Create New Database ##
create database drupal;

## Grant Privileges to Database ##
GRANT ALL ON drupal.* TO drupal@localhost;

## FLUSH privileges ##

## Exit ##

Note: If you want, you can replace user name and database name with any other name.

Step 3: Download and Install Drupal 7.31

5. Drupal is available to download from the official Ubuntu/Debian repository as a package, however it is an old version from Drupal which has many security vulnerabilities (at the time of writing this article, it is 7.26, and the current Drupal version is 7.31), that’s why we will be downloading Drupal from the official website.

At the time of writing this article, the latest version from Drupal is 7.31 which we’ll be working with here, but you may check for the latest version from the link provided below.

  1. https://www.drupal.org/project/drupal

6. Alternatively, you may use the following ‘wget‘ command to grab the latest version directly.

$ wget http://ftp.drupal.org/files/projects/drupal-7.31.tar.gz

7. Replace 7.31 with the latest version number, if it was different, now let’s extract the file and take it away to /var/www/html/ (which is the default root folder for apache2 after installation) inside the Drupal folder.

$ tar -xf drupal-7.31.tar.gz
$ sudo mkdir -p /var/www/html/drupal
$ sudo cp -R drupal-7.31/* /var/www/html/drupal

8. Now all, what you have to do is to, open your browser and go the any of following links to begin installation.



Select Drupal Installation Profile
Select Drupal Installation Profile
Select Drupal Installation Language
Select Drupal Installation Language

9. Now in the requirements page you will see many error messages like missing packages, missing configuration and permission issues.

Verify Drupal Requirements
Verify Drupal Requirements

10. To fix these above errors, run the following commands.

$ sudo apt-get install php5-gd
$ sudo service apache2 restart
$ sudo mkdir -p /var/www/html/drupal/sites/default/files
$ sudo chmod 777 /var/www/html/drupal/sites/default/files
$ sudo cp -R /var/www/html/drupal/sites/default/default.settings.php /var/www/html/drupal/sites/default/settings.php
$ sudo chmod 777 /var/www/html/drupal/sites/default/settings.php

Once you done with the above commands, refresh the page in the browser.. and you will be able to continue to the next step.

11. In the Database configuration, enter the database name “drupal”, the username “drupal” and the password you’ve set in the step #4 above, and continue.

Setup Drupal Database
Setup Drupal Database
Drupal Installation Process
Drupal Installation Process

12. In the Configure site section, you will be asked to configure your website information, like site name, email address, username and password, fill those boxes as you want.

Configure Drupal Site
Configure Drupal Site

13. After installation finishes, don’t forget to change the permissions of configuration files to avoid security risks if any.

$ sudo chmod -R 755 /var/www/html/drupal/sites/default/
$ sudo chmod 755 /var/www/html/drupal/sites/default/files

That’s it your installation is ready to use.

Drupal Installation Complete
Drupal Installation Complete

Now go to any of following links and your website will be there.



Drupal Front Site View
Drupal Front Site View

Step 4: Configure Drupal

Drupal is a very configurable CMS, you may check those settings pages that you see at the top bar to change the settings you need.

If you want to install templates, head to following link and download the template you want, extract it to /var/www/html/drupal/themes/, where all themes are stored, and go to the “Appearance” tab to change the default theme.

  1. https://www.drupal.org/project/project_theme

If you want to install modules, head to following link and download the modules you need, extract them to /var/www/html/drupal/modules/, where all modules are stored, and head to the “Modules” tab in order to install the new modules and configure them.

  1. https://www.drupal.org/project/project_module

For further documentation, you may visit the official docs that are provided by the Drupal project at.

  1. Drupal Homepage
  2. Drupal Documentation

Have you ever installed Drupal before? What do you think about it comparing it to other CMS’s like WordPress and Joomla? Please give your feedbacks at our comment section below.

If you liked this article, then do subscribe to email alerts for Linux tutorials. If you have any questions or doubts? do ask for help in the comments section.

If You Appreciate What We Do Here On TecMint, You Should Consider:

TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Support Us

We are thankful for your never ending support.

9 thoughts on “Drupal 7.31 Released – Installing and Configuring on Debian/Ubuntu”

  1. Great Content, thank you. Just correct the the number 13. where we change the permissions once again, you wrote 777 instead of 755
    Best regards!

    • @David,

      Thanks for finding this content useful and also thanks for notifying about that permission issue at number #13, corrected in the writeup…

  2. Installing Drupal on Debian is much easier than this if you are using Cloudways platform. You just have to login to their platform, select Drupal app, select hosting provider and server package and click launch. Within minutes, your Drupal app will be live on Debian server without using composer or anything.

    If you want you can manually configure your app as well. Here is more info about this: https://www.cloudways.com/en/drupal-cloud-hosting.php

  3. I’d like to correct you on a very common misconception: the drupal version in debian is *not* vulnerable to any known security vulnerability. Per debian policy, once a version of a program is released to a stable version of the distro, newer versions are not incorporated; instead, the debian mantainers backport the security fix to the version in the distribution.

    You may notice that drupal’s version in debian wheezy (which is suported until 2018) is 7.14 and in debian Jessie (supported until 2020) is 7.32. This is *not* due to the fact that the maintainer “forgot” to update the version in wheezy, quite the contrary. Check out the changelog for the 7.14 version of drupal in wheezy here: http://metadata.ftp-master.debian.org/changelogs//main/d/drupal7/drupal7_7.14-2+deb7u10_changelog . You will notice a lot of “backported from 7.38” items (7.38 is the latest drupal release as I write this).

  4. Great work!
    I’ve followed your instructions and when I type the 4 line of step 10 it says that it’s not OK. As a result, when I install Drupal and type the DB (step 11) it gives me a white screen and I can’t go on


Got something to say? Join the discussion.

Have a question or suggestion? Please leave a comment to start the discussion. Please keep in mind that all comments are moderated and your email address will NOT be published.

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