About LEMP
LEMP swaps Apache for Nginx (said engine-x, hence the E): Linux, Nginx, a MySQL-compatible database and PHP under PHP-FPM. Nginx serves static files itself and hands PHP requests to a pool of FPM workers over FastCGI.
That split keeps memory flat when many visitors arrive at once, which is why LEMP suits busy blogs, shops and APIs on modest plans. On a CloudSat VPS you tune worker counts, OPcache and cache headers yourself.
After deploy Nginx answers on port 80 with a default server block, PHP-FPM is running, and the database is ready for your first schema.
What you get with LEMP
- Nginx for static files, TLS and reverse proxying
- PHP-FPM pools with their own users and limits
- A MySQL-compatible database server
- FastCGI caching and compression in the web server
LEMP use cases
- Laravel or Symfony apps with clean URL routing
- WordPress sites behind Nginx page caching
- PHP APIs that need predictable memory under load
After you deploy LEMP
- Wait until the console shows Running, check
http://<server IP>/, then log in as root over SSH. - Add a server block for your domain (on Ubuntu's layout, in
/etc/nginx/sites-available/linked intosites-enabled) and test it withnginx -t. - Create a database and user for the app with the
mysqlclient, then put those credentials in the app's config. - Issue a certificate, for example with Certbot's Nginx plugin, and reload Nginx.
LEMP ports
Open these in your firewall if you use one: 80/tcp HTTP, 443/tcp HTTPS.
LEMP FAQ
Does `.htaccess` work on LEMP?
No. Nginx ignores .htaccess, so rewrite rules move into the server block. Most frameworks publish an Nginx example, and WordPress needs little more than a try_files line.
How many PHP workers should I run?
Divide the memory you can spare by the size of one PHP-FPM process (check it with top) and use the result for pm.max_children.
Disclaimer. The LEMP project has no affiliation with CloudSat and does not endorse it. Names and logos belong to their owners and appear only to identify the software.