Multi-part series

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.

4 steps · 5 editions · Every command tested on a real server
Start here

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.

Or one step at a time

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.

Before you begin

You need a server first

Skip these if you already have a server you can reach over SSH.

After the build

Put the stack to work

Optional follow-ons once the steps above are done.

Prefer Apache? Build the LAMP Stack instead

The same steps with Apache in place of Nginx — same database, same PHP, same Let’s Encrypt certificate at the end.