Home » n8n» n8n how to update: Docker, Node.js, VPS

Guide: n8n how to update?

This short guide shows how to update n8n and gives exact commands for Docker, Docker Compose, and Node.js on a VPS. To update n8n, back up your data, pull the new image or package, and restart the service. The steps below include commands, verification steps, and basic security advice.

What You Need

  • A VPS with SSH access.
  • Docker and docker-compose installed for Docker setups.
  • Node.js and npm or nvm if you run n8n via Node.js.
  • Access to the n8n data folder (commonly ~/.n8n) or your database credentials.

How to update n8n how to update with Docker (single container)

These commands update a single Docker container running n8n. Replace container names and volume paths to match your setup.

Step 1: Backup the data folder.

tar -czf ~/n8n-backup-$(date +%F).tar.gz ~/.n8n

Step 2: Pull the new image and recreate the container.

docker pull n8nio/n8n:latest
docker stop n8n
docker rm n8n
docker run -d --name n8n --restart unless-stopped -p 5678:5678 -v ~/.n8n:/home/node/.n8n n8nio/n8n:latest

Step 3: Verify the container is running.

docker ps --filter "name=n8n"
docker logs n8n --tail 50

How to update n8n how to update with Docker Compose

If you use docker-compose, update by pulling and restarting the service. This keeps your compose config unchanged.

Step 1: Backup the data folder.

tar -czf ~/n8n-backup-$(date +%F).tar.gz ~/.n8n

Step 2: Pull the image and restart via compose.

cd /path/to/compose
docker-compose pull n8n
docker-compose up -d --remove-orphans

Step 3: Confirm the service is healthy.

docker-compose ps
docker-compose logs n8n --tail=50

How to update n8n how to update with Node.js (npm)

If you installed n8n using npm globally, update with npm. Use nvm to manage Node versions if needed.

Step 1: Optional – ensure Node LTS via nvm.

nvm install --lts
nvm use --lts

Step 2: Update n8n via npm.

npm install -g n8n

Step 3: Restart the n8n service or process manager (systemd, pm2, or similar).

# systemd example
sudo systemctl restart n8n
# pm2 example
pm2 restart n8n

Step-by-step logic

  • 1. Back up the n8n data and any external database. Use tar for folder backups and pg_dump for Postgres.
  • 2. Pull the new image or update the package so binaries are current.
  • 3. Stop and remove the old container if using Docker, then start the new one.
  • 4. Check logs and test a few key workflows in the UI to confirm behavior.
  • 5. Roll back if the update causes problems using the backup or previous image tag.

Update

Keep a stable update routine. Check n8n release notes for breaking changes before updating. For production, test on a staging server first. Use tagged images like n8nio/n8n:0.200.0 when you need fixed versions.

# example using a specific tag
docker pull n8nio/n8n:0.200.0
docker run -d --name n8n -p 5678:5678 n8nio/n8n:0.200.0

Security

Keep secrets out of compose files. Use environment variables or Docker secrets. Run n8n behind HTTPS and a reverse proxy. Limit SSH and update the VPS OS regularly.

Rotate API keys and webhook secrets after major updates. If you use a database, use secure connections and restrict DB network access.

Done

After you update, verify workflows run and the UI is reachable. Keep one backup per release window for quick rollback. Follow security advice to reduce risk.


Neil
Written by Neil

Neil is a true n8n geek who lives and breathes workflow automation. He dives deep into nodes, triggers, webhooks, custom logic, and self-hosting setups, sharing everything he learns about n8n on AutomationCompare.com. As part of a broader team of automation specialists, Neil focuses purely on mastering n8n and helping others unlock its full potential.

Keep Reading

Scroll to Top