nodevstack

How to self-host n8n on DigitalOcean

DigitalOcean is the beginner-friendly way to self-host n8n: it has a real 1-click Marketplace image and the best documentation in the business. It costs more than a bargain VPS, but you get a running, HTTPS-secured n8n in minutes and a stack of managed extras. Here's the how-to — plus an honest note on when Contabo is the smarter buy.

Prices checked Aug 2026 — DigitalOcean adjusted pricing in Jan 2026, so confirm on their live page before you order.

Pick your Droplet size first

This is where people go wrong. DigitalOcean's cheapest Droplets are smaller than they look:

DropletRAMFor n8n
$4/mo512 MBToo small — won't run reliably
$6/mo1 GBSQLite testing only; swaps under load
$12/mo2 GBDocumented minimum, light use
$24/mo4 GB / 2 vCPURealistic production pick

Create a DigitalOcean Droplet →

Path A — the 1-click Marketplace image (easiest)

DigitalOcean's Marketplace has a real n8n image: Ubuntu with Docker, Docker Compose and Caddy (Caddy issues and renews the Let's Encrypt certificate for you). It installs to /opt/n8n-docker-caddy.

  1. 1. Create a Droplet → the Marketplace tab → choose n8n (pick a 2–4 GB size).
  2. 2. Add an A record for n8n.example.com pointing at the Droplet's IP (DigitalOcean's DNS is free, or use your registrar).
  3. 3. SSH in, run the guided console setup, and put your domain in the Caddyfile:
n8n.example.com {
    reverse_proxy n8n:5678 {
        flush_interval -1
    }
}
  1. 4. docker compose up -d from the install folder, wait for Caddy to get the certificate, then open https://n8n.example.com.

Path B — a plain Droplet + Docker (more control)

Prefer to own the stack? Create a plain Ubuntu Droplet, install Docker and Compose yourself, and run n8n with PostgreSQL behind Caddy or nginx. Set these environment variables — they're the difference between a working instance and one whose webhooks and OAuth logins are broken:

- N8N_WEBHOOK_URL=https://n8n.example.com/
- N8N_PROXY_HOPS=1
- N8N_ENCRYPTION_KEY=a-long-random-string-you-keep-safe
- DB_TYPE=postgresdb

Want managed Postgres instead of running your own container? DigitalOcean's Managed PostgreSQL starts around $15/mo with automated backups and point-in-time recovery — optional, but it removes one thing to babysit.

The n8n gotchas (same on any host)

Set the public webhook URL

Behind a proxy, set N8N_WEBHOOK_URL to your full https:// domain (it replaces the deprecated WEBHOOK_URL) and N8N_PROXY_HOPS=1. Don't rely on N8N_HOST/PORT to build the URL — n8n runs on 5678 internally while Caddy serves 443, so auto-construction is wrong.

HTTPS is mandatory for OAuth

Google and other providers reject non-HTTPS callback URLs — the domain + TLS step isn't optional the moment you add an OAuth credential.

Persist your volumes (and the encryption key)

The n8n_data volume holds the encryption key that decrypts your credentials. Lose it and a restored database can't read them. Back it up — see our n8n backup guide.

What the DigitalOcean premium actually buys

For the same 4 vCPU / 8 GB, Contabo runs about $7–8/mo versus roughly $48/mo on DigitalOcean — a big gap, and the reason Contabo is the specs-per-dollar winner. What the extra money buys on DO is the ecosystem, not the metal: a real 1-click image, first-party step-by-step docs, one-click Managed Postgres, on-demand snapshots and automated backups, reserved IPs to re-point at a rebuilt Droplet, and free monitoring and alerts. DigitalOcean gives you fewer things to build and maintain yourself; Contabo gives you more server. For a beginner who wants n8n live in minutes with managed HTTPS and a database they never touch, DO earns its premium — see DigitalOcean vs Contabo for the full head-to-head, or our Contabo n8n guide for the cheaper route.

Frequently asked

Is there a 1-click n8n install on DigitalOcean?

Yes. DigitalOcean's Marketplace has a genuine n8n 1-Click Droplet image — a pre-built server with Docker, Docker Compose and Caddy (which auto-provisions Let's Encrypt HTTPS). You pick it when creating a Droplet, and after a couple of minutes you SSH in, point a domain at the Droplet, add it to the Caddyfile, and bring n8n up.

What size Droplet do I need for n8n?

The $4 (512 MB) and $6 (1 GB) Droplets are too small — n8n idles around 300–500 MB and spikes to 1–2 GB during workflows, and Postgres wants its own memory. The $12/mo 2 GB Droplet is the documented minimum for light use; the $24/mo 4 GB / 2 vCPU Droplet is the realistic production pick and what DigitalOcean's own n8n docs use.

Can I run n8n on DigitalOcean App Platform?

Technically yes, but it's a poor fit. App Platform containers are ephemeral and the cheap tiers sleep between uses, while n8n needs persistent state and to be always-on. You'd need a paid plan plus external managed Postgres just to make it reliable. A Droplet is the better and cheaper home for a stateful automation server.

DigitalOcean or Contabo for n8n?

Contabo gives far more RAM per dollar (its ~$7–8/mo VPS matches a ~$48/mo DigitalOcean config), so it wins on specs-per-dollar. DigitalOcean's premium buys the ecosystem: a true 1-click image, first-party docs, one-click managed Postgres, snapshots and backups, reserved IPs and free monitoring. Pick DO if you want it running in minutes with managed extras; pick Contabo for maximum server per dollar.

Related

Create a DigitalOcean Droplet →Prefer managed? Try n8n Cloud →

Some links here are affiliate links — we earn a commission on DigitalOcean and n8n, at no extra cost to you. See our Affiliate Disclosure.