Automation script to Self-Hosting n8n with Docker Compose (both single and queue mode) and Monitoring with Prometheus & Grafana

Hi Guys,

When I first tried to self-host n8n on a VPS, I ran into the usual maze: Docker basics, TLS/Traefik, DNS, PostgreSQL, Redis, backups… lots of moving parts. The official guides (e.g., DigitalOcean setup) are helpful but a bit high-level for a complete, production-ready stack.

After digging through countless GitHub repos with partial docker-compose examples, I still couldn’t find a full lifecycle solution—install → upgrade → backup/restore → cleanup → monitoring—all in one place.

So I spent about a month (nights & weekends) building a script that does exactly that.

:backhand_index_pointing_right: GitHub: https://github.com/thenguyenvn90/n8n-toolkit

What the script (n8n Manager) gives you

  • :hammer_and_wrench: One script, all tasks: install, upgrade, backup/restore, cleanup, and monitoring—Single or Queue mode.

  • :bar_chart: Built-in observability: add --monitoring to auto-provision Prometheus + Grafana with preloaded dashboards & alert rules.

  • :locked: Secure by default: Traefik + Let’s Encrypt (auto-renew), strong secrets, HTTPS everywhere; Basic Auth in front of Grafana/Prometheus.

  • :floppy_disk: Resilient data: PostgreSQL + persistent volumes; deterministic restores preserve workflows & credentials.

  • :brain: Change-aware backups: skip when nothing changed (use -f to force). Store locally or upload to Google Drive with rclone.

  • :recycling_symbol: One-command restore: from a local file or any rclone remote; DB restore from dump or volume; post-restore health checks.

  • :envelope: Email notifications: daily backup failures trigger an email (optional success emails).

If you’ve been piecing this together by hand, I hope this saves you a ton of time—and a few headaches. Contributions and feedback are very welcome!

You can check my detailed guides here:

Self-Hosting n8n Made Easy: The Complete Guide to Install, Upgrade, Backup, Restore and Monitoring (single mode): Self-Host n8n Automation: Install, Upgrade, Backup & Restore

Scaling n8n with Queue Mode: Automated Deployment Script: Scaling n8n with Queue Mode: Automated Deployment Script

n8n Monitoring with Prometheus & Grafana on Docker Compose (Traefik, Exporters) — with One-Script Automation: n8n Monitoring with Prometheus & Grafana (Docker Compose)

The next step maybe I will add the secure tunel, follow this guide: Securely Self-Hosting n8n with Docker & Cloudflare Tunnel.