本文へスキップ
Skillpedia
デプロイとクラウド(DevOps)23k · #10130

n8n-self-hosting

できること

新しいLinuxサーバーにSSHで接続し、Docker ComposeとCaddyを使って、自分で運用するn8nを設定する手順をAIエージェントに示します。自分のサーバーやVPSでn8nを動かしたい人向けです。

使う場面

  • ✓クラウドサーバーやVPSで、n8nを自分でホストしたいとき。
  • ✓単一プロセスの簡単な構成と、ワーカーを持つキューの構成のどちらかを選ぶ必要があるとき。
  • ✓既存の自己ホスト型のn8nを更新またはバックアップする必要があるとき。

スキルのリンク

https://github.com/czlonkowski/n8n-mcp/blob/main/data/skills/n8n-self-hosting/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/czlonkowski/n8n-mcp/blob/main/data/skills/n8n-self-hosting/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“新しいUbuntuサーバーに、自動HTTPSでn8nを設定してください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

このスキルは、サーバーを確認し、Dockerをインストールし、プロジェクトのファイルと秘密情報を設定し、Caddyの背後でn8nを起動して、安全な接続が動くことを確認します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)を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:

  1. Generate every secret fresh, on the target box. Never copy an encryption key, DB password, or .env from another n8n instance into this one. See SECURITY.md for the openssl commands.
  2. Secrets live only in .env (mode 600), referenced by the compose as ${VAR}. Never inline a secret into docker-compose.yml, the Caddyfile, or anything you commit.
  3. The N8N_ENCRYPTION_KEY is 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.
  4. 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.
  5. .env and Caddy's caddy_data volume (the issued certs + ACME account key) are not artifacts to share. If you're working inside a git repo, confirm .env is git-ignored before any commit.

Inputs to collect up front

  • SSH target — user@host and 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), else Etc/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 of QUEUE_MODE.md before 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) with dig +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.

よくある質問

n8n Cloud向けですか?

いいえ。ホスト型のn8n Cloudではなく、Dockerで動く自己ホスト型のn8n向けです。

どのモードを選ぶべきですか?

このスキルは最初に尋ねます。シングルモードは最もシンプルで、小規模な構成に向いています。キューモードは、負荷が高い場合にRedisとPostgresを加えます。

サーバーにはどのアクセス権が必要ですか?

新しいUbuntuまたはDebianのマシンに対する、rootまたはsudoのSSHアクセスを想定しています。

詳細

作者による元の説明

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

人気

GitHubのスター
23k
ランキング
#10130
ライセンス
MIT
更新日
2026/11/2

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル