Guides / How to update self-hosted n8n
How to update self-hosted n8n
This guide covers Docker Compose, plain Docker and npm. The commands match n8n's own docs. The latest stable n8n right now is 2.43.7.
Before you start
- Update often. n8n's docs suggest at least once a month. Small jumps are safer than big ones.
- Read the release notes. Look for breaking changes. See the n8n release notes.
- Check for security fixes. Our patch status page lists recent n8n security advisories.
- Test first if you can. A second test instance lets you try the update before it hits your real workflows.
Step 1: Back up
n8n keeps its data in the .n8n folder (in Docker, usually a volume called n8n_data). That folder holds your encryption key. n8n uses that key to encrypt your saved credentials. If you lose it, your credentials stop working. So back it up.
- Copy the
.n8nfolder or the Docker volume somewhere safe. - If you set
N8N_ENCRYPTION_KEYyourself, save that value too. - If you use PostgreSQL, back up the database as well.
One way to back up a Docker volume:
docker run --rm -v n8n_data:/data -v "$PWD":/backup alpine \
tar czf /backup/n8n_data-backup.tar.gz -C /data . Change n8n_data if your volume has a different name. Run docker volume ls to see it.
Step 2: Update
Docker Compose
Go to the folder with your docker-compose.yml file, then run:
docker compose pull
docker compose down
docker compose up -d Docker (no Compose)
# Pull the latest stable version
docker pull n8nio/n8n
# Find your container ID
docker ps -a
# Stop and remove the old container
docker stop <container_id>
docker rm <container_id>
# Start it again with the same options you used before
docker run --name=<container_name> [options] -d n8nio/n8n Use the same volume (-v n8n_data:/home/node/.n8n) and settings as before, or n8n will start empty.
npm
npm update -g n8n Then restart n8n the way you normally run it.
Step 3: Check it works
- Open n8n and check that the version number changed. You can find it on the About screen.
- Open a few key workflows. Run one by hand.
- Check that credentials still connect.
- Look at the logs:
docker compose logs -f(Compose) ordocker logs -f <container_id>.
Pin a version (optional)
The plain n8nio/n8n image follows the latest stable release. To control when you update, pin a version in your Compose file:
image: n8nio/n8n:2.43.7 Then change the number when you are ready to update.
If something breaks
Go back to the version you had before by pinning its number and starting again. A new version can change the database. If the old version will not start after that, restore the backup from step 1.
Want updates done for you?
Some hosts update n8n for you. Check the "n8n updates" column on the comparison table, or compare self-hosting with n8n Cloud.
Sources: n8n docs on updating, Docker, npm and the encryption key. Checked 2026-10-17.
Get price drops and n8n patch alerts
One short email a week. What changed in n8n hosting, and which hosts have patched.