Skip to main content
RapidDev - Software Development Agency
n8n-tutorial

How to Update n8n to the Latest Version Safely

Update n8n by running npm update -g n8n for npm installs or docker pull docker.n8n.io/n8nio/n8n for Docker. Always update incrementally through major versions to avoid breaking changes. Check your current version with n8n --version before updating and review the release notes for migration steps.

What you'll learn

  • How to check your current n8n version and compare it with the latest release
  • How to update n8n via npm and Docker safely
  • How to handle major version upgrades incrementally without data loss
Book a free consultation
4.9Clutch rating
600+Happy partners
17+Countries served
190+Team members
Beginner7 min read10-15 minutesn8n 1.0+, npm or Docker installationsMarch 2026RapidDev Engineering Team
TL;DR

Update n8n by running npm update -g n8n for npm installs or docker pull docker.n8n.io/n8nio/n8n for Docker. Always update incrementally through major versions to avoid breaking changes. Check your current version with n8n --version before updating and review the release notes for migration steps.

How to Update n8n to the Latest Version

Keeping n8n up to date ensures you have the latest nodes, bug fixes, security patches, and performance improvements. The update process differs depending on whether you installed n8n via npm or Docker. The most important rule is to never skip major versions — always update incrementally (e.g., from 0.x to 1.0, then 1.0 to 1.x) to ensure database migrations run correctly.

Prerequisites

  • A running n8n instance installed via npm or Docker
  • Access to the terminal or command line on your server
  • A backup of your n8n database and workflows before updating
  • Node.js 18+ installed if using npm

Step-by-step guide

1

Check your current n8n version

Before updating, you need to know which version you are running. This determines whether you can jump straight to the latest version or need to update incrementally through major releases. Run the version check command and compare the output with the latest release on the n8n GitHub releases page or npm registry.

typescript
1# For npm installations
2n8n --version
3
4# For Docker installations
5docker exec <container_name> n8n --version
6
7# Check the latest available version on npm
8npm view n8n version

Expected result: You see your current version number printed in the terminal, such as 1.42.0, and can compare it to the latest available version.

2

Back up your data before updating

Always create a backup before updating n8n, especially before major version upgrades. If you are using the default SQLite database, back up the .n8n folder in your home directory. For PostgreSQL, create a database dump. This ensures you can roll back if something goes wrong during the update.

typescript
1# Back up the .n8n directory (SQLite)
2cp -r ~/.n8n ~/.n8n-backup-$(date +%Y%m%d)
3
4# Back up PostgreSQL database
5pg_dump -U n8n_user -d n8n_db > n8n_backup_$(date +%Y%m%d).sql
6
7# For Docker with a named volume
8docker run --rm -v n8n_data:/data -v $(pwd):/backup alpine tar czf /backup/n8n_data_backup.tar.gz /data

Expected result: A timestamped backup of your n8n data directory or database is created and stored safely.

3

Update n8n via npm

If you installed n8n globally via npm, updating is a single command. For minor and patch updates within the same major version, you can update directly. For major version jumps, you must update to the last release of each major version first, then move to the next major version. This ensures all database migrations run in the correct order.

typescript
1# Update to the latest version (same major)
2npm update -g n8n
3
4# Update to a specific version (for incremental major upgrades)
5npm install -g n8n@1.0.0
6
7# After installing, restart n8n
8n8n start

Expected result: npm downloads and installs the specified n8n version. When you run n8n start, the new version launches and any pending database migrations run automatically.

4

Update n8n via Docker

For Docker installations, pull the latest image and recreate the container. Make sure your workflow data is stored in a Docker volume or an external database so it persists across container restarts. If you need to update incrementally, pull a specific tag instead of latest.

typescript
1# Pull the latest n8n Docker image
2docker pull docker.n8n.io/n8nio/n8n
3
4# Pull a specific version for incremental updates
5docker pull docker.n8n.io/n8nio/n8n:1.0.0
6
7# Stop and remove the old container
8docker stop n8n && docker rm n8n
9
10# Start a new container with the updated image
11docker run -d --name n8n \
12 -p 5678:5678 \
13 -v n8n_data:/home/node/.n8n \
14 docker.n8n.io/n8nio/n8n

Expected result: The new container starts with the updated n8n version. Open http://localhost:5678 and verify the version number in the bottom-left corner of the n8n UI.

5

Verify the update and test workflows

After updating, confirm the new version is running and test your critical workflows. Open the n8n editor, check the version number displayed in the UI footer, and manually execute your most important workflows to confirm they still work correctly. Pay attention to any deprecation warnings in the execution output.

typescript
1# Verify version from command line
2n8n --version
3
4# Check the n8n health endpoint
5curl http://localhost:5678/healthz

Expected result: The version command returns the expected new version number. Your test workflows execute successfully without errors. The health endpoint returns a 200 OK response.

Complete working example

