Development

Best VPS for PHP in 2026: PHP-FPM, Nginx, Apache, MySQL and RAM Sizing

How to choose a VPS for PHP applications based on PHP-FPM workers, RAM, CPU, Nginx or Apache, databases, caching, and deployment needs.

PHP can run efficiently on modest VPS hardware, but production sizing depends on the complete stack around it. PHP-FPM workers, Nginx or Apache, MySQL or PostgreSQL, Redis, scheduled jobs, queues, and deployment tooling all share the same CPU and memory unless they are separated across servers.

The best VPS for PHP is therefore not the plan with the most vCPUs on a marketing page. It is the smallest configuration that can handle the application's real concurrency while leaving enough headroom for the database, cache, background work, and safe deployments.

Key takeaways

  • 2 GB RAM is a practical starting point for many small PHP applications.
  • 4 GB is more comfortable when the VPS also hosts MySQL, Redis, queues, or multiple sites.
  • PHP-FPM worker count should be sized to memory and real request concurrency.
  • Nginx and Apache can both work well; application behavior matters more than the web-server brand.
  • Use opcode caching, database indexing, and application profiling before buying larger hardware.

How much RAM does a PHP VPS need?

A small PHP application can run on 1 GB, but 2 GB gives a much safer production margin for the operating system, PHP-FPM, a web server, logs, and a modest database. Four gigabytes is a better target when several sites, Redis, queue workers, or heavier frameworks share the machine.

The important variable is memory per PHP worker. If each worker consumes a large amount of RAM, blindly increasing the worker pool can force the server into swap or trigger out-of-memory kills.

PHP-FPM workers and CPU

Dynamic PHP requests consume CPU and occupy workers until the request completes. A server with too few workers can queue requests, while a server with too many can exhaust memory. Measure peak concurrency and average memory per worker before tuning the pool.

Shared CPU is enough for many PHP sites because traffic is bursty. Dedicated CPU becomes useful when dynamic request volume is sustained or response consistency directly affects revenue.

Database, Redis and caching

Most PHP applications depend heavily on MySQL, MariaDB, or PostgreSQL. Poor queries can make a large VPS feel slow, so indexing and query profiling should happen before vertical scaling.

Opcode caching and application caches reduce repeated work. Redis can help sessions, object caching, and queues, but it should have explicit memory limits so it does not compete uncontrollably with PHP and the database.

Nginx, Apache and deployment

Nginx and Apache are both capable production web servers. Nginx is commonly paired with PHP-FPM, while Apache remains familiar in environments that rely on .htaccess or existing configurations. The best choice is the one the team can operate reliably.

Production deployments should include process restarts, health checks, logs, backups, and rollback. Leave enough CPU and RAM headroom for Composer installs, cache warmups, asset builds, and database migrations.

Frequently asked questions

Is 2 GB RAM enough for PHP?

Yes for many small production PHP applications, especially when the database and worker counts are tuned conservatively.

Is Nginx faster than Apache for PHP?

Both can perform well. Application code, PHP-FPM tuning, caching, database queries, and server resources usually matter more than the web-server choice alone.

Does PHP need Redis?

No, but Redis is useful for caching, sessions, queues, and reducing repeated database work in some applications.

When should PHP use dedicated CPU?

When sustained dynamic traffic or application processing makes CPU saturation a measured bottleneck.

Continue your research

VPSProof focuses on practical buying decisions rather than provider scorecards. When a price or product detail materially changes the recommendation, we update the guide and link to the relevant official source.