Introduction
LAMP stands for Linux, Nginx, MySQL/MariaDB, and PHP. Together, they provide a proven set of software for delivering high-performance dynamic websites and applications. Each component contributes essential capabilities to the stack.
This article will explain how to install the LEMP stack on Debian 10.
Install Nginx
- Before starting the installation let's update the system.
$ sudo apt -y update
$ sudo apt upgrade - To install Nginx on Debian 10, run the following command.
$ sudo apt -y install nginx
- After the installation, start and enable the Nginx service using the following commands.
$ sudo systemctl start nginx
$ sudo systemctl enable nginx
Install MariaDB
MariaDB is a drop-in replacement for MySQL database servers, and it is used to store and manage dynamic data on web servers.
- To install MariaDB run the below command on the terminal.
$ sudo apt -y install mariadb-server
- Start and enable the MariaDB service using the following commands.
$ sudo systemctl start mariadb
$ sudo systemctl enable mariadb - To secure the MariaDB installation, run the following command.
This command will prompt you to enter the root password, and then it will ask some questions to secure the MariaDB installation, such as removing the anonymous users, disabling the root login remotely, removing the test database, and reloading the privilege tables.$ sudo mysql_secure_installation
Install PHP
- To install PHP on Debian 10, run the following command.
$ sudo apt install php-fpm php-mysql
- Once the installation is complete, you can verify the version of PHP .
$ php -v