CLOUD COST • CLUSTER B

Hetzner vs DigitalOcean vs AWS for n8n Docker

Self-hosting n8n on Docker? We price Hetzner CPX, DigitalOcean Droplets, and AWS EC2 at 2026 rates for the same 4 GB RAM tier n8n recommends, and show…

By Alex, Principal AI Infrastructure Architect | Updated September 2026 | 14 min read

If you run n8n on Docker and pay for it yourself, Hetzner's CPX line wins on price-performance by a wide margin — the CPX21 (3 vCPU / 4 GB / 80 GB NVMe / 20 TB traffic) is €11.99/mo (about $12.95) in September 2026, versus $24 on DigitalOcean and $36.77+ on AWS for the same 4 GB RAM n8n recommends for production. AWS only makes sense when you are already locked into its ecosystem; its on-demand price is the tip of the iceberg — EBS storage and especially data egress are where a self-hosted n8n bill quietly triples. DigitalOcean is the safe middle ground with the best docs, but you pay roughly 1.8× Hetzner for the same RAM.

TL;DR
  • For most self-hosted n8n, Hetzner CPX21 (€11.99/mo, ~$12.95) is the default pick: 3 vCPU, 4 GB RAM, 20 TB traffic included, NVMe.
  • DigitalOcean 2 vCPU / 4 GB is $24/mo — clean, well-documented, 4 TB included, but ~1.8× the price per GB of RAM.
  • AWS t3.medium (2 vCPU / 4 GB) lists at $30.37/mo compute, but add ~$6.40 gp3 EBS and egress: push 1 TB/mo out and the bill jumps ~$81 more. That is the trap.
  • n8n's own recommended production floor is 2 vCPU / 4 GB RAM; queue mode needs Redis + Postgres on top, so size for those.
  • At 4 GB RAM, self-hosting on Hetzner beats n8n Cloud Pro ($50/mo) above roughly 2,600 executions/month. Use the calculator below to find your break-even.

Why the host you pick decides your margin

n8n Cloud is the easy start, but it meters executions: Starter is $20/mo for 2,500 executions and Pro is $50/mo for 10,000 (list prices at publication; verify before you size). The moment you run real integrations, execution counts climb and the SaaS bill becomes a line item you cannot shrink. Self-hosting flips that: you pay a fixed VPS price and executions are unlimited.

The catch is that "a VPS" is not one number. The same 4 GB RAM n8n wants comes at three very different prices depending on the provider, and two of those prices hide costs that only show up on the second month's invoice. This article prices the three providers at 2026 rates for the exact specs n8n runs on, and shows where the hidden costs live.

If you are weighing self-host against serverless generally, our production TCO breakdown of serverless vs VPS covers the wider trade-off.

What n8n actually needs to run

n8n publishes no single hard minimum, but its own guidance and the Kubernetes sample manifest point at a clear production floor:

Workload vCPU RAM Storage Notes
Light / trial 1 2 GB 10–20 GB Runs, but no headroom
Production (recommended) 2+ 4 GB 20–40 GB SSD n8n calls out 2 vCPU / 4 GB for dependable concurrent execution
Queue mode + Postgres 2+ 4–8 GB 40 GB+ SSD Add Redis + Postgres containers
AI Agent heavy 4+ 8 GB 50 GB+ Each tool call holds context in memory for the run

Two gotchas bite small boxes and look like n8n bugs:

Queue mode (the setup most teams want for reliable webhook ingestion) adds a Postgres database and a Redis broker. That is three containers, not one — and it changes how you size the box. Our queue-mode Docker Compose guide walks the exact wiring.

The three contenders at a glance

Hetzner CPX DigitalOcean Droplet AWS EC2 t3
CPU type Shared AMD EPYC Shared (Intel/AMD) Burstable (Intel/AMD)
Default bandwidth 20 TB 3–5 TB 100 GB free, then $0.09/GB
Block storage NVMe included SSD included EBS gp3, $0.08/GB-mo
IPv4 +€0.60/mo (IPv6 free) included +$0.005/hr idle Elastic IP
Billing monthly / hourly per-second (since Jan 2026) per-second
Best fit Cost-first self-host Polished DX, middle ground Already-on-AWS shops

The single biggest structural difference is bandwidth. Hetzner and DigitalOcean bundle terabytes; AWS charges per gigabyte beyond 100 GB. A n8n instance that returns webhook payloads or proxies API responses to clients can move a lot of bytes — and on AWS every one of them is metered.

2026 pricing, head to head

All figures are list prices at publication (September 2026). Hetzner prices reflect the 15 June 2026 adjustment; USD is converted from EUR at ~1.08. AWS compute is us-east-1 Linux on-demand at 730 h/mo; EBS gp3 at $0.08/GB-mo and egress at $0.09/GB are added where shown.

