DEV Community

Elder Fernandes
Elder Fernandes

Posted on • Originally published at selfhoststack-8z4.pages.dev

Stop Paying Zapier: How to Self-Host n8n on Docker for Unlimited Automations

Originally published on SelfHostStack

Workflow automation is the lifeblood of modern online businesses. Whether you are synchronizing Stripe payments to Discord, parsing lead emails into Airtable, or orchestrating multi-step AI agents with OpenAI and Anthropic APIs, automation saves hundreds of manual hours.

The problem? Zapier's pricing model actively penalizes you for growing.

On Zapier, 50,000 tasks/month costs $299/month ($3,588/year). If you run a data enrichment loop or high-frequency webhook trigger, you will burn through your quota in days.

Here is how you can self-host n8n on Docker for unlimited runs at €3.79/month.


Why n8n Outperforms Zapier for Developers & Power Users

  1. Zero Execution Metering: Run 100 tasks or 1,000,000 tasks. The cost remains exactly the same: your VPS server price.
  2. Native AI Agent Nodes: n8n features first-class LangChain and AI Agent nodes. You can plug in OpenAI, Claude, or local Ollama LLMs, give them tools (search, database query, scrapers), and maintain conversational memory across sessions.
  3. Custom JavaScript and Python Execution: Need complex data transformations? Write native JS or Python directly inside any workflow node.
  4. Local Network Access: Connect directly to internal PostgreSQL databases, Redis queues, and local microservices behind your private VPC firewall without exposing them to the public internet.

The Production Docker Compose Setup for n8n

Here is the exact production-tested docker-compose.yml to spin up n8n with persistent storage:

version: '3.8'

services:
  n8n:
    image: docker.n8n.io/n8nio/n8n:latest
    container_name: n8n
    restart: always
    ports:
      - "5678:5678"
    environment:
      - N8N_HOST=n8n.yourdomain.com
      - N8N_PORT=5678
      - N8N_PROTOCOL=https
      - NODE_ENV=production
      - WEBHOOK_URL=https://n8n.yourdomain.com/
      - GENERIC_TIMEZONE=UTC
    volumes:
      - n8n_data:/home/node/.n8n

volumes:
  n8n_data:
Enter fullscreen mode Exit fullscreen mode

Step-by-Step 5-Minute Deploy Guide

Step 1: Spin Up a $4/mo VPS

We recommend Hetzner Cloud CX22 (2 vCPUs, 4GB RAM, €3.79/mo) or a DigitalOcean Droplet.

Step 2: Install Docker

curl -fsSL https://get.docker.com | sh
Enter fullscreen mode Exit fullscreen mode

Step 3: Launch n8n

mkdir -p ~/n8n && cd ~/n8n
nano docker-compose.yml # Paste the snippet above
docker compose up -d
Enter fullscreen mode Exit fullscreen mode

Step 4: Reverse Proxy with SSL (Caddy)

Point your DNS A-record (e.g. n8n.yourdomain.com) to your server IP, then set up Caddy:

sudo apt install -y caddy
Enter fullscreen mode Exit fullscreen mode

Edit /etc/caddy/Caddyfile:

n8n.yourdomain.com {
    reverse_proxy localhost:5678
}
Enter fullscreen mode Exit fullscreen mode

Reload Caddy: sudo systemctl reload caddy.


The Savings Breakdown

Automation Volume Zapier Cloud Self-Hosted n8n (Hetzner) Your Savings
5,000 tasks/mo $49 / mo €3.79 / mo (~$4.10) $538 / year
50,000 tasks/mo $299 / mo €3.79 / mo (~$4.10) $3,190 / year
250,000 tasks/mo $899 / mo €7.14 / mo (~$7.70) $10,695 / year

Conclusion

Automating your business should not come with a massive tax on every transaction. By running n8n on your own infrastructure, you unlock limitless workflows, full control over private data, and deep AI Agent orchestration.

For more open-source software guides and production templates, visit SelfHostStack.

Top comments (0)