LEMP Stack VPS HostingNGINX and PHP-FPM on Your Own Server
NGINX in front of PHP-FPM and MySQL or MariaDB: the stack most high-traffic PHP sites run on. We install and secure it on a KVM VPS with reserved CPU and RAM, and you get root SSH to tune every layer.
Full root & SSH NVMe storage Daily backups Anti-DDoS 99.9% uptime SLA 11 locations
-
Root and SSH access
Edit server blocks, FPM pools and my.cnf directly.
-
Reserved vCores and RAM
PHP-FPM workers sized to resources that are yours.
-
NVMe storage
Fast reads for PHP files, sessions and database pages.
-
Anti-DDoS, IPv4 + IPv6
Dedicated addresses with always-on mitigation.
Why Choose LEMP on a VPS
NGINX handles thousands of idle and slow connections with a few worker processes, leaving more of the server's memory for PHP and the database.
-
Lower memory per connection
NGINX's event-driven workers do not tie up a process per visitor the way Apache prefork does, so the same RAM serves more people at once.
-
Static files served without PHP
Images, CSS and JavaScript go straight from NGINX with cache headers; only dynamic requests reach PHP-FPM.
-
Built-in page caching
FastCGI cache stores rendered pages on NVMe and serves them without running PHP, which suits content sites with mostly anonymous visitors.
-
Separate PHP pools per site
Each site gets its own PHP-FPM pool and Linux user, with its own worker limits and PHP settings.
How the LEMP Stack Handles a Request
NGINX answers what it can itself; everything dynamic goes to PHP-FPM over a local socket.
Request from a browser or app (HTTPS)
-
Web server
NGINX
Terminates HTTPS and HTTP/2, serves static files and cached pages, and passes .php requests on.
-
PHP runtime
PHP-FPM + OPcache
A pool of PHP workers per site on a Unix socket, with compiled code kept in memory.
-
Database
MySQL or MariaDB
Listens on localhost only, with one database and user per application.
-
OS
Linux (Ubuntu, Debian, AlmaLinux, Rocky)
Firewall, Fail2ban and automatic security updates run here.
Worth knowing
- NGINX does not read .htaccess: rewrite rules go into the site's server block.
- The E in LEMP comes from how NGINX is pronounced: "engine-x".
- pm = ondemand lets quiet sites idle at almost no memory; pm = static suits steady traffic.
- Redis can be added for WordPress object caching or framework sessions.
What You Can Run on a LEMP VPS
-
High-traffic WordPress
FastCGI cache and Redis object caching in front of WordPress or WooCommerce.
-
Laravel and Symfony apps
Modern PHP frameworks are usually deployed on NGINX and PHP-FPM in production.
-
Several PHP sites, one server
Separate server blocks, pools and users for company or client sites.
-
Magento, PrestaShop and OpenCart
PHP stores with many static assets, which NGINX serves efficiently.
-
APIs and headless back ends
PHP APIs with rate limiting and response caching handled in NGINX.
-
Apps with a single front controller
Custom code that routes everything through index.php runs on NGINX with one try_files rule.
VPS Plans for Your LEMP Server
VPS-1 is a good start for a handful of PHP sites. Busy WooCommerce stores and sites with large databases do better on VPS-2 or VPS-3.
VPS-1
Small websites, APIs, bots and development servers.
- 2 vCores
- 4 GB RAM
- 40 GB NVMe
- 500 Mbps
- Full root and SSH access
- Free initial stack installation
- Server hardening and firewall setup
- Daily backup of the previous 24 hours
- Unlimited traffic *
- Anti-DDoS protection
- Dedicated IPv4 and IPv6
- KVM virtualisation
VPS-2
Production apps, WordPress and online stores.
- 4 vCores
- 8 GB RAM
- 75 GB NVMe
- 1 Gbps
- Full root and SSH access
- Free initial stack installation
- Server hardening and firewall setup
- Daily backup of the previous 24 hours
- Unlimited traffic *
- Anti-DDoS protection
- Dedicated IPv4 and IPv6
- KVM virtualisation
VPS-3
Busy stores, SaaS products and several projects.
- 6 vCores
- 12 GB RAM
- 100 GB NVMe
- 2 Gbps
- Full root and SSH access
- Free initial stack installation
- Server hardening and firewall setup
- Daily backup of the previous 24 hours
- Unlimited traffic *
- Anti-DDoS protection
- Dedicated IPv4 and IPv6
- KVM virtualisation
VPS-4
High-traffic apps, large databases and agencies.
- 8 vCores
- 24 GB RAM
- 200 GB NVMe
- 3 Gbps
- Full root and SSH access
- Free initial stack installation
- Server hardening and firewall setup
- Daily backup of the previous 24 hours
- Unlimited traffic *
- Anti-DDoS protection
- Dedicated IPv4 and IPv6
- KVM virtualisation
* Unlimited traffic in Europe and North America. In Mumbai, Singapore and Sydney a monthly allowance applies (VPS-1 500 GB, VPS-2/VPS-3 1 TB, VPS-4 3 TB), then speed is limited to 10 Mbps until the next month.
Which Plan for Your LEMP Server
NGINX itself needs little memory. Size the plan for PHP-FPM workers and the database.
| Workload | Start with | Why |
|---|---|---|
| Several small PHP sites | VPS-1 2 vCores · 4 GB RAM | NGINX, PHP-FPM and MariaDB fit comfortably in 4 GB. |
| High-traffic WordPress with FastCGI cache | VPS-2 4 vCores · 8 GB RAM | Cached pages are cheap; RAM goes to PHP and the database for logged-in users. |
| WooCommerce, Magento or PrestaShop store | VPS-3 6 vCores · 12 GB RAM | Catalogue search and checkout are PHP- and database-heavy. |
| Agency or multi-store server | VPS-4 8 vCores · 24 GB RAM | Room for many server blocks, pools and databases. |
A starting point, not a limit: every plan upgrades in place, keeping your data, IP address and configuration.
LEMP or LAMP on a VPS?
Both run the same PHP apps. The web server in front is what differs.
| Feature | LAMP (Apache) | LEMP (NGINX) |
|---|---|---|
| Connection handling | Processes or threads (event MPM narrows the gap) | Event-driven, a few workers |
| Memory under many connections | Higher | Lower |
| .htaccess support | Yes | No: rules go in the server block |
| Static files | Good | Very efficient |
| Built-in page cache | mod_cache (less common) | FastCGI cache |
| Best for | Software that relies on .htaccess | Busy sites and modern frameworks |
| Explore LAMP (Apache) | See Plans |
Your First LEMP Site After Handover
Deploy over SSH into the server block we set up, then reload NGINX and PHP-FPM.
-
Upload your code
Clone your repository into the document root.
-
Install dependencies
For Composer-based apps, install production dependencies.
-
Check the server block
Test the NGINX configuration before applying it.
-
Reload services
Apply the config and clear OPcache by reloading PHP-FPM.
# 1. Upload your code
cd /var/www/example.com
git clone [email protected]:you/app.git .
# 2. Install dependencies
composer install --no-dev --optimize-autoloader
# 3. Check the server block
sudo nginx -t
# 4. Reload services
sudo systemctl reload nginx
sudo systemctl reload php8.3-fpm
Example commands; adjust names, paths and versions to your project. Deploying and maintaining your application is yours to do (or ask us for a quote).
Installed and Secured Before You Log In
The VPS is unmanaged: after handover the server is yours to run. Before that, our engineers do the first setup once, free, so you start from a hardened server with LEMP in place.
-
Choose a plan and location
Pick the resources you need and the datacentre closest to your users.
-
Tell us your LEMP setup
Versions, database and domain: at order or right after.
-
We install and secure it
Server hardened, LEMP installed and tested, HTTPS on your domain.
-
You take over with root
SSH access to a working server, ready for your code and data.
Your LEMP stack
- NGINX with HTTP/2 and gzip compression
- PHP-FPM with OPcache and common extensions
- MySQL or MariaDB, secured, with a database and user for your app
- A server block for your domain with HTTPS
- Redis or phpMyAdmin on request
Yours to run after handover
- Ongoing server administration
- Application maintenance and updates
- Debugging your code
- Migrating existing sites or data
Not included in the free setup, but we can quote for it. No control panel by default: CloudPanel, HestiaCP or Virtualmin on request at no cost; cPanel and Plesk need their own licence.
Platform Specs and Locations
The same KVM platform on every plan; only the CPU, RAM, storage and port speed change.
| Virtualisation | KVM with reserved vCores and RAM |
|---|---|
| Storage | NVMe SSD on every plan |
| Network | Dedicated IPv4 and IPv6, 500 Mbps to 3 Gbps per plan |
| Operating systems | Ubuntu 26.04, 24.04 and 22.04 LTS · Debian 13, 12 and 11 · AlmaLinux · Rocky Linux · Fedora · FreeBSD |
| Access | Full root over SSH, key-based login |
| Backups | Automatic daily backup of the previous 24 hours; snapshots and longer retention on request |
| Protection | Always-on anti-DDoS mitigation |
| Availability | 99.9% uptime SLA |
Secured before we hand it over
- Non-root sudo user created for daily work
- SSH key login, password login for root disabled
- Firewall (UFW) open only for the ports you use
- Fail2ban blocking repeated login attempts
- Automatic security updates enabled
- Free Let's Encrypt SSL on your domain
- Timezone, swap and hostname configured
Asia-Pacific
- Mumbai
- Singapore
- Sydney
Europe
- London
- Limburg
- Roubaix
- Gravelines
- Strasbourg
- Milan
- Warsaw
North America
- Beauharnois
Availability per location changes with demand; we confirm your location before setup. In Mumbai, Singapore and Sydney each plan includes a monthly traffic allowance (VPS-1 500 GB, VPS-2 and VPS-3 1 TB, VPS-4 3 TB); beyond it, speed is limited to 10 Mbps until the next month.
Who a LEMP VPS Suits
-
Busy PHP sites
Stores and content sites whose traffic peaks have outgrown shared hosting.
-
Developers who know NGINX
Comfortable editing server blocks and FPM pool files over SSH.
-
Agencies
Many client sites on one server, isolated by PHP-FPM pool and user.
Security and Performance on a LEMP Server
Security
- Only pass real files to PHP: try_files $uri =404 in the PHP location block.
- Deny access to hidden files and folders such as .git and .env.
- Run each site's PHP-FPM pool as its own user.
- Hide version numbers with server_tokens off and expose_php = Off.
Performance
- Set worker_processes auto so NGINX uses every vCore.
- Enable OPcache and size pm.max_children to the RAM left after the database.
- Use FastCGI cache for anonymous traffic on content sites.
- Give static assets long expiry headers and enable gzip.
Questions Before You Deploy
Not covered here? Ask an engineer before you order.
Get a LEMP Server Ready for Traffic
Choose a plan and tell us your PHP version and database. We hand over NGINX, PHP-FPM and MySQL installed and secured.