
How I Deploy n8n to Hetzner Cloud with OpenTofu
Originally published at kjetilfuras.com I wanted to deploy n8n to Hetzner Cloud with OpenTofu with proper security, SSL certificates, and infrastructure-as-code—because the manual process was eating hours of my time. Spinning up a new self-hosted n8n instance used to take me about an hour of clicking through interfaces and running commands. Now I do it in under 5 minutes with 3 OpenTofu commands. Here’s how I built this system. The Problem with Manual Server Setup Docker Compose handles the application stack—but before you can run docker compose up, you need a server. Before automation, that meant: Log into Hetzner Cloud console, create server, configure SSH key SSH in and update packages Install Docker and Docker Compose Configure firewall rules Install and configure fail2ban Harden SSH (disable root, password auth, set max attempts) Clone your Docker Compose repository Create environment files and generate secure passwords That’s about an hour of setup before Docker Compose even runs
Continue reading on Dev.to Tutorial
Opens in a new tab


