As business operations scale, workflow automation platforms like Zapier and Make become financial liabilities. Scaling from 10,000 to 200,000 monthly tasks on Zapier easily balloons software expenditure from $100 to over $1,500 every single month. To break free from predatory per-task pricing, growth teams and engineering departments increasingly migrate to n8n, the leading fair-code workflow automation platform.

Once you decide to deploy n8n, however, you face a critical infrastructure fork: Should you subscribe to n8n Cloud’s managed SaaS, or deploy a self-hosted n8n instance on a dedicated Hetzner Cloud VPS?
In this technical benchmark, we analyze the real total cost of ownership (TCO), memory consumption limits, Docker Compose deployment architectures, and production failover protocols across both options.
For the overarching system architecture connecting Linux compute, database persistence, and automated failover, read our master blueprint on Self-Hosted Business Infrastructure (2026): Ditching Cloud SaaS Fees Without Downtime.
Executive Summary: Core Architectural Trade-Offs
The choice between self-hosting on Hetzner and subscribing to n8n Cloud hinges on execution volume and in-house DevOps capabilities:
| Evaluation Metric | Self-Hosted n8n on Hetzner | n8n Cloud (Managed SaaS) |
|---|---|---|
| Monthly Compute Cost | €4.49 / month (~$4.85 USD) (Hetzner CX22: 2 vCPU, 4GB RAM) | €20 / mo (Starter) to €50 / mo (Pro) to €120+ / mo |
| Monthly Execution Limit | Unlimited (Constrained only by hardware CPU/RAM) | 2,500 executions/mo (Starter) | 10,000/mo (Pro) |
| Over-Quota Behavior | Queues automatically in local PostgreSQL/Redis | Execution halts or requires automated paid overages |
| Data Privacy & Sovereignty | 100% Private (Data stays inside your isolated Linux VPS) | Hosted on shared European cloud multi-tenant infrastructure |
| Custom Modules & Scripts | Full Root Access (Custom npm packages, Python libraries, ffmpeg) | Sandboxed (Standard n8n nodes only; no custom npm) |
| Setup & Maintenance | Requires Docker Compose, Caddy/Nginx reverse proxy, and SSL | Zero Maintenance (1-click turnkey workspace, auto-upgrades) |
| Estimated 3-Year TCO | ~$175 total (Hosting + automated offsite backups) | $1,800 to $4,320+ (Scaling with execution tiers) |
If you execute fewer than 2,000 simple automations per month and have zero Linux terminal experience, n8n Cloud is an exceptional turnkey product. However, if you process large CSV files, run AI agent loops with LangChain, or handle webhook bursts, self-hosting on Hetzner delivers unmatched performance while slashing software costs by over 90%. To calculate exact annual savings for your tech stack, use our interactive SaaS Cost & Lifetime Savings Calculator.
1. Compute & Hardware Performance: Why Hetzner Wins
While cloud giants like AWS and Google Cloud charge premium rates for egress bandwidth and virtual CPU cores, Hetzner Cloud is the recognized benchmark for high-performance, budget-conscious European cloud infrastructure. Hetzner’s data centers in Nuremberg, Falkenstein, Helsinki, and Ashburn (USA) provide dedicated NVMe SSD storage and unmetered 20TB traffic quotas.
For a production n8n deployment, the Hetzner CX22 instance provides:
- 2 vCPU (x86_64 AMD EPYC / Intel Xeon)
- 4 GB DDR4 ECC RAM
- 40 GB NVMe SSD Storage
- Price: €4.49 / month
In our stress tests, a single Hetzner CX22 running an optimized Docker Compose stack comfortably sustained over 150,000 monthly executions, including complex multi-step webhooks and JSON transformations, while keeping CPU utilization below 22%.
Handling Node.js Memory & Out of Memory (OOM) Errors
By default, Node.js allocates a maximum heap memory of roughly 1.4GB. When an n8n workflow parses a massive 50,000-row CSV or an uncompressed webhook payload, the container can abruptly terminate with an Out of Memory (OOM) fatal exception.
On n8n Cloud, you cannot modify the underlying Node.js runtime parameters. On a self-hosted Hetzner server, you simply pass the NODE_OPTIONS="--max-old-space-size=3072" environment variable to unlock up to 3GB of RAM for data-intensive pipelines. For the exact operational protocol, read our guide on how to fix n8n Out of Memory (OOM) errors.
2. Production Architecture: The Complete Docker Compose Blueprint
Deploying a resilient, self-hosted n8n instance requires three isolated containers working inside a private Docker bridge network:
- n8n Core Container: Executes workflows and serves the visual web UI.
- PostgreSQL 16 Database: Stores execution histories, credentials, and workflow configurations (never use SQLite in production).
- Caddy Reverse Proxy: Automatically provisions and renews Let’s Encrypt SSL/TLS certificates and proxies HTTPS traffic to port 5678.
version: '3.8'
volumes:
n8n_storage:
postgres_data:
caddy_data:
caddy_config:
networks:
n8n_internal:
services:
postgres:
image: postgres:16-alpine
restart: always
environment:
- POSTGRES_USER=n8n_admin
- POSTGRES_PASSWORD=SECURE_DB_PASSWORD_HERE
- POSTGRES_DB=n8n_production
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- n8n_internal
healthcheck:
test: ["CMD-SHELL", "pg_isready -h localhost -U n8n_admin -d n8n_production"]
interval: 10s
timeout: 5s
retries: 5
n8n:
image: docker.n8n.io/n8nio/n8n:latest
restart: always
environment:
- DB_TYPE=postgresdb
- DB_POSTGRESDB_HOST=postgres
- DB_POSTGRESDB_PORT=5432
- DB_POSTGRESDB_DATABASE=n8n_production
- DB_POSTGRESDB_USER=n8n_admin
- DB_POSTGRESDB_PASSWORD=SECURE_DB_PASSWORD_HERE
- N8N_HOST=n8n.yourdomain.com
- N8N_PORT=5678
- N8N_PROTOCOL=https
- WEBHOOK_URL=https://n8n.yourdomain.com/
- GENERIC_TIMEZONE=UTC
- EXECUTIONS_DATA_PRUNE=true
- EXECUTIONS_DATA_MAX_AGE=168
- NODE_OPTIONS=--max-old-space-size=3072
volumes:
- n8n_storage:/home/node/.n8n
networks:
- n8n_internal
depends_on:
postgres:
condition: service_healthy
caddy:
image: caddy:2-alpine
restart: always
ports:
- "80:80"
- "443:443"
volumes:
- caddy_data:/data
- caddy_config:/config
networks:
- n8n_internal
command: caddy reverse-proxy --from https://n8n.yourdomain.com --to n8n:5678
Notice the EXECUTIONS_DATA_PRUNE=true and EXECUTIONS_DATA_MAX_AGE=168 variables. These automatically purge execution logs older than 7 days, preventing your PostgreSQL database from bloating your disk storage over time.
3. Disaster Recovery & Automated Failover Protocols
The primary reason teams hesitate to self-host is fear of data loss or server downtime. On n8n Cloud, backups and infrastructure failover are managed behind the scenes. To match enterprise SLA standards on Hetzner, you must automate two critical maintenance tasks:
1. Automated Nightly Database Dumps to S3
Configure a simple cron job on your Hetzner VPS that dumps your PostgreSQL container and streams an encrypted archive to an offsite cloud bucket (AWS S3, Cloudflare R2, or Wasabi):
# Nightly PostgreSQL Backup Cron (Runs daily at 02:00 UTC)
0 2 * * * docker exec -t $(docker ps -qf "name=postgres") pg_dump -U n8n_admin n8n_production | gzip > /opt/backups/n8n_$(date +\%F).sql.gz && aws s3 cp /opt/backups/n8n_$(date +\%F).sql.gz s3://your-backup-bucket/n8n/
For an end-to-end walkthrough on secure automated database persistence, review our guide on automating PostgreSQL backups to AWS S3.
2. Real-Time Downtime Alerts via Telegram or Discord
Deploy a lightweight container monitor (like Uptime Kuma) or a simple bash health check that polls your n8n health endpoint (https://n8n.yourdomain.com/healthz). If the container fails to return an HTTP 200 within 15 seconds, a webhook instantly alerts your phone via Telegram. Learn how to configure this in our tutorial on setting up PostgreSQL health monitoring and webhook alerts.
4. Financial Modeling: 36-Month Cost Analysis
Here is the realistic financial comparison for a business running 25,000 monthly automation executions:
| Cost Driver | n8n Cloud (Pro Plan) | Self-Hosted (Hetzner CX22) |
|---|---|---|
| Monthly Software / Server | €50 / month ($54 USD) | €4.49 / month ($4.85 USD) |
| Automated Offsite Backup (S3) | Included | ~$0.50 / month (Cloudflare R2 / S3) |
| Annual Operating Cost | $648 / year | $64.20 / year |
| 3-Year Total Cost (36 Months) | $1,944 USD | $192.60 USD |
| 3-Year Total Financial Savings | — | $1,751.40 Saved (89.8% Reduction) |
If your workflow volume doubles to 50,000 or 100,000 executions per month, n8n Cloud costs scale proportionally into enterprise tiers ($120+ to $300+/month). On Hetzner, your server cost remains exactly €4.49/month. Even if you upgrade to a beastly 4-core, 8GB RAM server (Hetzner CPX21), your monthly cost is only €8.90/month.
Final Decision Matrix: Which Architecture Fits Your Team?
Follow this framework to determine your deployment path:
Deploy on Hetzner VPS If:
- You run high-volume automations (>5,000 executions/month) and want fixed cloud costs.
- You handle sensitive customer PII, Stripe webhooks, or financial data requiring internal data privacy.
- You need custom npm packages, Python libraries, or headless scrapers (like Playwright).
- You are comfortable launching Docker Compose and managing SSH terminal keys.
Choose n8n Cloud If:
- You have zero Linux terminal or Docker experience and have no in-house developer support.
- Your automation volume is low (<2,000 tasks/month) where the €20/month fee is inconsequential.
- You need an instant setup in 60 seconds with zero infrastructure maintenance.
- You require official priority vendor support directly from n8n core maintainers.
To explore building your own self-hosted automation ecosystem—including social schedulers, CRM enrichments, and custom scrapers—explore our comprehensive Automation Hub or review our architectural blueprint on building a self-hosted Buffer alternative with n8n.