What Is LAMP Server? Components, Working & Installation Guide

Published: (December 26, 2025 at 05:18 AM EST)
1 min read
Source: Dev.to

Source: Dev.to

Components of LAMP

  • Linux: The underlying operating system.
  • Apache: A widely used web server that processes HTTP requests and delivers web content.
  • MySQL/MariaDB: A relational database management system (RDBMS) for storing and managing data.
  • PHP/Python/Perl: A programming language for server‑side scripting.

How LAMP Works

Linux forms the stable base for all components. Apache receives incoming HTTP requests and serves web pages. PHP (or another scripting language) processes dynamic content. MySQL/MariaDB stores and manages website data.

Installing LAMP on Linux

Installation Diagram

On Ubuntu/Debian

sudo apt install apache2 mysql-server php php-mysql
# Enable and start services
sudo systemctl enable apache2
sudo systemctl start apache2
sudo systemctl enable mysql
sudo systemctl start mysql

On CentOS/Fedora

sudo apt install httpd mysql-server php php-mysql
# Enable and start services
sudo systemctl enable httpd
sudo systemctl start httpd
sudo systemctl enable mysql
sudo systemctl start mysql

Verify Installation

Apache

Open a web browser and go to http://your-server-ip. You should see the Apache default page.

PHP

Create a test file /var/www/html/info.php with the following content:

Then access http://your-server-ip/info.php in your browser.

Back to Blog

Related posts

Read more »