How to Install LEMP Stack on AlmaLinux 10
The LEMP Stack on AlmaLinux 10 is a strong base for modern PHP applications, APIs, control panels, CMS deployments, and custom websites. By combining Linux, Nginx, MariaDB, and PHP-FPM, you get a lean web stack that handles concurrent traffic efficiently while still staying familiar for day-to-day administration.
In this guide, we restore a fresh AlmaLinux 10.1 server on Shape.Host CloudStack, verify the latest stable package path before installation, add the official vendor repositories we need, install Nginx 1.28.2, PHP 8.5.4, and MariaDB 11.8.6, then validate the full stack on tutorials.shape.host with a live browser test page.
What Is a LEMP Stack?
LEMP stands for Linux, Engine-X (Nginx), MariaDB, and PHP. It is a popular alternative to Apache-based stacks because Nginx performs well under concurrency, PHP-FPM integrates cleanly with it, and MariaDB remains one of the most practical open-source relational databases for web workloads.
Stack Versions Used in This Tutorial
| Component | Version Verified | Source |
|---|---|---|
| AlmaLinux | 10.1 | Fresh Shape.Host VM restore and /etc/os-release check |
| Nginx | 1.28.2 | Official Nginx stable repository for EL10 |
| PHP | 8.5.4 | Remi PHP 8.5 packages for Enterprise Linux 10 |
| MariaDB | 11.8.6 | Official MariaDB 11.8 repository |
Why Use the LEMP Stack on AlmaLinux 10?
- AlmaLinux 10 gives you a modern Enterprise Linux base with long maintenance coverage.
- Nginx 1.28 stable is efficient for reverse proxying, static delivery, and PHP applications behind PHP-FPM.
- PHP 8.5 keeps the stack current for fresh deployments instead of relying on older default runtime branches.
- MariaDB 11.8 gives you a current stable database branch from the official upstream repository.
LEMP vs LAMP
| Stack | Web Server | Best Fit |
|---|---|---|
| LEMP | Nginx | High-concurrency PHP sites, modern reverse proxy setups, leaner web serving |
| LAMP | Apache | Legacy PHP applications, heavy .htaccess workflows, Apache module compatibility |
Prerequisites
- A fresh AlmaLinux 10 server
- Root or sudo access
- A reachable IPv4 address on port 80
- At least 2 vCPU, 4 GB RAM, and 50 GB disk for a comfortable base deployment
1. Verify the Operating System
Start by confirming the server is running AlmaLinux 10.1 before you begin the LEMP Stack installation.
cat /etc/os-release

2. Update the Server and Install Base Utilities
Update the system first, then install the base tools required for repository management and package installation.
dnf -y update
dnf -y install epel-release dnf-plugins-core curl ca-certificates gnupg2 tar unzip

3. Add the Official Nginx, Remi PHP, and MariaDB Repositories
AlmaLinux 10 is a great base, but for a current LEMP Stack on AlmaLinux 10 we want the upstream-supported package sources for Nginx, PHP 8.5, and MariaDB 11.8. Enable CRB, install the Remi repository package, add the official Nginx stable repository, and write the MariaDB 11.8 repository file.
dnf config-manager --set-enabled crb
dnf -y install https://rpms.remirepo.net/enterprise/remi-release-10.rpm
cat >/etc/yum.repos.d/nginx.repo <<'EOF'
[nginx-stable]
name=nginx stable repo
baseurl=https://nginx.org/packages/rhel/$releasever/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true
EOF
curl -LsS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | bash -s -- --mariadb-server-version=mariadb-11.8
After the MariaDB repository file is written, disable the unused MaxScale subrepository so package metadata stays clean on this host:
dnf config-manager --set-disabled mariadb-maxscale
4. Install Nginx, PHP 8.5, and MariaDB 11.8
With the repositories in place, install Nginx, the Remi PHP 8.5 runtime with PHP-FPM and common modules, and the MariaDB server and client packages.
dnf --disablerepo=mariadb-maxscale -y install \
nginx \
php85 php85-php-cli php85-php-fpm php85-php-mysqlnd php85-php-xml php85-php-mbstring php85-php-pecl-zip \
MariaDB-server MariaDB-client

5. Configure Nginx, PHP-FPM, MariaDB, and a Live Test Site
For this tutorial, we used tutorials.shape.host as the live validation hostname. The site root is /usr/share/nginx/html, and because PHP 8.5 comes from Remi on AlmaLinux 10, PHP-FPM listens on /var/opt/remi/php85/run/php-fpm/www.sock.
A minimal Nginx server block for this deployment looks like this:
server {
listen 80;
listen [::]:80;
server_name tutorials.shape.host;
root /usr/share/nginx/html;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass unix:/var/opt/remi/php85/run/php-fpm/www.sock;
fastcgi_index index.php;
}
}
After writing the site config and the PHP verification page, enable the services and reload Nginx:
systemctl enable --now nginx php85-php-fpm mariadb
nginx -t
systemctl reload nginx

6. Verify the Installed Versions and Service State
Use the runtime binaries to confirm the exact component versions on the server. On Remi-based AlmaLinux 10 installs, the CLI binary for PHP 8.5 lives under /opt/remi/php85/root/usr/bin/php.
nginx -v
/opt/remi/php85/root/usr/bin/php -v
mariadb --version
systemctl is-active nginx php85-php-fpm mariadb
On this Shape.Host deployment, the installed versions were:
- Nginx 1.28.2
- PHP 8.5.4
- MariaDB 11.8.6

7. Confirm the LEMP Stack in a Browser
Finally, open http://tutorials.shape.host/ in a browser. The validation page below confirms that Nginx is serving the site, PHP-FPM is processing requests, and the PHP application can connect successfully to MariaDB.

Troubleshooting Notes
- If
php -vis missing from your default shell path, use/opt/remi/php85/root/usr/bin/phpfor direct version checks. - If your Nginx test page returns a 502 error, confirm that the PHP-FPM socket path matches the Remi service socket at
/var/opt/remi/php85/run/php-fpm/www.sock. - If you use the MariaDB setup script, make sure the
mariadb-maxscalesubrepository is disabled unless you actually need it.
Conclusion
You now have a working LEMP Stack on AlmaLinux 10 with Nginx 1.28.2, PHP 8.5.4, and MariaDB 11.8.6. This is a current and practical base for modern PHP applications that need a lean web server, a maintained runtime, and a current MariaDB branch.
For production use, the next sensible steps are adding HTTPS for tutorials.shape.host, tightening your Nginx server block, limiting database privileges per application, and deploying your real application code on top of this verified stack.