← Back to the blog

Fitting a complete portfolio into 512 MB of RAM

The budget

A 512 MB droplet is not a small server: it is a full server before you deploy anything.

Component RAM
Ubuntu 24.04 ~130 MB
Docker daemon ~70 MB
Gunicorn + Django ~150 MB
Nginx ~15 MB
Total ~365 MB

That leaves roughly 145 MB of headroom. Everything below follows from it.

Rule 1: the server does not compile

An Astro build peaks at 400—800 MB. Running it here means ten minutes of swap thrashing or an outright OOM kill.

# This is all the server ever runs:
docker compose pull && docker compose up -d

Rule 2: no Redis, no Postgres, no Node

Each costs 40—120 MB. Instead: in-process cache, SQLite in WAL mode and static HTML served by Nginx.

Rule 3: rotate Docker logs

The most common cause of failure on small droplets is not RAM — it is a disk filled with JSON logs nobody configured to rotate.

  • #DigitalOcean
  • #Docker
  • #Optimisation