How to Install LAMP on Ubuntu

In this tutorial, we are going to install LAMP (Linux, Apache, MySQL and PHP) on Ubuntu OS.

To install LAMP on Ubuntu follow the steps given below,

Step 1:

The first thing we need to do is install Apache web server. To do this run the following command within your terminal.

sudo apt-get install apache2

Step 2:

In the second step, we are going to install MySQL. This can be done by running the following command.

sudo apt-get install mysql-server

Step 3:

Next thing we are going to do is install PHP on our computer. We do this by using following command.

sudo apt-get install php5 libapache2-mod-php5

Step 4:

By default, after installation Apache server automatically gets restarted. If it doesn’t run the following command.

sudo service apache2 restart

To check if the installation was successful, open your web browser and type following URL. After successful installation it will display a “It works” message.


Useful Read : How To Set Up mod_rewrite for Apache on Ubuntu


Leave a Comment.