A LAMP stack is a collection of open source software (Linux, Apache, MySQL, PHP), also known as a Web Stack, installed on a server to enable it to host dynamic websites.
This guide will show you how to get a LAMP stack installed on an Ubuntu 16.04 server.
Update your system by running the following command:
sudo apt-get update && sudo apt-get upgrade
You will see a list of packages to be upgraded, type "y" and press enter for the system to upgrade the packages.
Moving on to installing Apache, run the following command:
sudo apt-get install apache2
You will see a list of packages to be installed, type "y" and press enter for them to be installed.
Now, navigate to your server IP in your web browser. If you see the default page for Apache as shown below, it means Apache is installed correctly and can be accessed.
Moving on, run the following command to install MySQL:
sudo apt-get install mysql-server
As usual, packages will be shown and press "y" and enter to install them.
Then choose a password for your MySQL root user and confirm it.
Moving on, to install PHP, run the following command:
sudo apt-get install php libapache2-mod-php php-mcrypt php-mysql
Again, packages to be installed will be shown, press "y" and enter to install them.