Installing LAMP Stack in Ubuntu

Hai friends. Lets Setup the LAMP-Linux Apache MySql and PHP in Ubuntu Linux 🙂

First of all Install Ubuntu Linux in the Machine you wish to Install the LAMP Stack.

Step1: Hey Step 1 in setting LAMP Stack is installing a Linux Distro and by now you might have completed the  first step 🙂

Considering the installation as a fresh one.

First update the distro for that open a terminal and give the following commands :

$sudo apt-get update

The above command will fetch the softwares list from the Ubuntu repositories.


$sudo apt-get upgrade

The above command will update your Ubuntu OS to date.


The Second step is to install APACHE WEB SERVER. for that :

$sudo apt-get install apache2

this will install apache server on your machine

You can control apache using

$sudo service apache2 start/stop/restart


The next step is MYSQL DATABASE SERVER for that:

$sudo apt-get install mysql-server mysql-client

while installing the server it will prompt for a password for mysql server. Enter is twice and continue.

You can control mysql server by

$sudo service mysql start/stop/restart

Here you can install mysql-gui-tools-common which will give you



which will be of great help 🙂


Now the last step is to install php.

$sudo apt-get install php5

and everything is done. 🙂

Now goto /var/www and create a test.php




and open a browser and navigate to http://localhost/test.php

it shows the phpinfo page and the LAMP Stack is Ready 🙂