An automated n8n workflow originally built for DigitalOcean-based n8n deployments, but fully compatible with any VPS or cloud hosting (e.g., AWS, Google Cloud, Hetzner, Linode, etc.) where n8n runs via Docker.
This workflow checks for the latest Docker image of n8n, notifies you via email for approval, and securely updates your n8n instance via SSH once approved.
Trigger: The workflow runs automatically every 3 days at 4 PM UTC (or manually if triggered).
Check Version: It retrieves your current n8n Docker version and image digest via SSH.
Compare: Fetches the remote digest from Docker Hub and compares it with the local one.
Notify via Email: If a new update is available, an approval email is sent with details:
Approval Logic:
Auto Update Execution:
Creates (if missing) a update_docker.sh script on the server.
Runs it in the background (nohup) to:
cd /opt/n8n-docker-caddy
docker compose pull
docker compose down
docker compose up -d
The delay ensures n8n restarts only after workflow completion.
SSH Access to your server (where n8n runs).
SMTP Connection for email notifications.
Configure in Credentials → SMTP.
Fill in:
[email protected]Docker-based n8n Deployment, e.g., n8n-docker-caddy setup.
Docker and docker-compose installed on the server.
Import the Workflow:
Set Up Credentials:
Create two credentials in n8n:
SSH Password → Your server's SSH credentials.SMTP → Your email provider's SMTP credentials.Edit the Email Node:
Replace:
fromEmail: [email protected] → with your email.toEmail: [email protected] → with your desired recipient.Enable Auto Trigger (optional):
Run the Workflow:
update_docker.sh file already exists, it reuses it safely.Author: Muhammad Anas Farooq