How to Install LAMP stack on Ubuntu Server.

What is a LAMP Stack?

LAMP or LAMP stack is a very useful open-source development platform designed for Linux. 

LAMP stands for Linux as an OS, Apache as the webserver, MySQL as Relational DBMS and PHP as the scripting language.

Step 1: Update your system
sudo apt update -y
Step 2: Install Apache Webserver
sudo apt install apache2 -y

You can now start Apache by running below command:

sudo systemctl start apache2 && sudo systemctl status apache2
Step 3: Install MySQL
sudo apt install mysql-server -y

You can now start MySQL by running below command:

sudo systemctl start mysql && sudo systemctl status mysql

To install another mysql version check our mysql installation blog

Step 4: Install PHP

Add apt repository and Update the System

sudo apt install software-properties-common -y && sudo add-apt-repository ppa:ondrej/php
sudo apt update -y

Install the php 7.4 version with most required PHP modules for your website

sudo apt install php7.4 libapache2-mod-php7.4 php7.4-mysql php-common php7.4-cli php7.4-common php7.4-json php7.4-opcache php7.4-readline -y

Enable the Apache php7.4 module then restart Apache Web server.

sudo a2enmod php7.4 && sudo systemctl restart apache2

Check PHP version information.

php --version

To install another php version check our multiple php installation blog

Step 5: It’s also a good idea to enable services to automatically start at system boot time.
sudo systemctl enable apache2 && sudo systemctl enable mysql

Using the above tutorial you have learned how to install configure LAMP or LAMP Stack on Ubuntu.

Please Drop Comment if you faced any issue at any point, I will try to help asap.
100% LikesVS
0% Dislikes


  • You made some decent points there. I looked on the internet for more info about the issue and found most people will go along with your views on this web site. Eleanor Giraud Bendicta

  • I am regular reader, how are you everybody? This post posted at this web page is in fact nice. Karlene Hal Grose Philly Aguste Milka

  • Good post. I learn something new and challenging on sites I stumbleupon on a daily basis. It will always be exciting to read through articles from other authors and use a little something from their web sites. Herminia Barbabas Cherey

  • When someone writes an post he/she maintains the image of a
    user in his/her mind that how a user can be aware of it.
    Therefore that’s why this article is great. Thanks!

  • Wonderful goods from you, man. I have understand your stuff previous to and you are
    just extremely magnificent. I actually like what you
    have acquired here, certainly like what you’re stating and
    the way in which you say it. You make it enjoyable and you still take care of to
    keep it sensible. I cant wait to read far more from you.
    This is really a terrific website.

    Here is my blog … weed gummies

Comments are closed.