Dark Light

LEMP is a software stack that includes a set of free of charge open source tools that are utilized to power high traffic and dynamic websites. LEMP is an acronym for Linux, Nginx (pronounced Engine X), MariaDB / MySQL, and PHP.

Nginx is an open source, powerful and top of the line web server that can also double as a reverse proxy. MariaDB is a database system for storing consumer data, while PHP is a server-side scripting language for developing plus supporting dynamic web pages.


In this article, you will learn the way to install a LEMP server on a CentOS 8 Linux distribution.

Step 1 : Update the particular package on CentOS 8

First, revise the repository and packages upon CentOS 8 Linux by working the following dnf command.

dnf update

Step 2: Install Nginx web server on CentOS 8

After the package update is complete, install Nginx with a simple control.

dnf install nginx

Install Nginx on CentOS 8

The code snippet shows that the installation of Nginx went smoothly without any problems.

Following the installation is complete, configure Nginx to start automatically at system start-up, and verify that Nginx is usually running by executing a order.

systemctl enable nginx
systemctl begin nginx
systemctl status nginx

nginx -v

Step 3: Install MariaDB on CentOS 8

MariaDB is a free and open up source branch of MySQL and provides the latest features that make it a better alternative to MySQL. To install MariaDB, run the command.

dnf install mariadb-server mariadb -y

In making MariaDB start automatically at program startup, run.

systemctl start mariadb
systemctl enable mariadb

The MariaDB database engine is not secure and anybody can log in without credentials. To harden MariaDB and protect this to minimize the chance of unauthorized accessibility, run the command.


Step 4: Install PHP 7 on CentOS 8

Finally, we will install the last LEMP component, PHP, which is a scripted web programming language that is usually used to develop powerful web pages.

At the time of writing this guide, the latest edition is PHP 7. 4. We are going to install it using the Remi repository. The particular Remi database is a free data source that comes with the latest cutting-edge software version and is not available on CentOS automatically.

Run the following command to install the EPEL repository.

dnf install https://dl.Fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm

dnf install dnf-utils http://rpms.remirepo.net/enterprise/remi-release-8.rpm

dnf module list php

CentOS-8 – AppStream
Name Stream Information Summary
php 7. 2 [d][e] common [d], devel, minimum PHP scripting language
php 7. 3 common, devel, minimal PHP scripting language

Remi’s Modular repository for Enterprise Linux 8 – x86_64
Title Stream Profiles Summary
php remi-7. 2 common [d], devel, minimal PHP scripting language
php remi-7. 3 common [d], devel, minimal PHP scripting language
php remi-7. 4 common [d], devel, minimal PHP scripting language

dnf module reset php

dnf module enable php: remi-7. 4

dnf install php php-opcache php-gd php-curl php-mysqlnd

php -v
PHP 7. 4. 3 (cli) (built: Feb 18 2020 11: 53: 05) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3. four. 0, Copyright (c) Zend Technologies
with Zend OPcache v7. 4. 3, Copyright (c), simply by Zend Technologies

systemctl start php-fpm
systemctl enable php-fpm

nano /etc/php-fpm. d/www.conf

user = apache
group = apache

user = nginx
group = nginx

systemctl restart nginx
systemctl restart php-fpm

compact disc /usr/share/nginx/html/
$echo “” > index. php

Leave a Reply

Your email address will not be published. Required fields are marked *