Updated: 28 September 2026 · Applies to: n8n 2.40 (Docker Compose)

n8n releases a new minor version almost every week. Update regularly (n8n suggests at least once a month) so that you never have to jump many versions at once. Always make a backup first: How to back up and restore n8n (workflows, credentials and encryption key)?.

Stable or beta?

The stable version is meant for production. Beta is the newest release and may be unstable. The image n8nio/n8n is the stable one. At the time of writing n8n's stable release is 2.40.

Before you update

  1. Make a backup of the n8n data (How to back up and restore n8n (workflows, credentials and encryption key)?).
  2. Read the release notes for breaking changes, especially when you skip several versions.
  3. Note your current version: sudo docker compose exec n8n n8n --version

Update with Docker Compose

  1. Go to the folder that contains your compose.yaml:
    cd ~/n8n-compose
  2. Download the newest images:
    sudo docker compose pull
  3. Stop and remove the old containers. Your data stays in the Docker volumes:
    sudo docker compose down
  4. Start the new version:
    sudo docker compose up -d
  5. Watch the start and check the version:
    sudo docker compose logs -f n8n
    sudo docker compose exec n8n n8n --version
  6. Open n8n and check that your workflows and credentials are in place. Run an important workflow once to test it.

Do not use docker compose down -v: the -v option deletes the volumes and with them all your data.

Update a single docker run container

docker pull n8nio/n8n
docker stop n8n
docker rm n8n

Then start it again with the same docker run options, including the volume -v n8n_data:/home/node/.n8n.

Use a fixed version

To choose the version yourself, put it in the image line and update by changing the number:

image: n8nio/n8n:2.40.7

This way a pull never brings a version you have not chosen. The version numbers are listed in the release notes.

If something breaks after the update

  1. Read the log: sudo docker compose logs --tail 100 n8n
  2. Set the previous version in the image line and run sudo docker compose up -d. Note that a newer version may already have changed your database; if the old version does not start, restore the backup you made before the update.

Frequently asked questions

Will I lose my workflows?
No, as long as the n8n_data volume (and your PostgreSQL data, if you use it) is kept. That is why the backup comes first.

Can I test an update first?
Yes. n8n recommends testing on a separate copy of your instance (its Environments feature or a second server) before you update the live one.

Do I have to update the Traefik container too?
The same docker compose pull also fetches newer Traefik images. Check its release notes for breaking changes now and then.

Official documentation: n8n documentation: Update n8n.

Need a server for n8n, or a hand with the setup?

Prefer a hand with the setup? Our engineers can do it for you: Hire an Expert, or use our on-demand server management.

Was this answer helpful? 0 Users Found This Useful (0 Votes)