Das Projekt installiert und konfiguriert einen vollständigen, produktionsnahen n8n-Stack auf einem Ubuntu-Linux-System.
- Shell 100%
- Inline SQL-Expressions statt queryParams (Postgres-Node-Kompatibilität) - CTE-Query garantiert immer eine Zeile (verhindert Abbruch bei neuer Session) - Delete-Workflow ebenfalls auf inline SQL umgestellt Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| compose | ||
| docs | ||
| imports/workflows | ||
| scripts | ||
| .env.example | ||
| .gitignore | ||
| BEDIENUNGSANLEITUNG.md | ||
| CLAUDE.md | ||
| INITIAL_PROMPT.md | ||
| README.md | ||
n8n Stack
Produktionsnaher n8n-Stack auf Docker Compose mit PostgreSQL 16, Redis 7 und Queue-Mode.
Architektur
Internet → n8n.linix.de:443
→ YunoHost (192.168.179.10) — TLS-Terminierung (Let's Encrypt)
→ nginx lokal :8088 (192.168.179.124)
→ n8n Docker :5678
↔ PostgreSQL (n8n-stack-postgres-1)
↔ Redis (n8n-stack-redis-1)
← n8n-worker (n8n-stack-n8n-worker-1)
YunoHost-SSOwat-Bypass: my_webapp als registrierter Platzhalter, nginx-Proxy-Block in
/etc/nginx/conf.d/n8n.linix.de.d/my_webapp.conf (wird durch Hook 99-n8n-proxy
nach Upgrades automatisch wiederhergestellt).
Verzeichnisstruktur
n8n_stack/
├── compose/docker-compose.yml # Stack-Definition
├── .env # Secrets (600, nie committen!)
├── .env.example # Vorlage
├── scripts/ # Hilfsskripte (700)
│ └── yunohost-hook-restore-n8n-proxy.sh # Hook-Vorlage für YunoHost
├── data/ # Docker-Volumes (gitignoriert)
├── backups/ # Backups, max. 2 (gitignoriert)
├── imports/workflows/ # Workflow-JSONs zum Importieren
├── imports/credentials/ # Credential-Exporte (unverschlüsselt!)
├── local-files/ # Dateien für n8n-Container (/files)
└── docs/ # nginx-Configs, Runbooks
Schnellstart
# Stack starten
docker compose -f compose/docker-compose.yml up -d
# Status prüfen
docker compose -f compose/docker-compose.yml ps
# Logs
docker compose -f compose/docker-compose.yml logs -f n8n
Ausführliche Bedienungsanleitung: BEDIENUNGSANLEITUNG.md
Deployment auf neuem Host
- Repo klonen
.env.example→.envkopieren, alle Werte ausfüllen- Neuen
N8N_ENCRYPTION_KEYgenerieren:openssl rand -base64 32 N8N_HOSTundWEBHOOK_URLauf neue Domain anpassen- Lokale nginx-Config aus
docs/nginx-local-n8n.confaktivieren (Port 8088) - Auf YunoHost:
my_webappinstallieren, nginx-Config durch Proxy ersetzen (siehedocs/yunohost-nginx-n8n.conf) - YunoHost-Hook deployen:
scripts/yunohost-hook-restore-n8n-proxy.sh→/etc/yunohost/hooks.d/post_app_upgrade/99-n8n-proxy docker compose -f compose/docker-compose.yml up -d
Kritische Hinweise
N8N_ENCRYPTION_KEYdarf nach dem ersten Start nie geändert werden — macht alle gespeicherten Credentials unbrauchbar..envnie committen (steht in.gitignore).- Credential-Exporte enthalten Secrets im Klartext — nach Gebrauch löschen.
- Backup läuft automatisch vor jedem Update via
update-n8n.sh.
URLs
| Was | Wert |
|---|---|
| n8n Web-UI | https://n8n.linix.de |
| Secrets-Datei | ./.env (Rechte 600) |
| nginx lokal | /etc/nginx/sites-available/n8n (Port 8088) |
| YunoHost nginx | /etc/nginx/conf.d/n8n.linix.de.d/my_webapp.conf |
| YunoHost Hook | /etc/yunohost/hooks.d/post_app_upgrade/99-n8n-proxy |