The traditional “LAMP stack” means Linux, Apache2, MySQL/MariaDB and PHP for many IT practitioners. It is a collection of software and services for running dynamic web applications with database backends.
Linux is the Operating System kernel on which we run these services. Apache2 is a general web server for running static web sites. MariaDB is a relational database engine for storing persistent data. PHP is a lightweight, interpreted language for writing dynamic server side code for web applications.
A large slice of the known web sites run on the LAMP stack today.

Installing LAMP stack is one of the easiest things in IT.
We will install and configure the services on a Debian Bullseye server from scratch with using the APT repos and their packages.
Let’s start with a fresh package cache!
root@lamp:~# apt update
Now we can start putting everything together.
L – the first letter of LAMP – Linux
Our Linux system is already installed and we can start using it. It is a Debian Bullseye server, but theoretically it could be any Debian based distribution from Ubuntu Linux to Linux Mint. As our system is up and running, we don’t have to do more with it.
The L is done!
A – the second letter of LAMP – Apache2
Apache2 is the second letter. It is our web server. No more words, let’s install it!
root@lamp:~# apt install apache2
The command will install the http server.
root@lamp:~# systemctl status apache2
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2023-02-22 10:58:07 CET; 10s ago
Docs: https://httpd.apache.org/docs/2.4/
We have a working web server. If we navigate our web browser to the IP address of the server, then an Apache welcome message will appear from our default web root directory.

Let’s jump to the next service!
M – the third letter – MariaDB
We will install MariaDB as our database backend. MariaDB is an open source relational database server.
root@lamp:~# apt install mariadb-server mariadb-client
Right after the installation process let’s make our database service more secure and hardened. The following command will erase the test databases, disable the remote root login and set a root password.
root@lamp:~# mysql_secure_installation
Our database service backend is ready to use!
root@lamp:~# systemctl status mariadb
● mariadb.service - MariaDB 10.5.18 database server
Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2023-02-22 11:09:57 CET; 41min ago
Docs: man:mariadbd(8)
We can take care of the next step now.
P – the PHP part
The original LAMP stack contains PHP, but here we can add Perl or Python as well. Most of the CMS and web blog systems require PHP, so we install and integrate it.
root@lamp:~# apt install php php-mysql
After the installation let’s create a new file in the web root (/var/www/html/) called index.php.
The contents of the file should be the following:
<?php phpinfo(); ?>
The PHP information page must be visible if we open the file in browser.

Now we have a basic, working LAMP stack!
It was quick and easy, but we can make it even quicker and easier considering either automation with Ansible, or using container technology like Docker or Podman.
If you have anything to share then please visit my Tom’s IT Cafe Discord Server!
Thanks for your article. What I want to say is that when searching for a good on the web electronics store, look for a web page with total information on critical factors such as the level of privacy statement, security details, payment options, as well as other terms in addition to policies. Generally take time to read the help along with FAQ pieces to get a better idea of how the shop operates, what they are capable of doing for you, and in what way you can use the features.
LikeLike