This site contains affiliate links. If you purchase through them I may earn a commission at no extra cost to you. Full disclosure.

How Much RAM for Self-Hosting on a VPS

The short answer: 2 GB is the practical minimum for a self-hosted stack with more than one service. 4 GB gives you comfortable headroom for a database, an app, a reverse proxy, and Docker. Below 2 GB you will be juggling swap and crossing your fingers.

"RAM is the single bottleneck that decides whether your self-hosted setup feels snappy or sluggish. CPU matters for builds; RAM decides how many things you can run at once."

Real-world RAM usage by service

Marketing pages list system requirements in a vacuum. Here is what these services actually consume on a small VPS after they have been running for a few hours:

ServiceIdle RAMUnder LoadNotes
Ubuntu / Debian base80–150 MB150–200 MBIncludes SSH, cron, syslog
Nginx (reverse proxy)10–30 MB30–80 MBScales with worker connections
Caddy20–50 MB50–100 MBSlightly heavier than Nginx, auto-TLS included
Node.js app (small)80–200 MB200–500 MBDepends heavily on app complexity
PostgreSQL80–150 MB200–400 MBShared_buffers defaults to ~128 MB
SQLite5–20 MB20–80 MBGreat for single-app setups
Redis10–30 MB30–100 MBScales with dataset size
Docker daemon30–50 MB50–100 MBOverhead per container is small
OpenClaw150–300 MB300–600 MBNode-based; depends on active agents

The math: stack your services

Add up the idle numbers for everything you plan to run simultaneously, then add 200–400 MB for OS overhead and buffers. That is your realistic minimum.

Example 1 — Minimal blog stack

OS base:          120 MB
Nginx:             25 MB
Node.js app:      150 MB
SQLite:            15 MB
─────────────────────────
Total idle:       310 MB
+ headroom:       200 MB
─────────────────────────
Comfortable at:   512 MB (tight) → 1 GB (safe)

Example 2 — Full self-hosted stack

OS base:          150 MB
Caddy:             40 MB
Node.js app:      250 MB
PostgreSQL:       150 MB
Redis:             30 MB
Docker overhead:   50 MB
OpenClaw:         250 MB
─────────────────────────
Total idle:       920 MB
+ headroom:       400 MB
─────────────────────────
Comfortable at: 1.3 GB → 2 GB (safe) → 4 GB (room to grow)

Example 3 — Docker-heavy multi-app

OS base:          150 MB
Traefik:           60 MB
App 1 (Node):     300 MB
App 2 (Python):   200 MB
PostgreSQL:       250 MB
Redis:             50 MB
Docker overhead:  100 MB
Monitoring:       100 MB
─────────────────────────
Total idle:     1,210 MB
+ headroom:       500 MB
─────────────────────────
Comfortable at: 1.7 GB → 4 GB (safe)

Swap: your emergency brake

Swap is disk space that the OS uses when RAM fills up. It prevents OOM kills but makes everything slower — reading from disk is roughly 100x slower than reading from RAM.

Always set up a swap file on a small VPS. It costs nothing and can save you from a midnight outage:

# Create a 2 GB swap file
sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile

# Make it permanent
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab

# Verify
free -h

Tune swappiness so the kernel prefers real RAM and only touches swap under pressure:

# Lower = prefer RAM, higher = more aggressive swapping
sudo sysctl vm.swappiness=10
echo 'vm.swappiness=10' | sudo tee -a /etc/sysctl.d/99-swappiness.conf

A swappiness of 10 means the kernel will keep using RAM until it is nearly full, then swap as a last resort. The default of 60 is too aggressive for VPS workloads.

How to check if you are running out of RAM

Do not guess — measure. These commands tell you exactly where you stand:

# Quick snapshot
free -h

# Live monitoring (press q to quit)
htop

# Check for OOM kills (these mean you ran out of RAM)
dmesg | grep -i "out of memory" | tail -5

# Per-process RAM usage, sorted by highest
ps aux --sort=-%mem | head -15

# Swap usage detail
swapon --show

Watch for these red flags:

When to upgrade vs. optimize

Before throwing money at a bigger plan, check whether your setup is wasting RAM:

Optimize first

Upgrade when

Starting fresh? The Hostinger KVM 1 plan (1 vCPU / 4 GB RAM) is enough for most beginner self-hosting setups. If you know you will run Docker with multiple services, jump straight to KVM 2 (2 vCPU / 8 GB RAM) — the price difference is small compared to the hassle of migrating later.

RAM cheat sheet by use case

Use CaseMinimumRecommended
Static site or single lightweight app512 MB1 GB
WordPress or small CMS + DB1 GB2 GB
App + database + reverse proxy1.5 GB2–4 GB
Docker with 2–4 containers2 GB4 GB
Full self-hosted stack (5+ services)4 GB8 GB
CI/CD or build server4 GB8 GB+

The honest rule

Buy more RAM than you think you need — then use swap as your safety valve. RAM is cheap compared to the time you spend debugging OOM kills at midnight. A 4 GB VPS costs a few dollars more per month than a 2 GB one, and it saves you from the "just one more container" cliff that catches every self-hoster eventually.

If you are not sure where to start, read our guide on VPS sizing for self-hosting or check what to check before upgrading a VPS plan — sometimes the answer is optimize, not upgrade.

Is 1 GB RAM enough for self-hosting?
Yes, for lightweight services. A single Node.js app, a static site, or a small database fits comfortably in 1 GB. The moment you stack two or three services, you will feel the squeeze — and swap will become your lifeline.
How much RAM does a typical self-hosted stack use?
A reverse proxy (Nginx/Caddy) uses 20–50 MB, a Node.js app 100–400 MB, PostgreSQL 100–300 MB, Redis 30–100 MB, and Docker overhead 100–200 MB. A small full stack (app + DB + reverse proxy) typically settles around 600 MB to 1.2 GB.
Can I use swap instead of upgrading RAM?
Swap works as an emergency buffer, not a replacement for real RAM. It keeps your services alive during spikes, but relying on swap full-time makes everything noticeably slower because disk is 100x slower than RAM. Use it as a safety net, not a strategy.
When should I upgrade my VPS RAM?
Upgrade when you see these signs: OOM kills in dmesg, swap usage stays above 50% during normal operation, services respond slowly under moderate load, or you need to add another service and have no headroom. A good rule of thumb: if less than 20% of RAM is free during peak usage, it is time to grow.
Does Docker use more RAM than bare-metal installs?
Docker itself adds only about 30–50 MB of overhead. The real difference comes from running full container images versus minimal binaries. In practice, a well-configured Docker stack uses similar RAM to bare-metal, but gives you isolation and easy rollbacks in return.
What Hostinger VPS plan should I pick for self-hosting?
Start with KVM 1 (1 vCPU / 4 GB RAM) for one or two lightweight services. Move to KVM 2 (2 vCPU / 8 GB RAM) if you plan to run a full stack with Docker. The extra RAM headroom means fewer surprises as your setup grows.