LEMP Stack
Build a complete LEMP stack — Linux, Nginx, MySQL and PHP-FPM — step by step, tested on real servers across every Ubuntu and Debian release.
The whole build on one page
Every step below, start to finish, in a single guide — the fastest route if you are building from a clean server right now.
Tested on Ubuntu 26.04
The Ultimate LEMP Stack Guide for Ubuntu 26.04 (Step-by-Step)
Install a complete LEMP stack on Ubuntu 26.04 in one guide. Covers Nginx, MySQL (MariaDB), PHP-FPM, and Let's Encrypt SSL with security best practices.
4 steps for Ubuntu 26.04
Each step is its own tested guide. Follow them top to bottom, or jump straight to the part you need.
Install Nginx
Install and configure Nginx on Ubuntu 26.04. Covers UFW firewall rules, server blocks, and testing to get a production-ready web server running.
2
Install Database
Step-by-step guide to install MariaDB 11.8 (MySQL compatible) on Ubuntu 26.04. Secure setup with dedicated user/database. Optional Oracle MySQL.
3
Install PHP
Install PHP-FPM with Nginx on Ubuntu 26.04. Covers FastCGI configuration, essential PHP extensions, php.ini tuning, and testing PHP processing.
4
Secure with SSL
Secure Nginx with a free Let's Encrypt SSL certificate on Ubuntu 26.04. Covers Certbot setup, HTTPS redirect, HSTS headers, and auto-renewal.
You need a server first
Skip these if you already have a server you can reach over SSH.
Put the stack to work
Optional follow-ons once the steps above are done.
The same steps with Apache in place of Nginx — same database, same PHP, same Let’s Encrypt certificate at the end.