
"How big a VPS do I need for Laravel?" usually gets the answer "it depends", which doesn't help when you're about to pick a plan. Here is a concrete starting point for each kind of app, how to work out your own number from memory use, and which plans fit at current prices.
The short answer
| RAM | Good for | Example plans (Nov 2026) |
|---|---|---|
| 1 GB | Staging, a demo, a personal tool with a handful of users. Needs swap. | DigitalOcean $6, Hetzner CPX02 €6.49 |
| 2 GB | A small production app with its database, Redis and one queue worker on the same server, and modest traffic | DigitalOcean $12 |
| 4 GB | Most small SaaS apps and client sites. Room for a few PHP-FPM workers, MySQL with a proper buffer pool, Redis, several queue workers and the scheduler. | Hetzner CX23 €5.99, DigitalOcean $24 |
| 8 GB | Busy apps, larger databases, heavy queue jobs (PDFs, images, exports), or several apps on one server | Hetzner CX33 €8.99, DigitalOcean $48 |
For CPU, 2 vCPUs is the practical minimum for production, so a slow request or a queue job doesn't stall everything else. Disk: 40 GB is enough for most apps; logs, backups kept locally and database growth are what fill it.
If you're unsure, start at 4 GB. On most providers you can resize up later in a few minutes of downtime, and 4 GB costs little more than 2 GB at Hetzner.
Where the memory actually goes
On a typical single-server setup, RAM is shared by:
- PHP-FPM workers. Each one handles one request at a time and holds a full copy of your app in memory. This is usually the biggest consumer and the one you control.
- MySQL or PostgreSQL. MySQL's InnoDB buffer pool defaults to 128 MB; giving it more makes queries faster, but it has to come out of the total.
- Queue workers. Each
php artisan queue:workprocess is a long-running PHP process with your app loaded. - Redis, if you use it for cache, sessions or queues. Usually small, but it grows with what you put in it, so give it a
maxmemorylimit (see the Redis OOM fix). - Nginx, the operating system and small services, typically a few hundred MB together.
Work out your own number
The reliable way is to measure your app, not guess. On any server running it, under normal use:
# Average memory per PHP-FPM worker, in MB
ps -C php-fpm8.4 -o rss= | awk '{s+=$1; n++} END {printf "%d workers, avg %.0f MB\n", n, s/n/1024}'
# Memory used by MySQL, Redis and queue workers
ps -eo rss,comm,args --sort=-rss | head -15
Adjust php-fpm8.4 to your PHP version. Laravel workers often use somewhere in the range of 30 to 80 MB each, depending on packages and what the request does, but your measurement beats any rule of thumb.
Then add it up:
RAM needed ≈ (PHP-FPM workers × average worker size)
+ (queue workers × their size)
+ database + Redis + ~300 MB for the OS and Nginx
+ 20–25% headroom
For example: 10 PHP-FPM workers at 50 MB (500 MB) + 3 queue workers at 60 MB (180 MB) + MySQL at 600 MB + Redis at 100 MB + 300 MB, plus 25 percent, comes to about 2.1 GB. That app is fine on a 4 GB server and tight on 2 GB.
Set pm.max_children from the same numbers so PHP-FPM can't start more workers than the RAM can hold. Our guide to "server reached pm.max_children" walks through it.
How many requests does that handle?
A PHP-FPM worker handles one request at a time. If your average request takes 100 ms, one worker can serve about 10 requests a second, and 10 workers about 100. Most small apps see far less than that. The usual bottleneck isn't the worker count but slow database queries, which make every request take longer. Check the slow query log before buying a bigger server.
Laravel Octane keeps the app in memory between requests and can make each request much faster, but it changes how memory is used and needs care with state. We looked at whether it's worth it on a small VPS.
Always add swap
On 1 to 4 GB servers, add a swap file even if your numbers fit. It gives the kernel somewhere to put rarely used memory, and turns a sudden spike (a big import, a composer install during a deploy) into a slow minute instead of MySQL being killed by the out-of-memory killer. Our swap file guide takes two minutes. Swap is a safety net, not extra RAM: if the server uses swap constantly, it needs more memory.
Shared or dedicated vCPU?
The cheap plans above use shared vCPUs: you get a share of a physical core alongside other customers. For most Laravel apps that's fine. If your app does sustained CPU work (image processing, report generation, a busy queue) and response times vary for no visible reason, a dedicated vCPU plan helps. We explained the difference in shared vs dedicated vCPU.
Signs you've outgrown the server
free -hshows little available memory and swap in steady use.- The PHP-FPM log shows "server reached pm.max_children" regularly.
- Queue jobs back up during the day and catch up overnight.
- Load average (
uptime) stays above the number of vCPUs. - MySQL or Redis gets killed and
dmesgshows "Out of memory: Killed process".
When that happens, resizing is the quick fix. Moving the database to its own server is the next step once a single 8 GB machine is busy.
Which provider?
On price, Hetzner's CX23 (2 vCPU, 4 GB, €5.99 a month) is hard to beat, but Hetzner has restricted new cloud servers for many new customers since June 2026, so check you can order one. DigitalOcean is more expensive per GB of RAM but easy to order from. Our 2027 VPS price comparison has every plan side by side. If you'd rather not run a server at all, we compared Laravel Cloud, Railway, Render and a VPS for the same app.
FAQ
Can Laravel run on 512 MB?
The framework can, but not with MySQL on the same server under any real use. For 512 MB, use an external database and very few PHP-FPM workers, or pick 1 GB.
Do I need a separate server for the database?
Not at the start. One server is simpler and cheaper. Separate the database when it needs more memory than you can give it alongside the app, or when you need to scale the web servers independently.
Does Laravel need more RAM than WordPress?
Not necessarily. Both run on PHP-FPM, and memory per worker depends far more on what the app loads than on the framework.
Bottom line
A small production Laravel app runs comfortably on 2 vCPUs and 4 GB of RAM with its database, Redis and queue workers on the same server. Go down to 2 GB for a low-traffic app, up to 8 GB for heavy queues or several apps. Measure your PHP-FPM worker size, set pm.max_children to match, and always add swap.
Plan prices checked on 2 November 2026 from our Hetzner and DigitalOcean pricing guides; check the providers' pages before ordering.
Comments 0
Be the first to comment.
Leave a comment