How to install LAMP (Linux, Apache, MySQL, PHP) on Ubuntu 14.04

Install apache on Ubuntu

sudo apt-get update
sudo apt-get install apache2


Install mysql server

sudo apt-get install mysql-server php5-mysql
sudo mysql_install_db
sudo mysql_secure_installation


Install php

sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt
sudo apt-get install php5-curl


For Ubuntu 16.04

sudo apt-get install php libapache2-mod-php php-mcrypt php-mysql php-cli


Finally restart your apache service

sudo service apache2 restart



You may use more elegant method below.

sudo apt-get update
sudo apt-get install tasksel
sudo tasksel install lamp-server 

Leave a Comment

Your email address will not be published. Required fields are marked *