[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EFJSQVKQ9N88EXQWHXEQQQ":3,"skill-same:01M6EFJSQVKQ9N88EXQWHXEQQQ":67},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":7,"sourceHtmlUrl":17,"categories":18,"keywords":29,"publishedAt":34,"linkOnly":35,"markdownContent":36,"markdownBody":36,"frontMatter":37,"refName":38,"commitSha":39,"skillDirectory":40,"forksCount":41,"repositoryHtmlUrl":42,"repositoryHomepageUrl":43,"ownerHtmlUrl":44,"ownerBlogUrl":7,"ownerDescription":45,"updatedAt":46,"install":47,"resources":60},"01M6EFJSQVKQ9N88EXQWHXEQQQ","n8n-self-host","n8n 自托管部署",null,"","ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FTerminalSkills\u002Fskills\u002Fn8n-self-host\u002FSKILL.md",[19,24],{"categoryNo":20,"categoryName":21,"taxonomyType":22,"taxonomyTypeDesc":23},"01M8BSFHC0DJXKNN0QBZDDS4K9","定时任务与自动化编排","SCENARIO","使用场景",{"categoryNo":25,"categoryName":26,"taxonomyType":27,"taxonomyTypeDesc":28},"01M8C6RQ852C9AEJFCBGG1YA7S","IT 管理员","PROFESSION","适用职业",[30,31,32,33],"n8n","self","host","n8n self host","2026-11-10 10:12:30",false,"# n8n Self-Host\n\n## Overview\n\nInstall, configure, scale, and operate self-hosted n8n instances. Covers Docker Compose production setups, CLI administration, REST API automation, queue-mode scaling with Redis workers, backup\u002Frestore, monitoring, and troubleshooting. For building n8n workflows and configuring nodes, see the `n8n-workflow` skill.\n\n## Instructions\n\n### Task A: Production Docker Compose Setup\n\nBasic setup with PostgreSQL (recommended over default SQLite):\n\n```yaml\n# docker-compose.yml\nservices:\n  postgres:\n    image: postgres:16\n    restart: always\n    environment:\n      POSTGRES_USER: ${POSTGRES_USER}\n      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}\n      POSTGRES_DB: ${POSTGRES_DB}\n    volumes:\n      - db_storage:\u002Fvar\u002Flib\u002Fpostgresql\u002Fdata\n    healthcheck:\n      test: ['CMD-SHELL', 'pg_isready -h localhost -U ${POSTGRES_USER} -d ${POSTGRES_DB}']\n      interval: 5s\n      timeout: 5s\n      retries: 10\n\n  n8n:\n    image: docker.n8n.io\u002Fn8nio\u002Fn8n\n    restart: always\n    ports:\n      - \"5678:5678\"\n    environment:\n      - DB_TYPE=postgresdb\n      - DB_POSTGRESDB_HOST=postgres\n      - DB_POSTGRESDB_PORT=5432\n      - DB_POSTGRESDB_DATABASE=${POSTGRES_DB}\n      - DB_POSTGRESDB_USER=${POSTGRES_USER}\n      - DB_POSTGRESDB_PASSWORD=${POSTGRES_PASSWORD}\n      - N8N_ENCRYPTION_KEY=${ENCRYPTION_KEY}\n      - WEBHOOK_URL=${WEBHOOK_URL}\n      - GENERIC_TIMEZONE=${GENERIC_TIMEZONE:-UTC}\n      - N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true\n      - N8N_RUNNERS_ENABLED=true\n    volumes:\n      - n8n_storage:\u002Fhome\u002Fnode\u002F.n8n\n    depends_on:\n      postgres:\n        condition: service_healthy\n\nvolumes:\n  db_storage:\n  n8n_storage:\n```\n\nCreate a `.env` alongside with `POSTGRES_USER`, `POSTGRES_PASSWORD`, `POSTGRES_DB`, `ENCRYPTION_KEY` (generate with `openssl rand -hex 24`), `WEBHOOK_URL`, and `GENERIC_TIMEZONE`. Start with `docker compose up -d`.\n\n### Task B: Scale with Queue Mode (Redis + Workers)\n\nFor high-volume workloads, add Redis and worker processes:\n\n```yaml\n# Add to docker-compose.yml\nx-n8n-shared: &n8n-shared\n  image: docker.n8n.io\u002Fn8nio\u002Fn8n\n  restart: always\n  environment:\n    - DB_TYPE=postgresdb\n    - DB_POSTGRESDB_HOST=postgres\n    - DB_POSTGRESDB_DATABASE=${POSTGRES_DB}\n    - DB_POSTGRESDB_USER=${POSTGRES_USER}\n    - DB_POSTGRESDB_PASSWORD=${POSTGRES_PASSWORD}\n    - EXECUTIONS_MODE=queue\n    - QUEUE_BULL_REDIS_HOST=redis\n    - QUEUE_HEALTH_CHECK_ACTIVE=true\n    - N8N_ENCRYPTION_KEY=${ENCRYPTION_KEY}\n  volumes:\n    - n8n_storage:\u002Fhome\u002Fnode\u002F.n8n\n  depends_on:\n    postgres:\n      condition: service_healthy\n    redis:\n      condition: service_healthy\n\nservices:\n  redis:\n    image: redis:7-alpine\n    restart: always\n    volumes:\n      - redis_storage:\u002Fdata\n    healthcheck:\n      test: ['CMD', 'redis-cli', 'ping']\n      interval: 5s\n\n  n8n:\n    \u003C\u003C: *n8n-shared\n    ports:\n      - \"5678:5678\"\n\n  n8n-worker:\n    \u003C\u003C: *n8n-shared\n    command: worker\n    # Scale with: docker compose up -d --scale n8n-worker=3\n```\n\n### Task C: CLI Administration\n\nRun CLI commands inside Docker: `docker exec -u node -it n8n n8n \u003Ccommand>`.\n\n```bash\n# Export\u002Fimport workflows\nn8n export:workflow --backup --output=backups\u002F\nn8n export:workflow --id=\u003CID> --output=workflow.json\nn8n import:workflow --input=workflow.json\nn8n import:workflow --separate --input=backups\u002F\n\n# Export\u002Fimport credentials (--decrypted for cross-instance migration)\nn8n export:credentials --backup --output=backups\u002F\nn8n export:credentials --all --decrypted --output=creds.json\nn8n import:credentials --input=creds.json\n\n# Full database backup\u002Frestore\nn8n export:entities --outputDir=.\u002Fbackup --includeExecutionHistoryDataTables=true\nn8n import:entities --inputDir=.\u002Fbackup --truncateTables=true\n\n# Execute a workflow by ID\nn8n execute --id=\u003CID>\n\n# Activate\u002Fdeactivate workflows\nn8n update:workflow --id=\u003CID> --active=true\nn8n update:workflow --all --active=false\n\n# User management\nn8n user-management:reset          # Reset to setup state (forgot password)\nn8n mfa:disable --email=user@x.com # Disable MFA for locked-out user\n\n# Security audit\nn8n audit\n\n# Database migration rollback\nn8n db:revert\n```\n\n### Task D: REST API Automation\n\nEnable the API at `\u002Fapi\u002Fv1\u002Fdocs`. Authenticate with `X-N8N-API-KEY` header.\n\n```bash\n# List all workflows\ncurl -s -H \"X-N8N-API-KEY: $N8N_API_KEY\" http:\u002F\u002Flocalhost:5678\u002Fapi\u002Fv1\u002Fworkflows | jq '.data[].name'\n\n# Activate a workflow\ncurl -X POST -H \"X-N8N-API-KEY: $N8N_API_KEY\" http:\u002F\u002Flocalhost:5678\u002Fapi\u002Fv1\u002Fworkflows\u002F\u003CID>\u002Factivate\n\n# Deactivate a workflow\ncurl -X POST -H \"X-N8N-API-KEY: $N8N_API_KEY\" http:\u002F\u002Flocalhost:5678\u002Fapi\u002Fv1\u002Fworkflows\u002F\u003CID>\u002Fdeactivate\n\n# Retry a failed execution\ncurl -X POST -H \"X-N8N-API-KEY: $N8N_API_KEY\" http:\u002F\u002Flocalhost:5678\u002Fapi\u002Fv1\u002Fexecutions\u002F\u003CID>\u002Fretry\n\n# List failed executions\ncurl -s -H \"X-N8N-API-KEY: $N8N_API_KEY\" \"http:\u002F\u002Flocalhost:5678\u002Fapi\u002Fv1\u002Fexecutions?status=error\" | jq '.data[] | {id, workflowId, status}'\n\n# Create a variable\ncurl -X POST -H \"X-N8N-API-KEY: $N8N_API_KEY\" -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"key\":\"ENV\",\"value\":\"production\"}' http:\u002F\u002Flocalhost:5678\u002Fapi\u002Fv1\u002Fvariables\n```\n\n### Task E: Key Environment Variables\n\n| Variable | Default | Purpose |\n|----------|---------|---------|\n| `DB_TYPE` | `sqlite` | `sqlite` or `postgresdb` |\n| `N8N_ENCRYPTION_KEY` | random | Credential encryption (preserve across restarts) |\n| `WEBHOOK_URL` | auto | Public URL for webhooks behind reverse proxy |\n| `EXECUTIONS_MODE` | `regular` | `regular` or `queue` (for scaling) |\n| `EXECUTIONS_DATA_PRUNE` | `true` | Auto-prune old execution data |\n| `EXECUTIONS_DATA_MAX_AGE` | `336` | Max execution age in hours |\n| `N8N_METRICS` | `false` | Enable Prometheus `\u002Fmetrics` endpoint |\n| `N8N_LOG_LEVEL` | `info` | `error`, `warn`, `info`, `debug` |\n| `N8N_LOG_OUTPUT` | `console` | `console`, `file` (comma-separated) |\n| `N8N_CONCURRENCY_PRODUCTION_LIMIT` | `-1` | Max concurrent production executions |\n| `N8N_RUNNERS_ENABLED` | `false` | Enable task runners for Code nodes |\n| `GENERIC_TIMEZONE` | `America\u002FNew_York` | Timezone for schedule triggers |\n\nUse `_FILE` suffix for Docker Secrets (e.g., `DB_POSTGRESDB_PASSWORD_FILE=\u002Frun\u002Fsecrets\u002Fdb_pass`).\n\n## Examples\n\n### Example 1: Deploy n8n with PostgreSQL in production\n\n**User request:** \"Set up n8n in production with Docker Compose\"\n\n**Actions taken:**\n\n```bash\n$ mkdir n8n-production && cd n8n-production\n\n# Generate secrets\n$ openssl rand -hex 24\n> a1b2c3d4e5f6...\n\n# Create .env with POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DB,\n# ENCRYPTION_KEY, WEBHOOK_URL, GENERIC_TIMEZONE\n\n# Create docker-compose.yml (Task A template)\n\n$ docker compose up -d\n> [+] Running 3\u002F3\n>  ✔ Network n8n-production_default   Created\n>  ✔ Container postgres               Started\n>  ✔ Container n8n                     Started\n\n$ docker compose logs n8n --tail 5\n> n8n  | Editor is now accessible via: http:\u002F\u002Flocalhost:5678\n```\n\n### Example 2: Back up and restore workflows\n\n**User request:** \"Back up all my n8n workflows and credentials\"\n\n**Actions taken:**\n\n```bash\n$ docker exec -u node n8n n8n export:workflow --backup --output=\u002Fhome\u002Fnode\u002F.n8n\u002Fbackups\u002F\n> Successfully exported 12 workflows\n\n$ docker exec -u node n8n n8n export:credentials --backup --output=\u002Fhome\u002Fnode\u002F.n8n\u002Fbackups\u002F\n> Successfully exported 8 credentials\n\n# Copy backups out of the container\n$ docker cp n8n:\u002Fhome\u002Fnode\u002F.n8n\u002Fbackups\u002F .\u002Fn8n-backups\u002F\n\n# Restore on a new instance\n$ docker cp .\u002Fn8n-backups\u002F n8n-new:\u002Fhome\u002Fnode\u002F.n8n\u002Fbackups\u002F\n$ docker exec -u node n8n-new n8n import:workflow --separate --input=\u002Fhome\u002Fnode\u002F.n8n\u002Fbackups\u002F\n> Successfully imported 12 workflows\n```\n\n### Example 3: Troubleshoot a failing instance\n\n**User request:** \"My n8n instance is crashing after update\"\n\n**Actions taken:**\n\n```bash\n$ docker compose logs n8n --tail 30\n> error: Migration failed: column \"x\" already exists\n\n# Rollback the last migration\n$ docker exec -u node n8n n8n db:revert\n> Reverted migration: AddColumnX1234567890\n\n# Pin to previous working version in docker-compose.yml\n# image: docker.n8n.io\u002Fn8nio\u002Fn8n:1.80.0\n\n$ docker compose up -d\n> n8n  | Editor is now accessible via: http:\u002F\u002Flocalhost:5678\n```\n\n## Guidelines\n\n- Always set `N8N_ENCRYPTION_KEY` explicitly and back it up. Without it, credentials cannot be decrypted on a new instance.\n- Use PostgreSQL for any instance running more than a few workflows. SQLite doesn't handle concurrent writes well.\n- Set `WEBHOOK_URL` when behind a reverse proxy — webhooks fail silently without it.\n- Use `n8n export:credentials --decrypted` when migrating between instances with different encryption keys.\n- Enable execution pruning (`EXECUTIONS_DATA_PRUNE=true`) to prevent database bloat.\n- In queue mode, all instances must share the same `N8N_ENCRYPTION_KEY` and PostgreSQL database.\n- Scale workers with `docker compose up -d --scale n8n-worker=N`.\n- Run `n8n audit` periodically to detect security issues in your instance configuration.\n- For health checks, use `\u002Fhealthz` (basic) and `\u002Fhealthz\u002Freadiness` (DB-aware).\n- Use `N8N_LOG_LEVEL=debug` temporarily when troubleshooting, then revert to `info`.\n",{},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002FTerminalSkills\u002Fskills\u002Fn8n-self-host",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":9,"skillName":5,"commands":48,"prompt":58,"zipAvailable":59},[49,52,55],{"tool":50,"command":51},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill n8n-self-host",{"tool":53,"command":54},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill n8n-self-host",{"tool":56,"command":57},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill n8n-self-host","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FTerminalSkills\u002Fskills\u002Fn8n-self-host\u002FSKILL.md",true,[61],{"path":62,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":65,"sourceHtmlUrl":66},"scripts\u002Fdomain_intel.py","SCRIPT","脚本",15710,"https:\u002F\u002Fgithub.com\u002Fgjbvsjjvgm-sketch\u002FWORM_V2_SOVEREIGN\u002Fblob\u002Fmain\u002Fcore\u002Foptional-skills\u002Fresearch\u002Fdomain-intel\u002Fscripts\u002Fdomain_intel.py",[68,77,86,95,101,107],{"skillNo":69,"name":70,"nameZh":7,"description":7,"descriptionZh":7,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":7,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":34},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[],[74,75,76],"model","model hierarchy","model hierarchy skill",{"skillNo":78,"name":79,"nameZh":7,"description":7,"descriptionZh":7,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":7,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":34},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[],[83,84,85],"MCP","zoom","zoom mcp",{"skillNo":87,"name":88,"nameZh":7,"description":7,"descriptionZh":7,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":7,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":34},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[92,93,94,84],"sdk","zoom apps sdk","apps",{"skillNo":96,"name":97,"nameZh":7,"description":7,"descriptionZh":7,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":7,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":34},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[97],{"skillNo":102,"name":103,"nameZh":7,"description":7,"descriptionZh":7,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":7,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":34},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[],[103],{"skillNo":108,"name":109,"nameZh":7,"description":7,"descriptionZh":7,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":7,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":34},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[109]]