RAM tierHetzner CPXDigitalOcean (Basic)AWS EC2 t3 (+EBS, +egress)
2 GB
2 vCPU
CPX11: 2 vCPU / 2 GB / 40 GB NVMe / 20 TB
€5.99/mo (~$6.47)
2 vCPU / 2 GB / 60 GB SSD / 3 TB
$18/mo
t3.small: 2 vCPU / 2 GB
$15.18 + $3.20 (40 GB gp3) = $18.38 + egress
4 GB (n8n prod floor)
2–3 vCPU
CPX21: 3 vCPU / 4 GB / 80 GB NVMe / 20 TB
€11.99/mo (~$12.95)
2 vCPU / 4 GB / 80 GB SSD / 4 TB
$24/mo
t3.medium: 2 vCPU / 4 GB
$30.37 + $6.40 (80 GB gp3) = $36.77 + egress
8 GB
4 vCPU
CPX31: 4 vCPU / 8 GB / 160 GB NVMe / 20 TB
€20.99/mo (~$22.67)
4 vCPU / 8 GB / 160 GB SSD / 5 TB
$48/mo
t3.large: 2 vCPU / 8 GB
$60.74 + $12.80 (160 GB gp3) = $73.54 + egress

Hetzner's EU shared CPX line carries 20 TB traffic on every tier and is the price leader by a wide margin. AWS t3 numbers are compute-only until you add storage and egress; at the 8 GB tier the raw compute already costs 2.7× the Hetzner equivalent before a single gigabyte leaves the instance.

Price-performance: what you pay per GB of RAM

Divide the effective monthly price by RAM and the ranking is brutal:

At the 8 GB tier the gap widens further because AWS charges per vCPU-heavy t3.large while Hetzner's CPX31 gives you 4 vCPU for less than AWS asks for 2. If your only lens is "$ per GB RAM," Hetzner wins every tier. The honest caveat: you trade Hetzner's cheaper price for a stricter signup verification and EU-default data residency, which is a feature for GDPR work and a friction point for some.

The hidden bill AWS buries

AWS on-demand looks competitive until you add the line items that are not in the instance-hour number:

EBS storage

An EC2 instance has no disk. A usable 80 GB system volume on gp3 is ~$6.40/mo and a 160 GB one ~$12.80. Multiply across main + worker + a Postgres data volume and storage can exceed the instance.

Data egress

100 GB/month is free; after that it is $0.09/GB. A n8n box returning 1 TB/mo of webhook or API responses pays ~$81 extra — more than the instance itself. Hetzner and DO bundle this in.

Idle Elastic IPs

An Elastic IP attached to a stopped instance is billed ~$0.005/hr (~$3.60/mo). Forgetting one test box after a teardown is a classic "why is my bill $40" moment.

Per-second, per-service

Egress, EBS, and IPs bill under different line items than EC2-Instances, so the instance-hour number undersells true spend by 30–40% if you only watch the compute row.

If you already run on AWS, reserved instances or Savings Plans cut the compute rate 37–60%, but they do nothing for egress — the part that actually blows up a chatty n8n deployment.

Docker Compose for n8n on a single VPS

This is a queue-mode stack: Postgres for execution data, Redis as the Bull broker, one n8n main process and one worker. The shared env block is an x- extension (never a bare top-level key — that fails Compose validation). Set a real N8N_ENCRYPTION_KEY before first run.

x-n8n-env: &n8n-env
  DB_TYPE: postgresdb
  DB_POSTGRESDB_HOST: postgres
  DB_POSTGRESDB_PORT: 5432
  DB_POSTGRESDB_DATABASE: n8n
  DB_POSTGRESDB_USER: n8n
  DB_POSTGRESDB_PASSWORD: ${N8N_DB_PASSWORD}
  EXECUTIONS_MODE: queue
  QUEUE_BULL_REDIS_HOST: redis
  QUEUE_BULL_REDIS_PORT: 6379
  N8N_DEFAULT_BINARY_DATA_MODE: filesystem
  N8N_ENCRYPTION_KEY: ${N8N_ENCRYPTION_KEY}
  WEBHOOK_URL: ${N8N_WEBHOOK_URL}
  NODE_OPTIONS: --max-old-space-size=2048

services:
  postgres:
    image: postgres:16
    environment:
      POSTGRES_USER: n8n
      POSTGRES_PASSWORD: ${N8N_DB_PASSWORD}
      POSTGRES_DB: n8n
    volumes:
      - postgres-data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U n8n"]
      interval: 10s
      timeout: 5s
      retries: 5

  redis:
    image: redis:7-alpine
    command: ["redis-server", "--appendonly", "yes"]
    volumes:
      - redis-data:/data

  n8n:
    image: n8nio/n8n:latest
    <<: *n8n-env
    ports:
      - "5678:5678"
    volumes:
      - n8n-files:/home/node/.n8n
    depends_on:
      postgres:
        condition: service_healthy
      redis:
        condition: service_started

  n8n-worker:
    image: n8nio/n8n:latest
    <<: *n8n-env
    command: ["n8n", "worker"]
    volumes:
      - n8n-files:/home/node/.n8n
    depends_on:
      postgres:
        condition: service_healthy
      redis:
        condition: service_started

