AI
AIMONEYGEN SOFTWARE • AI • LICENSE
DevOps & Automation • 6 min read • 2026-08-20

How to Self-Host n8n AI Workflow Automation on a $4/Mo Hetzner VPS with Docker & SSL

Save $500+/year by deploying an unlimited, production-ready n8n workflow instance with PostgreSQL, Docker Compose, and Traefik SSL on Hetzner Cloud.

Why Self-Host n8n Instead of Cloud SaaS?

While n8n Cloud and Zapier charge escalating fees for task volume, a $4.10/mo Hetzner Cloud VPS (CX22: 2 vCPU, 4GB RAM) allows you to execute unlimited workflows, webhooks, and AI agent steps for a fixed, ultra-low monthly cost.


5-Minute Deployment Guide

1. Provision a Hetzner Cloud Server

  • Select Ubuntu 24.04 LTS on the CX22 (2 vCPU, 4GB RAM) tier.
  • Add your SSH key and deploy in under 30 seconds.

2. Install Docker & Docker Compose

sudo apt update && sudo apt upgrade -y
sudo apt install -y docker.io docker-compose-plugin
sudo systemctl enable --now docker

3. Deploy n8n via Docker Compose

Create a docker-compose.yml file:

version: '3.8'
services:
  n8n:
    image: docker.n8n.io/n8nio/n8n
    restart: always
    ports:
      - "5678:5678"
    environment:
      - N8N_HOST=n8n.yourdomain.com
      - N8N_PORT=5678
      - N8N_PROTOCOL=https
      - WEBHOOK_URL=https://n8n.yourdomain.com/
    volumes:
      - n8n_data:/home/node/.n8n

volumes:
  n8n_data:

Run docker compose up -d and point your Cloudflare DNS to your VPS IP to enjoy unlimited automated workflows!

#n8n #Hetzner Cloud #Docker #Self-Hosted #Automation