update-n8n.sh
1#!/bin/bash
2# n8n Update Script safe incremental update with backup
3
4set -e
5
6echo "=== n8n Update Script ==="
7
8# Step 1: Check current version
9CURRENT_VERSION=$(n8n --version 2>/dev/null || echo "not installed")
10echo "Current n8n version: $CURRENT_VERSION"
11
12# Step 2: Check latest available version
13LATEST_VERSION=$(npm view n8n version)
14echo "Latest n8n version: $LATEST_VERSION"
15
16if [ "$CURRENT_VERSION" = "$LATEST_VERSION" ]; then
17 echo "Already on the latest version. No update needed."
18 exit 0
19fi
20
21# Step 3: Back up the .n8n directory
22BACKUP_DIR="$HOME/.n8n-backup-$(date +%Y%m%d-%H%M%S)"
23echo "Creating backup at $BACKUP_DIR"
24cp -r "$HOME/.n8n" "$BACKUP_DIR"
25echo "Backup created successfully."
26
27# Step 4: Stop n8n if running as a service
28if systemctl is-active --quiet n8n 2>/dev/null; then
29 echo "Stopping n8n service..."
30 sudo systemctl stop n8n
31fi
32
33# Step 5: Update n8n
34echo "Updating n8n to version $LATEST_VERSION..."
35npm update -g n8n
36
37# Step 6: Verify the update
38NEW_VERSION=$(n8n --version)
39echo "Updated to n8n version: $NEW_VERSION"
40
41# Step 7: Restart n8n service if it was running
42if systemctl is-enabled --quiet n8n 2>/dev/null; then
43 echo "Restarting n8n service..."
44 sudo systemctl start n8n
45 echo "n8n service restarted."
46fi
47
48echo "=== Update complete ==="
49echo "Backup location: $BACKUP_DIR"
50echo "Please test your workflows to confirm everything works."

Common mistakes when updating n8n to the Latest Version Safely

Why it's a problem: Skipping major versions during update (e.g., jumping from 0.200 to 1.30)

How to avoid: Update to the last release of each major version first (e.g., 0.x → 1.0.0 → 1.x latest), then proceed to the next major version so all database migrations run in order.

Why it's a problem: Not backing up before updating and losing workflow data

How to avoid: Always run a backup of your .n8n directory or database dump before any update. Store the backup in a separate location from your server.

Why it's a problem: Using docker pull without recreating the container

How to avoid: After pulling a new image, you must stop and remove the old container, then create a new one. The existing container still uses the old image until replaced.

Why it's a problem: Updating n8n while workflows are actively executing

How to avoid: Wait for all running executions to complete or pause them before updating. Interrupted executions may leave data in an inconsistent state.

Best practices

  • Always back up your database and .n8n directory before updating, especially before major version upgrades
  • Update incrementally through major versions — never skip from 0.x directly to the latest 1.x release
  • Read the release notes and changelog for each major version to understand breaking changes
  • Test your critical workflows immediately after updating to catch any compatibility issues early
  • Pin your Docker image to a specific version tag in production instead of using latest
  • Schedule updates during low-traffic periods when workflows are not actively executing
  • Keep your Node.js version up to date — n8n requires Node.js 18 or higher

Still stuck?

Copy one of these prompts to get a personalized, step-by-step explanation.

ChatGPT Prompt

I need to update my n8n instance from version [CURRENT] to the latest version. I installed it via [npm/Docker]. What is the safest step-by-step process including backup and incremental major version updates?

n8n Prompt

Help me write a shell script that checks my current n8n version, creates a backup, and updates to the latest version safely with rollback support.

Frequently asked questions

Can I skip major versions when updating n8n?

No. You must update incrementally through each major version. For example, if you are on version 0.236, first update to 1.0.0, then to the latest 1.x release. Skipping major versions can cause database migration failures and data loss.

Will updating n8n delete my workflows?

No, updating n8n preserves your workflows and credentials as long as your data is stored in a persistent location such as the .n8n directory or an external PostgreSQL database. Always back up before updating as a precaution.

How do I roll back to a previous n8n version?

For npm, install the specific version with npm install -g n8n@VERSION. For Docker, pull the specific tag with docker pull docker.n8n.io/n8nio/n8n:VERSION. Restore your database backup before starting the older version to avoid migration conflicts.

How often should I update n8n?

Check for updates monthly. Apply security patches immediately. For major version updates, wait a week after release for any hotfixes, then update during a maintenance window.

Do I need to update community nodes separately?

Yes. Community nodes are managed independently. After updating n8n, go to Settings, then Community Nodes to check for available updates. Some community nodes may need updates to remain compatible with the new n8n version.

What happens if an update fails halfway through?

If the update process is interrupted, restore your backup and try again. For npm, reinstall the previous version with npm install -g n8n@PREVIOUS_VERSION. For Docker, run the container with the previous image tag.

RapidDev

Talk to an Expert

Our team has built 600+ apps. Get personalized help with your project.

Book a free consultation

Need help with your project?

Our experts have built 600+ apps and can accelerate your development. Book a free consultation — no strings attached.

Book a free consultation

We put the rapid in RapidDev

Need a dedicated strategic tech and growth partner? Discover what RapidDev can do for your business! Book a call with our team to schedule a free, no-obligation consultation. We'll discuss your project and provide a custom quote at no cost.