Lamp is an example of web server stack. Mostly when people use windows as its operating system then it’s called WAMP, similarly if you use Solaris it will become SAMP and MAMP for Macintosh. Sometimes users use Pearl or python as programming language. Here we see what is Debian and the steps to install LAMP stack on Debian.
What is Debian?
Debian is an open source and free, Linux distributed operating system developed by community supported Debian Project. It is also known as GNU/Linux. It is used for open sources and is light weight and stable.

Table of Contents
How to install LAMP Stack On Debian
Step 1: update your packages
Debian uses apt package and we need to make sure that it’s up to date before installing anything.
sudo apt update

step 2: installing Apache
you can type in the following command to get your installation starting.
apt-get install apache2

press ‘y’ for continuing the installation.
After the installation is completed you can open your apache through your web browser by typing in your ip address. If you don’t know your public ip address then type in your terminal to find out
ifconfig eth0 | grep inet | awk '{ print $2 }'

you will see a confirmation page by typing in your IP address.

Step 3: Installing MariaDB/MySql
- MariaDB
Run the following command to install MariaDB in your Debian
sudo apt install mariadb-server

MariaDB will run automatically once installed, to check the status run the following command.
sudo systemctl status mariadb
- MySQL
To install MySql run the command.
apt-get install mysql-server

type in your root password to finish the installation.
You can also secure your installation so no other harmful things install with your MySql
mysql_secure_installation
this will ask you for your root password as well, go ahead and type in to make sure the secure installation runs.
You can check if you have successfully installed by checking the status

Step 4: installing PHP
Php is s server-side scripting language, it will help you to run your scripts, connect to your web server and your database.
To install PHP in your Debian you need to type in the following command.
sudo apt install php libapache2-mod-php php-mysql

once the installation is complete you can check your php by running any php script.
To install any PHP package, you want through the following command
sudo apt install package-name
you can install multiple packages by separating package name by space and listing down the packages
sudo apt install package1 package2