How to Install Apache, MySQL, and PHP on Ubuntu

LAMP includes Apache, MySQL, PHP, and Ubuntu. This guide was written for Ubuntu 15

Step One: Install Apache

Apache is a free open source software for web servers.

To install Apache on Ubuntu, type these commands:

sudo apt-get update
sudo apt-get install apache2

Or just copy and paste this:

sudo apt-get update; sudo apt-get install apache2

Now the apache is running. Run the command: hostname -I and note down that IP. Open up your Internet Browser and direct your browser to that IP (Example: ). The page should load and say “Apache2 Ubuntu Default Page”.

Step Two: Install MySQL

MySQL is a database management system. Let’s install MySQL on Ubuntu. Type these commands:

sudo apt-get install mysql-server php

During the install, MySQL will request for you to setup a password.

Step Three: Install PHP

Now write these commands:

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


133 total views, 2 views today

Print Friendly