Loader

How to Update n8n Without Losing Data (Docker Guide)

Updating n8n should be boring. Follow this routine: back up, read the release notes, update, verify, and know how to roll back.

  • Back up first
  • Pin and update versions
  • Verify and roll back
How to Update n8n Without Losing Data (Docker Guide)
  • 26 October 2026
  • by Admin

How to Update n8n Without Losing Data (Docker Guide)

n8n releases new versions often. Updates bring fixes, security patches and new nodes, but they can also change behaviour. A short routine keeps your workflows safe.

Step 1: back up before you touch anything

Dump the database and copy your environment file, including the encryption key. Follow our backup guide. If something goes wrong, this is how you go back.

cd ~/n8n
mkdir -p ~/backups
docker compose exec -T postgres pg_dump -U n8n n8n | gzip > ~/backups/pre-update-$(date +%F).sql.gz
cp .env ~/backups/env-$(date +%F).bak

Step 2: read the release notes

Open the n8n release notes for every version between yours and the target. Look for breaking changes, removed nodes, renamed settings and new required environment variables. This takes five minutes and prevents most surprises.

Step 3: pin the version you want

In your docker-compose.yml, use a specific version tag instead of latest.

n8n:
  image: docker.n8n.io/n8nio/n8n:1.XX.X   # replace with the version you chose

Pinning means updates happen only when you decide, and you always know what is running.

Step 4: pull and restart

docker compose pull
docker compose up -d
docker compose logs -f n8n

Watch the logs. n8n may run database migrations on the first start, so give it a minute.

Step 5: verify

  • Open the editor and check that you can log in.
  • Open two or three important workflows and run them manually.
  • Check that scheduled workflows and webhooks still trigger.
  • Look at the Executions list for new errors.

Rolling back

If the new version causes trouble, set the previous version tag in the compose file and restart. Be careful: after a database migration, an older version may not start on the newer database. In that case restore the pre-update dump, as shown in the backup guide, then start the older version.

How often to update

  • Security fixes: as soon as you can.
  • Regular releases: every few weeks, or monthly for stable setups.
  • Major versions: test on a copy first, using a second small server or a local Docker setup.

Updates are also part of keeping your server safe. See our n8n security checklist. If you would rather not handle updates, managed n8n hosting patches the server, OS and Docker for you, while you stay in control of when n8n itself is updated.

We patch the server, OS and Docker for you. You choose when n8n updates.

Explore Managed n8n Hosting

Frequently asked questions

  • Will updating n8n delete my workflows?
    Not if your data lives in a Docker volume or Postgres database, which it should. Still, always take a backup first.
  • Should I use the latest tag?
    For production, pin a specific version and update on purpose.
  • Can I downgrade n8n?
    Sometimes, but database migrations may stop an older version from starting. Keep a pre-update backup so you can restore.