All modules
Module 12 · ship · advanced
Self-hosting and Client Delivery
After this module you can run n8n in production for yourself or a client: HTTPS, Postgres, backups, monitoring, and a clean handoff.
What it does
deploy/: a production stack:docker-compose.prod.yml(Postgres 17 + n8n + Caddy with automatic HTTPS),Caddyfile,.env.example, a nightlybackup.sh(workflows, encrypted credentials, database dump, rotation), and ahandoff-checklist.mdfor client projects.- Uptime Monitor workflow: every 5 minutes (or
GET /webhook/ops/health), checks a list of URLs and reports which are down. The API returns 200 when all are up and 503 with reasons otherwise, so external monitors can use it too.
Flow
Every 5 Minutes ─┐
Health API ──────┴→ Sites to Check → One Item per Site → Check Site (never errors) → Evaluate → All Checks → Summary
→ Called via API? → Respond (200/503)
└→ Anything Down? → Send Alert
Verification status (all on n8n 2.43.6)
- Uptime Monitor: 200 when up, 503 + error message when a site is down (5/5 checks).
- Production stack: started locally (Postgres 17 + n8n + Caddy on
https://localhost),/healthzreturned 200 through Caddy, no Postgres version warning. Postgres 16 triggered "outside the supported range", hence 17. backup.sh: workflow export, database dump, archive and rotation ran on that test stack. The credential-export line was not executed during testing (syntax checked only).- Compose config, Caddyfile and script syntax validated by
./test/test.sh.
Files
| File | Tier | Purpose |
|---|---|---|
| lesson.md | Free | Deploy to a VPS step by step |
| workflow/starter.json | Free | Monitor triggers + settings |
| workflow/learner.json | Learner | Uptime Monitor |
| deploy/ | Learner | Production compose, Caddyfile, env template, backup script |
| deploy/handoff-checklist.md | Learner | Client delivery checklist |
| exercises.md | Learner | Practice tasks |
| solutions.md | Learner | Exercise solutions |
| notes.md | Private | Learning log |
| sell/ | Private | Offer, video script, blog post |