Seamlessly update your n8n Docker Compose instance on a remote server using GitHub Actions — automatically or with a click. Perfect for devs, teams, and solo automators.
This is a ready-to-use GitHub Actions workflow that connects to your remote server via SSH and runs docker compose pull && down && up -d
to update your self-hosted n8n instance.
- 🧠 Smart: no scripts to write
- 🖱️ One-click: run from GitHub UI
- 🔁 Auto-update: runs on push to
main
(or your preferred branch) - 🔐 Secure: SSH key-based authentication
Just want it to work? Clone this repo and go:
git clone https://github.com/wmbalex/n8n-docker-updater.git
cd n8n-docker-updater
- Go to GitHub ➔ Create a new repo (Public or Private)
- Push this code to your own GitHub repo:
git remote set-url origin [email protected]:YOUR_USERNAME/n8n-docker-updater.git
git push -u origin main
- Add GitHub Secrets (see below)
- Hit "Run Workflow" → Done 🎉
Once you've added the required GitHub secrets, head to the Actions tab and:
- Select the
Deploy n8n
workflow - Click
Run workflow
- Watch it update your n8n container in seconds! 🚀
n8n-docker-updater/
├── README.md
└── .github/
└── workflows/
└── deploy.yml
- GitHub Actions uses a private SSH key to connect to your server
- It runs
docker compose
commands to update your n8n container - You trigger it manually or when pushing code/config changes to your repo
- Docker & Docker Compose installed
- n8n running via Docker Compose (e.g. from n8n-io/n8n/docker-compose)
- Public SSH key added to
~/.ssh/authorized_keys
- Use this repo or copy
.github/workflows/deploy.yml
- Add your secrets (see next section)
On your local machine:
ssh-keygen -t ed25519 -C "github-actions-deploy" -f github_n8n_deploy_key
- Save the private key (for GitHub)
- Add the public key to your server:
~/.ssh/authorized_keys
Go to your repo ➔ Settings > Secrets and variables > Actions ➔ Add these:
Name | Value |
---|---|
N8N_SERVER_IP |
Your server IP address (e.g. 123.123.12.12 ) |
N8N_SERVER_USER |
SSH user (e.g. root or ubuntu ) |
N8N_DEPLOY_KEY |
Contents of the private SSH key you just generated |
- Go to Actions tab
- Select Deploy n8n workflow
- Click Run workflow
- Push any commit to
main
(or configured branch) - Workflow will run and update your n8n instance
If you followed n8n's Docker guide, your layout might look like:
/root/n8n/
├── docker-compose.yml
├── .env
└── data/
Make sure the workflow cd
s into the correct folder (/root/n8n
or wherever you host it).
- ✅ Use a dedicated SSH key just for GitHub Actions
- ✅ Restrict the key to a non-root user with limited privileges
- 🛑 Never commit your private key
- 🕓 Add a cron trigger for scheduled auto-updates (optional)
- 🔔 Add Telegram/Slack notifications with a second step (advanced)
Here are a few cool future ideas you (or contributors) might develop:
- 📆 Scheduled nightly updates (cron job)
- 🔔 Telegram/Slack/Webhook notifications after update
- 💥 Docker Compose fallback auto-recovery if update fails
- ✅ Workflow status badge for GitHub README
- 🌐 Multi-environment support (dev/staging/prod)
- 📈 Metrics log to track uptime/deploys (e.g. with Google Sheets or InfluxDB)
- 🌙 Dark/light themed logs with output formatting
Have a feature idea? Open an issue or submit a PR 🚀
PRs welcome! This updater is a helpful companion to n8n-io/n8n, not an official project.
If this saved you time or headaches, consider supporting the project 💖
→ Never donate $10 in Crypto to anybody
Your support keeps open-source flowing 🙏
Made with ❤️ by @wmbalex