Share this post
FaceBook  Twitter  

This article is a step-by-step on how to install Drupal 7 ( CMS ) on Ubuntu Linux using Apache web server and MySQL database, the installation guide therefore assumes that Apache web server and MySQL database are already installed on your Linux system.

These instructions can be also used by users using Debian or any other Debian based Linux systems.

All commands below are executed with root privileges. If you are sudo user, prefix all commands below with sudo. If you still have some questions after reading this article please try our new LinuxCareer Forum.

1. Prerequisites installation

# apt-get install php5-mysql apache2 \
 mysql-server php5-gd libapache2-mod-php5

2. Download and decompress Drupal install files

Download and extract all drupal files into /var/www/drupal directory:

# cd /var/www

Download and decompress Drupal 7 install files:

# wget
# tar xvf drupal-7.0.tar.gz
# mv drupal-7.0/ drupal

Change an ownership of all Drupal 7 installation files to www-data user. ( apache webserver ):

# chown -R www-data.www-data /var/www/drupal/


3. Configuring apache for Drupal

Create an apache config file for a drupal website:

# cd /etc/apache2/sites-available
# sed 's/www/www\/drupal/g' default > drupal

Enable a new drupal site config, disable default site and restart apache webserver:

# a2ensite drupal
# a2dissite default
# /etc/init.d/apache2 restart


4. Create MySQL database for Drupal installation

In this step we will create a MySQL database to be used by our new Drupal 7 installation. By now you should have a MySQL server already installed on your system, as well as you should have an administrative password to access MySQL command line interface. Let's create and use following credentials:

  • Database: drupal7
  • User: drupal7
  • Password: drupal7-pass
# mysql -p
Enter password: 
mysql> create database drupal7;
Query OK, 1 row affected (0.00 sec)

mysql> CREATE USER 'drupal7'@'localhost' IDENTIFIED BY 'drupal7-pass';
Query OK, 0 rows affected (0.00 sec)

mysql> grant all privileges on drupal7.* to drupal7@localhost;
Query OK, 0 rows affected (0.00 sec)

mysql> quit

5. Drupal 7 install

Everything should be now ready for the actual Drupal 7 installation. From now on, the installation using Drupal 7 installer is rather self explanatory. Navigate your browser to Apache's hostname or IP address and follow Drupal 7 installer to complete your own Drupal 7 installation.


Who are we? is not affiliated with any local or international company, nor is it a recruitment or employment agency. We specialise in Linux based careers and closely related Information Technology fields by providing careers advice and latest employment opportunities.


You can also get involved in the LinuxCareer project by participating on our FORUM or SUBMITTING A LINUX ARTICLE. We offer a range of privileges to our authors and good company.