Multi-part series

LAMP Stack

Build a complete LAMP stack — Linux, Apache, MySQL and PHP — 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 LAMP Stack Guide for Ubuntu 26.04 (Step-by-Step)

Install a complete LAMP stack on Ubuntu 26.04 in one guide. Covers Apache, MariaDB, PHP, virtual host configuration, and free Let's Encrypt SSL setup.

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 Nginx? Build the LEMP Stack instead

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