Home / Blog / Post
How to set up LAMP stack on Ubuntu / Debian linux server?
28 December, 2020 by
How to set up LAMP stack on Ubuntu / Debian linux server?
Goran Štimac

What is a LAMP?

LAMP is an archetypal model of a set of web services, named as an abbreviation of the names of its original four open components: the Linux operating system, the Apache HTTP server, the MySQL relational database management system (RDBMS), and the PHP programming language.

LAMP is the most common environment for popular PHP applications such as: WordPress, Joomla, Drupal, Magento, Laravel and many others.

Let's set up a LAMP stack

Installing Apache and customizing the firewall to enable web traffic:

sudo apt update
sudo apt install apache2
sudo ufw allow in "Apache Full"

Installing MySQL:

sudo apt install mysql-server
sudo mysql_secure_installation
sudo mysql

Configure root accounts for password authentication, don't forget to change the password in your password:

SELECT user,authentication_string,plugin,host FROM mysql.user;
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';

Installing PHP:

sudo apt install php libapache2-mod-php php-mysql