n8n-self-hosting
What it does
It walks an AI agent through setting up self-hosted n8n on a fresh Linux server over SSH, using Docker Compose and Caddy for secure web access. It is for people who want to run n8n on their own server or VPS.
When to use it
- βWhen you want to host n8n yourself on a cloud server or VPS.
- βWhen you need to choose between a simple single-process setup and a queue setup with workers.
- βWhen you need to update or back up an existing self-hosted n8n.
Skill link
https://github.com/czlonkowski/n8n-mcp/blob/main/data/skills/n8n-self-hosting/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βSet up n8n on my new Ubuntu server with automatic HTTPS.β
5 new skills a week. 1 minute to read.
How it works
The skill checks the server, installs Docker, sets up the project files and secrets, starts n8n behind Caddy, and checks that the secure connection works.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Deploying self-hosted n8n
This skill takes a fresh Linux VM (Ubuntu/Debian, root or sudo SSH) to a running, HTTPS, production n8n via Docker Compose behind Caddy (automatic Let's Encrypt TLS). It is for self-hosted n8n on Docker β not n8n Cloud, and not for building workflows (that's the rest of this pack).
Two deployment modes. The architectures differ, so pick the mode before doing anything.
You drive this end-to-end over SSH: preflight β install Docker β lay down the project β
generate secrets β launch β verify TLS β hand off. The template files live in assets/;
the per-mode and security depth live in the reference files named below.
Rule 0 β choose the mode (ask the user)
Do not guess. Ask, then commit to one:
| Single / regular | Queue | |
|---|---|---|
| Processes | one n8n | main + N workers |
| Extra services | none (SQLite) | Redis (queue) + Postgres (DB) |
| Executes workflows | in the main process | on workers, in parallel |
| Good for | 1 user, light/moderate load, simplest ops | high volume, heavy/long executions, horizontal scale |
| Compose | assets/docker-compose.single.yml |
assets/docker-compose.queue.yml |
| Deep dive | SINGLE_MODE.md |
QUEUE_MODE.md |
If unsure, start single β it's the simplest correct thing and covers most needs. Moving to queue later means swapping the compose file and migrating SQLiteβPostgres, so if the user already expects real volume, start queue.
Rule 1 β secret hygiene (non-negotiable)
A misstep here leaks client credentials. Be diligent:
- Generate every secret fresh, on the target box. Never copy an encryption key, DB
password, or
.envfrom another n8n instance into this one. SeeSECURITY.mdfor theopensslcommands. - Secrets live only in
.env(mode 600), referenced by the compose as${VAR}. Never inline a secret intodocker-compose.yml, the Caddyfile, or anything you commit. - The
N8N_ENCRYPTION_KEYis sacred. It encrypts every stored credential. If it's lost or changes, all saved credentials become undecryptable. Set it explicitly, and tell the user to back it up off the box. Don't echo it into long-lived logs or chat history beyond what's needed to hand it over. - Never expose internal services. Only Caddy (80/443) is public. n8n (5678), Postgres (5432), Redis (6379) stay on the private Docker network β the templates already omit their host port mappings. Don't add them.
.envand Caddy'scaddy_datavolume (the issued certs + ACME account key) are not artifacts to share. If you're working inside a git repo, confirm.envis git-ignored before any commit.
Inputs to collect up front
- SSH target β
user@hostand how you authenticate (key path or the user confirms the agent already has access). Root or a sudo user. - Domain β the full hostname n8n will live at, e.g.
n8n.example.com(βSUBDOMAIN=n8n,DOMAIN_NAME=example.com). The user must control its DNS. - TLS email β for Let's Encrypt (
SSL_EMAIL). - Timezone β IANA name for Schedule/Cron nodes (e.g.
Europe/Warsaw), elseEtc/UTC. - Mode β single or queue (Rule 0). Queue β confirm the box has enough RAM (rough floor ~4 GB; each worker wants ~1β2 GB).
- Optional modules β some features (currently Agents) are backend modules that stay off
unless listed in
N8N_ENABLED_MODULES. Ask only if the user brings one up; if they do, read the modules section ofQUEUE_MODE.mdbefore enabling it, because in queue mode it has to reach the workers as well.
The deploy flow
Work through these in order. SINGLE_MODE.md / QUEUE_MODE.md give the mode-specific command
detail; SECURITY.md covers secret generation and hardening; DAY2.md covers update/backup/restore.
1. Preflight (the cheapest failure is the one you catch here)
- SSH in; confirm the OS is Debian/Ubuntu-like (
. /etc/os-release). - DNS must already point at the box. Compare the box's public IP (
curl -s ifconfig.me) withdig +short <fqdn>(run it from the box AND ideally your laptop). If they don't match, stop β Caddy's ACME challenge will fail. Have the user create the A record, wait for it to propagate, then continue. - Ports 80 and 443 must be reachable from the internet. Check the host firewall AND any cloud security group / network firewall (Hetzner Cloud, AWS SG, etc.) β these are outside the box and a common silent blocker.
FAQ
Is this for n8n Cloud?
No. It is for self-hosted n8n on Docker, not the hosted n8n Cloud service.
Which mode should I choose?
The skill asks first. Single mode is the simplest and fits most small setups, while queue mode adds Redis and Postgres for heavier load.
What access does it need on the server?
It expects root or sudo SSH access to a fresh Ubuntu or Debian machine.
Details
Original description by the author
Deploy a production self-hosted n8n end-to-end to a fresh Linux VM over SSH, using Docker Compose behind a Caddy reverse proxy with automatic HTTPS. Use whenever the user wants to self-host, install, set up, provision, or deploy n8n on their own server/VPS/box (Hetzner, DigitalOcean, AWS EC2, bare metal, etc.) β in either single/regular mode or queue mode with workers β or to update, back up, restore, or harden such an instance. This is for SELF-HOSTED n8n (Docker), not n8n Cloud and not building workflows. The skill makes the agent ask single-vs-queue first, collect the domain/SSH/timezone in
repo: czlonkowski/n8n-mcp
Popularity
- GitHub stars
- 23k
- Ranking position
- #10130
- License
- MIT
- Updated
- 11/2/2026
Comments
- β¦
More skills from this repository
n8n-agents
23kTeaches your agent to design n8n AI agents well, with the right model, tools, memory and output format.
n8n-binary-and-data
23kTeaches your agent to handle files such as PDFs and images in n8n workflows without losing them along the way.
n8n-code-tool
23kTeaches your agent to write JavaScript or Python for an n8n Custom Code Tool that an AI agent can call.
n8n-error-handling
23kTeaches your agent to set up n8n workflows so failures are clear, structured and recoverable instead of silent.
Similar skills
openclaw-update
394kHelps your agent update an existing OpenClaw Gateway, choosing the update method that fits how it was installed and keeping your session working.
diagnose-gateway
394kHelps your agent find out why your OpenClaw Gateway is failing by checking settings, channels, and ports without changing anything.
crabbox-apps
394kHelps your agent open and run an app on a temporary cloud machine, then show its view in your chat side panel.