How Can I Help

Let's Connect

How to set up a LAMP stack on Ubuntu / Debian Linux server?

What is 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

Install Apache and customize the firewall to enable web traffic:

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

Install 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';

Install PHP:

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


Looking for an IT professional?

Schedule a Consultation