How to install Drupal 7 on ubuntu Part 1
This is a full article on how to install Drupal on Ubuntu, that means you can use this guide even if you have a clean installation of Ubuntu, and I will try to keep it as simple as I can.
What you will need in order to install Drupal.
First of all you will need a LAMP Server(more information can be found here).
1. You have to install a Linux system(you can choose whatever you want. A guide on how to install Ubuntu can be found here).It doesn’t really matter if you choose a desktop or server edition but if you are planning to publish your Drupal website I strongly recommend to use a server edition of Ubuntu for example.
2. You will need Apache (more information can be found here)
3. You will need MySQL (more information can be found here)
4. You will need PhP (more information can be found here)
5. And last but not least you will need to download Drupal from official site.
Let’s go to the next Part and install Lamp
How to install Drupal 7 on Ubuntu Part 2:
tasksel lamp
At this point I assume that you already have a Linux system running if you don’t please to do that first(info). For this tutorial I use Ubuntu 11.10 but it will work with newer or older versions of Ubuntu too.
In order to set up our lamp Server I follow the easiest way and i will use tasksel.
First of all you have to install tasksel. Open a terminal and type:
sudo apt-get update
sudo apt-get install tasksel
Ok now you have installed tasksel and you can access it by typing:
sudo tasksel
A screen like the following will appear :

Navigate with up and down arrow keys and select with spacebar. The mouse is not working here. Go on and select “LAMP Server” then click “ok”. You are almost done. After a while, another screen will appear asking you for a password. This is the password for root user of MySQL. Use something that you can remember because you will need it if you want to have access to MySQL.
Retype your password and then you are done!
Congratulation! Now you have your own LAMP server
Let’s go to the next Part
How to install Drupal on Ubuntu Part 3:
PhpMyAdmin
In this step we will install PhpMyAdmin(more info can be found here). This is not a mandatory step and you can skip it if you know how to use MySQL commands but it will make life easier so I strongly recommend to proceed.
In order to install PhpMyAdmin you have to install first Mysql, PHP and Apache (so you have to complete Step 2 first).
Open your terminal and type the following:
$>sudo apt-get install phpmyadmin
A screen like the following will appear and now you have to choose the web server that should be automatically configured to run PhpMyAdmin(you can navigate by using the “arrow keys” and you can select by using the “spacebar key”). It is recommended to use the apache server.

After that the a screen like the following will ask if you want to let the installation configure the database for PhpMyAdmin for you. It is recomended to click “YES” on that.
Then you have to type the MySQL root password so the PhpMyAdmin can access the MySQL.
And for the final step you have to enter a password for the PhpMyAdmin and retype it when the confirmation screen appears.
Congratulation the PhpMyAdmin is now installed into your system and you can access it by pointing your web browser at http://localhost/phpmyadmin/
For user name use “root” and for password use the one you have chosen.
How to install Drupal 7 on Ubuntu Part 4:
Download and extract Drupal 7
Now that our system is ready to host a cms like Drupal we can go to Drupal official site and download Drupal. There are more than one packages that you can download. In this tutorial I use the one with the ending tar.gz. When you download this with firefox you can find that file in your local folder /home/(your_account_name)/Downloads/
Ok now we have to copy and extract that file in /var/www/ folder. This folder is the default apache folder. To do that open a terminal and type:
cd ~/Downloads/
You should see the downloaded Drupal package in this folder if you type:
ls
Now we have to copy that file in the apache default folder. So type:
sudo cp (the name of drupal package including the ending tar.gz) /var/www
If all was ok you can now find this file also in /var/www/ directory.
Let’s check it out. Type:
cd /var/www/
ls
you should be able to see the Drupal package and also another file index.html.
Ok now we will extract this file here by typing:
sudo tar -xvf (the name of drupal package including the ending tar.gz)
Great, now you have a directory inside the /var/www/ with the name “drupalxxx” (where xxx is the version of rupal)
Let’s rename that folder.
sudo mv drupalxxx /var/www/drupal
I just do that because its annoying to write “.” , “-” and numbers in your browser.
Note!
if you want your Drupal site to be the default site of your server and appear under http://localhost you should follow the next steps.
All you have to do is to delete the index.html from /var/www/
sudo rm /var/www/index.html
And copy everything from /var/www/drupal into /var/www
cd /var/www/drupal/
sudo cp -r * /var/www
sudo /etc/init.d/apache2 restart
How to install Drupal 7 on Ubuntu Part 5:
Create database and install Drupal
Now everything is ok and we can start installing Drupal.
Open a browser and navigate to “http://localhost/drupal“, you can now see the first page of drupal installation. Before we continue we have to create a database so Drupal can save your site contents. To do that, open a new browser and navigate to “http://localhost/phpmyadmin“. You should now be able to see PhpMyAdmin login page. For username enter “root” and for password enter (the password you selected when we install PhpMyAdmin).
Ok now we are ready to create a new empty database:
Click on “Databases” and then under the “Create new Database” type a name for the database and click Create. you should get a message telling you that database has been created.
Go back to Drupal installation browser and click from “Select an installation profile” “Standard”. Click “Save and continue”
Next choose language and click “Save and continue”
On the next step you may find some “Requirements problems”. DON’T PANIC!!!!! those are just permissions problems. Let’s fix them. open a terminal and type:
sudo chmod 777 /var/www/drupal/sites/default
sudo cp /var/www/drupal/sites/default/default.settings.php /var/www/drupal/sites/default/settings.php
sudo chmod 777 /var/www/drupal/sites/default/settings.php
Now go back to Drupal installation page and refresh the page. If all was ok you should now see “Database configuration”
Database Name: (the name you enter when you create the database with PhpMyAdmin)
Database username: “root”
Password: (the password you enter for MySQL root user when you were installing lamp)
Click “Save and continue”
Now write info’s about your site
Site name: Choose a name for your site
Site e-mail address: Give your email here
Username: Create a username for the administrator of this site
E-mail address: Administrators email adreess goes here (you have the same as Site e-mail address )
Password: A password for administrator
Default country: Choose a country
Default time zone: Choose a time zone
Click “Save and continue”
Now you are done enjoy your new Drupal website
Here is a Bash script to make your life easier.
Important!!!RUN THIS SCRIPT AT YOUR OWN RISK!!!
# This is an installation of Drupal from a clean Ubuntu O.S.
echo “This is script for lazy boys and girls from allaboutlinux.eu”
echo “Use this script only if you have a clean installation of Ubuntu”
echo “More can be found at allaboutlinux.eu”
echo “Note allaboutlinux.eu has no responsibility run this script at your own risk!!!!”
echo “Please write the version of drupal you want to install ex:’7.14′”
echo “NOTE! Must be a valid version!!!”
read VER
cd ~/Downloads
wget http://ftp.drupal.org/files/projects/drupal-$VER.tar.gz
echo “WRITE YOUR PASSWORD AND HIT ENTER”
sudo apt-get update
sudo apt-get install tasksel -y
sudo tasksel install lamp-server
sudo apt-get install phpmyadmin -y
sudo cp drupal-$VER.tar.gz /var/www
cd /var/www/
sudo tar -xvf drupal-$VER.tar.gz
sudo mv drupal-$VER /var/www/drupal
sudo chmod 777 /var/www/drupal/sites/default
sudo cp /var/www/drupal/sites/default/default.settings.php /var/www/drupal/sites/default/settings.php
sudo chmod 777 /var/www/drupal/sites/default/settings.php
firefox http://localhost/drupal
firefox http://localhost/phpmyadmin
You can also download it from here
Here is a video tutorial using the script
Video: watch on YouTube ↗





