data/skills/n8n-self-hosting/README.md
Expert guidance for a coding agent to deploy a production self-hosted n8n end-to-end onto a fresh Linux VM — Docker Compose behind a Caddy reverse proxy with automatic HTTPS — in either single/regular mode or queue mode (main + Redis + Postgres + workers), plus the essential Day-2 operations (update, back up, restore).
This is the one deployment/ops skill in the pack. The other skills are about building workflows through the n8n-mcp MCP server; this one is about standing up the server they run on. It does not touch the workflow-building router or hooks — it triggers on its own description when someone wants to self-host n8n.
Takes a bare Ubuntu/Debian box with SSH access to a running, TLS-secured n8n:
It is opinionated toward secure defaults that exceed a naive install: the encryption key is
set explicitly (not auto-generated), internal ports (5678/5432/6379) are never published,
telemetry is off, Code-node process.env access is blocked, and execution data is pruned.
| Single / regular | Queue | |
|---|---|---|
| Processes | one n8n | main + N workers |
| Services | n8n + Caddy (SQLite) | n8n + workers + Redis + Postgres + Caddy |
| Executes | in the main process | on workers, in parallel |
| For | one user, light/moderate load | high volume, horizontal scale |
Activates when the user wants to:
Not for n8n Cloud, and not for building workflows (that's the rest of the pack).
Example queries:
The end-to-end orchestrator: mode selection, secret-hygiene rules, inputs, the numbered deploy flow, verification, and "what not to do."
Secret-free templates the agent copies to the box:
docker-compose.single.yml, docker-compose.queue.ymlCaddyfile (domain-free; driven by .env).env.single.example, .env.queue.example (placeholder values only)init-data.sh (Postgres non-root user bootstrap for queue mode)Every shipped file is secret-free and domain-free. Real secrets only ever exist in a .env
on the target box (mode 600), referenced as ${VAR}. The skill instructs the agent to generate
fresh secrets per box, never reuse an encryption key or .env across instances, redact values
when inspecting, and keep internal services off the public interface.
Version: 1.0.0
Compatibility: Docker Engine + Compose v2 on a Debian/Ubuntu host; n8n official image
(docker.n8n.io/n8nio/n8n); Caddy 2 for automatic TLS.
Remember: pick the mode first, preflight DNS + ports, generate fresh secrets on the box, and back up the encryption key off-box — a database without its key is undecryptable.