Pular para o conteúdo

Buscar na documentação

Buscar na documentação do Skiffly

n8n auto-hospedado

Deploy n8n with PostgreSQL on Skiffly from the template in a couple of minutes, then set the webhook URL, a custom domain, an encryption key you keep, backups, upgrades and resource sizing.

What you build: the n8n template — an n8n service (n8nio/n8n, port 5678, a 2 GB volume for /home/node/.n8n) and a Postgres service (10 GB volume) already wired together — with a public domain, then optionally a custom domain and queue mode. About 5 minutes to a working editor.

1. Deploy the template#

New projectautomation. On the canvas New service → Template, search n8n, Deploy. Nothing is required: the Postgres password and N8N_ENCRYPTION_KEY are generated. Two services appear and start building; the n8n service turns SUCCESS once /healthz answers, usually within a minute.

2. Open it#

The template gives n8n a generated domain automatically (N8N_HOST, WEBHOOK_URL and N8N_EDITOR_BASE_URL reference ${{self.SKIFFLY_PUBLIC_DOMAIN}}). Find it with skiffly domain -s n8n or on the service card, open it and create the owner account. Webhook nodes show the public URL right away.

Expected variables on the n8n service (skiffly variables -s n8n): DB_TYPE=postgresdb, DB_POSTGRESDB_HOSTpostgres, N8N_ENCRYPTION_KEY, N8N_PROTOCOL=https, N8N_RUNNERS_ENABLED=true.

3. Keep the encryption key#

N8N_ENCRYPTION_KEY encrypts every credential you store in n8n. It was generated at deploy time and lives in the service variables and in /home/node/.n8n/config on the volume. Copy it somewhere safe now:

skiffly variables -s n8n --kv | grep N8N_ENCRYPTION_KEY

If it ever changes, saved credentials become unreadable.

4. Custom domain#

skiffly domain -s n8n n8n.example.com
# create the CNAME and TXT records it prints, then:
skiffly domain status n8n.example.com

Once verified, the self.SKIFFLY_PUBLIC_DOMAIN references still point at the first domain of the service — the generated one. Switch the three URL variables to the custom domain and redeploy:

skiffly variables set -s n8n N8N_HOST=n8n.example.com WEBHOOK_URL=https://n8n.example.com/ N8N_EDITOR_BASE_URL=https://n8n.example.com/

Existing webhooks keep working on the old domain as long as you keep it; delete it with skiffly domain delete when everything has moved.

5. Resources#

The template gives n8n 1 vCPU / 1 GiB, enough for a few dozen workflows. Heavy workflows (large files, many parallel executions) want 2 GiB: service → Settings → Resources. Do not turn on App Sleeping for n8n — scheduled triggers stop while it sleeps, and webhooks would wait for the wake-up.

Execution history grows the database; set EXECUTIONS_DATA_PRUNE=true and EXECUTIONS_DATA_MAX_AGE=168 (hours) to keep Postgres small.

6. Upgrades#

The template pins n8nio/n8n:latest, so a redeploy pulls the newest release (skiffly redeploy -s n8n); n8n migrates its database on start. To control the version, set the image to a tag: skiffly deploy --image n8nio/n8n:1.80.0 -s n8n. Read the n8n release notes before jumping major versions.

7. Backups#

Both volumes are snapshotted daily (03:00 UTC) with a logical dump of Postgres; restores go through support today. Your own copy of the workflows is one command:

skiffly ssh -s n8n -T -- n8n export:workflow --all --pretty > workflows.json
skiffly ssh -s n8n -T -- n8n export:credentials --all --decrypted > credentials.json   # handle with care

8. Queue mode (optional)#

For many concurrent executions n8n runs a main instance plus workers over Redis:

  1. skiffly deploy --template redis.
  2. On n8n: EXECUTIONS_MODE=queue, QUEUE_BULL_REDIS_HOST=${{Redis.SKIFFLY_PRIVATE_DOMAIN}}, QUEUE_BULL_REDIS_PORT=6379, QUEUE_BULL_REDIS_PASSWORD=${{Redis.REDIS_PASSWORD}} (the template generates one).
  3. A worker service from the same image (skiffly deploy --image n8nio/n8n:latest --name n8n-worker), start command n8n worker, the same DB_*, N8N_ENCRYPTION_KEY=${{n8n.N8N_ENCRYPTION_KEY}} and QUEUE_* variables, no domain, no volume.

Troubleshooting#

SymptomFix
Webhook URLs show http://localhost:5678WEBHOOK_URL/N8N_HOST not resolving: the service has no domain yet, run skiffly domain -s n8n and redeploy
Credentials could not be decryptedN8N_ENCRYPTION_KEY changed; restore the original value
n8n restarts with ECONNREFUSED postgres:5432Postgres still starting or crashed: skiffly logs -s Postgres
Editor is slow / executions time outraise memory in Settings → Resources, prune executions
Your n8n server is configured to use a secure cookieN8N_PROTOCOL=https with a plain-http URL; use the https:// domain

Next: Templates · Volumes & databases · Networking