Getting started with One-click LEMP stack (Nginx with PHP and MariaDB)


SpectraIP's one-click LEMP application is an easy way to deploy web applications on Linux, Nginx, PHP and MariaDB (MySQL). The one-click application is based on Debian 11 minimal, a very light weight operating system.

Pre-installed software

  • Nginx (webserver)
  • PHP-FPM 8.1
  • MariaDB 10.8 (SQL server)
  • Certbot-nginx (Let's Encrypt SSL)
  • Redis and Memcached

In this tutorial, we will be using as example IP address. Please replace this IP address with your VPS's IP address.

  • Your webserver is reachable via http:
  • PHP-info is available via
  • Nginx document root (web files): /var/www/html
  • Command to enter MySQL CLI: mysql -u root


Our LEMP stack comes with modern and fast SQL server MariaDB 10.8. You can connect to the MySQL database server with:

mysql -u root

Create a database with the following command:

create database database1;

Create a database user with full permissions to 'database1' - once done, also flush the privileges:

grant all on database1.* to dbadmin@localhost identified by 'RlhDmPuYr7WIr4p4aUfC1RM';
flush privileges;

Note: in this case, your database password is: RlhDmPuYr7WIr4p4aUfC1RM

Let's Encrypt SSL certificates

In order to request an SSL certificate via Let's Encrypt, you must meet the following requirements:

  1. A valid DNS record (or records) for your domain name(s).
  2. The domain names must be configured as 'server name' in nginx.

In this guide, we will use with document root /var/www/html. Please edit your nginx site configuration:

nano /etc/nginx/sites-available/default

In this case, you can find the following lines:

server_name _;

Change it to your preferred domain name:


Once changed, you can test your nginx configuration for errors:

nginx -t

We here see no errors:

root@lemp-stack:~# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

Once you confirmed there are no errors, you can reload nginx:

systemctl reload nginx

You can now request the SSL certificate via certbot:

certbot --nginx -d -d

Replace "" with your own domain name(s) - in our case ""

Now follow certbot's short menu, after which your new SSL certificate is installed. We can now visit with https:

Note: Your website should automatically redirect to https (SSL).

Was this answer helpful?

 Print this Article

Also Read

Scan CentOS server for viruses and malware

Introduction Some unexpected behavior on a Linux server can be caused by a malware infection....

Mail servers on Cloud VPS

At SpectraIP, the reputation of our network and IP addresses is very important and we are...