Passing the Torch: LAMP to LEMP
Replacing Apache with Nginx gives better concurrency.
1. Install Nginx
bash
sudo apt update
sudo apt install nginx2. Install MySQL
bash
sudo apt install mysql-server
sudo mysql_secure_installation3. Install PHP
We need `php-fpm` specifically for Nginx.
bash
sudo apt install php-fpm php-mysql4. Configure Nginx for PHP
Edit your server block:
nginx
location ~ .php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
}Page changelog
Last updated
- 2024-04-05—Initial or baseline update for this page.
Related articles
Getting Started
Tutorials Hub — Learn by Building
Step-by-step workflows that teach deployment, security, and operations by shipping small projects.
Getting Started
Glossary — Infrastructure Terms
Short, clear definitions for common deployment, networking, and security terminology.
Getting Started
Changelog — Documentation Updates
What changed recently in the documentation, plus guidance for versioning docs as code.
Getting Started
Support & FAQ
Quick answers, how to get help, and what information to include when reporting an issue.
Getting Started
Bootstrap — Classic CSS Framework (Fast Layouts)
Use Bootstrap for rapid grids and components, and learn how to override safely with real CSS snippets.
Getting Started
shadcn/ui — Tailwind Components You Own
Add beautiful, accessible components to your app without locking into a hosted UI library. Includes practical examples and structure tips.
Was this page helpful?