Skip to main content

Self update Docker-based n8n with email approval and SSH

Workflow preview

Workflow preview
100%
Self update Docker-based n8n with email approval and SSH preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

n8n Self Updater Workflow 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, Hetzn...

Best for

  • DevOps automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.scheduletrigger, n8n-nodes-base.if, n8n-nodes-base.ssh, n8n-nodes-base.noop, n8n-nodes-base.emailsend, n8n-nodes-base.httprequest, n8n-nodes-base.set

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Muhammad Anas Farooq.

Original n8n.io source

1.1 Workflow description

Title
Self update Docker-based n8n with email approval and SSH
Workflow name
Self update Docker-based n8n with email approval and SSH

n8n Self-Updater Workflow

> 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.


How It Works

  1. Trigger: The workflow runs automatically every 3 days at 4 PM UTC (or manually if triggered).

  2. Check Version: It retrieves your current n8n Docker version and image digest via SSH.

  3. Compare: Fetches the remote digest from Docker Hub and compares it with the local one.

  4. Notify via Email: If a new update is available, an approval email is sent with details:

    • Current version
    • Local digest
    • Remote digest
    • What will happen after approval
  5. Approval Logic:

    • Approve → Workflow connects via SSH and updates the n8n container automatically.
    • Decline → Workflow ends; next check occurs in the next cycle.
  6. 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.


Requirements

  • SSH Access to your server (where n8n runs).

    • Add your credentials in n8n under Credentials → SSH Password.
  • SMTP Connection for email notifications.

    • Configure in Credentials → SMTP.

    • Fill in:

  • Docker-based n8n Deployment, e.g., n8n-docker-caddy setup.

  • Docker and docker-compose installed on the server.


How to Use

  1. Import the Workflow:

    • Copy the provided JSON file.
    • In your n8n instance → click Import Workflow → paste the JSON.
  2. Set Up Credentials:

    • Create two credentials in n8n:

      • SSH Password → Your server's SSH credentials.
      • SMTP → Your email provider's SMTP credentials.
  3. Edit the Email Node:

  4. Enable Auto Trigger (optional):

    • Go to the Schedule Trigger node and set your desired interval/time.
  5. Run the Workflow:

    • Test manually first.
    • Once verified, activate it for automatic checks.

Notes

  • Originally designed for DigitalOcean VPS setups, but can run on any Docker-based n8n server.
  • The workflow avoids duplicate updates by comparing digests instead of version tags.
  • If the update_docker.sh file already exists, it reuses it safely.
  • Approval emails include full details for transparency.
  • Background execution ensures no interruptions during restart.

Example Behavior

  • Day 1: Workflow checks → detects update → sends email → user approves.
  • 30 seconds later: Workflow runs update script → n8n restarts with latest Docker image.
  • Day 4: Workflow checks again → digests match → silently completes (no email sent).

Author: Muhammad Anas Farooq

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Sticky Note 1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 2 - Schedule Trigger

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.2

Block 3 - If No Changes

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 4 - Check Existence of Update Script

Type / Role
n8n-nodes-base.ssh - ssh
Config choices
Version 1

Block 5 - If File Exists

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 6 - Create Update Script

Type / Role
n8n-nodes-base.ssh - ssh
Config choices
Version 1

Block 7 - If Approved

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 8 - No Updates

Type / Role
n8n-nodes-base.noOp - noOp
Config choices
Version 1

Block 9 - Do Nothing

Type / Role
n8n-nodes-base.noOp - noOp
Config choices
Version 1

Block 10 - Ask For Approval to Update

Type / Role
n8n-nodes-base.emailSend - emailSend
Config choices
Version 2.1

Block 11 - Sticky Note - Auto Update

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 12 - Sticky Note - Script Logic

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 13 - Sticky Note - Final Execution

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 14 - Execute Update Script

Type / Role
n8n-nodes-base.ssh - ssh
Config choices
Version 1

Block 15 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 16 - Get Local Image Digest

Type / Role
n8n-nodes-base.ssh - ssh
Config choices
Version 1

Block 17 - Get Remote Image Digest

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 18 - Sticky Note 9

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 19 - Prepare Update Data

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 20 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 21 - Sticky Note 2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 22 - Sticky Note 4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 23 - Get Current n8n Version

Type / Role
n8n-nodes-base.ssh - ssh
Config choices
Version 1

Block 24 - Sticky Note 5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Showing the first 24 of 27 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Self update Docker-based n8n with email approval and SSH
Complexity advanced
Nodes 27
Categories DevOps
Author Muhammad Anas Farooq
Published 03 Nov 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/10471/10471.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Self update Docker-based n8n with email approval and SSH do?

n8n Self Updater Workflow 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, Hetzn...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your DevOps use case.