volumes:
  postgres-data:
  redis-data:
  n8n-files:

Validate it with docker compose config before deploying — a bare top-level environment: outside a service is the classic mistake that fails strict validation. Pin the image tag (here latest is shown for brevity; pin a specific version in production) and put secrets in a .env file, not the compose.

Running queue mode on one box

Queue mode splits work: the main process serves the UI and webhooks and enqueues jobs; workers pull jobs from Redis and execute them. Benefits for self-hosted n8n:

The cost is three containers and the RAM to run them. On a 4 GB box, give Postgres ~512 MB, Redis ~256 MB, and the rest to n8n — tight but workable for moderate load. At 8 GB you have real headroom. Our Postgres vs SQLite queue-mode benchmark shows why Postgres wins once concurrency climbs, and n8n vs Temporal vs Windmill covers when a full orchestrator is worth it.

Interactive self-hosted n8n cost calculator

Plug in your real plan numbers (or the Hetzner/AWS presets) and see effective monthly cost, price per GB of RAM, and the execution volume where self-hosting beats n8n Cloud.

Effective monthly cost: $12.95/mo
Price per GB RAM: $3.24 / GB
Beats n8n Cloud Pro ($50/10k) above: 2,590 exec/mo
Beats n8n Cloud Starter ($20/2.5k) above: 1,619 exec/mo

When to pick which provider

Failure modes and pitfalls

Under-sized RAM

2 GB runs n8n but file-heavy or AI-agent workflows OOM. Start at 4 GB; cap the Node heap so a runaway run cannot take the box.

Binary-in-memory crash

Without N8N_DEFAULT_BINARY_DATA_MODE=filesystem, large payloads sit in RAM and crash the process. Set it on every self-host.

AWS egress shock

A webhook-heavy n8n on t3 can owe more in egress than compute. Model your monthly outbound bytes before you commit.

Single point of failure

One VPS means one downtime event. Queue mode helps with crashes, not with the host dying. Snapshots (DO) or backups (Hetzner/DO) are not optional.

FAQ

Deploy this stack in production

Every config, default, and failure mode in this guide comes from live deployment, not documentation. Our Make.com playbook covers the orchestration patterns end to end.

Get the Make.com Automation Playbook →

Download this guide’s assets

Get the configuration and data files referenced in this guide. Subscribe and we’ll send the bundle to your inbox.

Get the bundle →
Is Hetzner really that much cheaper, or is the comparison unfair?

The comparison uses the same RAM tier n8n recommends (4 GB) and the same region posture (list prices, no committed-use discounts). Hetzner's edge comes from 20 TB bundled traffic and cheaper NVMe — both real, not a trick. AWS closes some of the gap with 1- or 3-year Savings Plans on compute, but egress stays metered, so a chatty n8n still costs more.

Can I run n8n queue mode on the smallest plan?

Technically yes on a 2 GB box, but queue mode adds Postgres + Redis, and you will be memory-constrained under load. We recommend 4 GB minimum for queue mode and 8 GB once you pass a few hundred concurrent executions. See the queue-mode compose guide for the wiring.

Why not just use n8n Cloud and skip the VPS?

If you run under ~2,000 executions/month and hate ops, Cloud is simpler and the SaaS fee is small. Above that, a $12.95 Hetzner box is unlimited and cheaper. The calculator above finds your exact break-even. Cloud also cannot run the AI Assistant sandbox or custom queue tuning the way self-host can.

Does AWS t3 burst capacity matter for n8n?

t3 instances are burstable: they earn CPU credits and can throttle under sustained load. n8n under steady webhook traffic can exhaust credits and slow down. If you go AWS, either pick a larger t3 or use T3 Unlimited mode (you pay for overage) — or step up to m-family general-purpose for predictable performance.

Engineering transparency: Hetzner prices reflect the vendor's 15 June 2026 adjustment (EU shared CPX line, EUR converted to USD at ~1.08, IPv4 surcharge excluded since IPv6 is default). DigitalOcean prices are Basic shared-CPU list rates effective 2026 (per-second billing since 1 January 2026). AWS figures are us-east-1 Linux on-demand at 730 h/month; EBS gp3 is taken at $0.08/GB-month and egress at $0.09/GB beyond the 100 GB free tier, both documented AWS list rates. n8n Cloud Starter ($20 / 2,500 exec) and Pro ($50 / 10,000 exec) are list prices at publication and should be re-checked. The cost calculator applies those documented rates with simple division — no live benchmark was run; the break-even points are arithmetic on the listed prices, not measured throughput.

Related Cluster Intelligence