Dev.to · 3 min read

How to Deploy n8n in "Queue Mode" on Hetzner for $5/mo (Beat Zapier's $500/mo Bill)

How to Deploy n8n in "Queue Mode" on Hetzner for $5/mo (Beat Zapier's $500/mo Bill)

Standard self-hosted n8n instances crash under heavy webhook loads. Deploying n8n in "Queue Mode" (which requires Redis, Postgres, a main web process, and a separate background worker process) is notoriously painful to wire manually in Docker. Railyard has a verified 1-click template for this exact architecture. If you build heavy automations or AI workflows, Zapier and Make will bankrupt you as soon as your volume scales. The obvious move is self-hosting n8n. However, if you just run a basic docker run n8n setup on a cheap server, your instance will choke the moment 50 webhooks hit it at the exact same time. To run n8n in production, you need Queue Mode—an architecture where the main instance receives webhooks, pushes them to a Redis queue, stores state in PostgreSQL, and hands the heavy lifting off to dedicated background workers. Setting that up manually with Docker Compose, private networks, and reverse proxies takes hours. We are going to deploy a production-grade, multi-service n8n Queue Mode stack on a €4.50 (~$5) Hetzner server in 3 minutes using Railyard. The Raw Cost Breakdown Zapier Team Plan (50,000 tasks/mo): $399/month ($4,788/year) n8n Cloud Pro (50,000 executions): $120/month ($1,440/year) Self-Hosted n8n Queue Mode via Railyard: Hetzner CX22 (2 vCPU, 4GB RAM): ~$5.00/month Railyard Free Plan (Covers 1 server + 3 apps/stacks, zero compute markup): $0.00/month Total: $5.00/month (Unlimited workflows and executions) Step 1: Provision a Bare Linux Box on Hetzner Log into the Hetzner Cloud Console and create a new project. Add a server: Choose Ubuntu 24.04, select the CX22 tier (4GB RAM gives plenty of breathing room for Redis, Postgres, and Node workers), and add your SSH key. Copy the public IPv4 address once the server comes online. Step 2: Attach the Server to Railyard Railyard connects to your server via SSH and installs the container runtime, private networking mesh, and SSL proxy automatically. Go to Railyard.run and sign into your dashboard. Click Add Server and enter your Hetzner IP address, user (root), and SSH key. Railyard will initialize the node and set up the internal private network. Step 3: Deploy the Verified "n8n (Queue Mode)" Template Instead of writing a 100-line docker-compose.yml file to link Redis and Postgres, use Railyard's verified multi-service template. Open the Railyard Templates directory and filter by Automation. Select n8n (queue mode) (Verified 5-service stack). Click Deploy and select your Hetzner server. Behind the scenes, Railyard automatically provisions and wires together: PostgreSQL: Replaces the default SQLite database so concurrent writes never lock up. Redis: Acts as the message broker between the web receiver and the workers. n8n Main: Handles the UI and incoming webhook traffic. n8n Worker: Pulls jobs from Redis and executes workflows in the background without slowing down the UI or dropping webhooks. Private Networking: All database and queue connection strings (DB_POSTGRESDB_HOST, QUEUE_BULL_REDIS_HOST, encryption keys) are injected into the build environment automatically over an isolated network. Step 4: Lock Down Your Webhook URL with Automatic HTTPS OAuth callbacks (for Slack, Google, Stripe) require valid SSL certificates to function. Point an A record (e.g., automate.yourdomain.com) to your Hetzner IP. Add the domain to your n8n app inside Railyard. Railyard provisions the Let's Encrypt certificate and configures the WEBHOOK_URL environment variable so your production webhooks route properly on the first try.

This is a summary aggregated from Dev.to. Read the complete article on the original site:

Read full article at Dev.to

More Cybersecurity News