Upgrade n8n version on docker

Hello everyone,

I have n8n installed on my Docker, but I am having trouble updating the version while keeping my data such as workflows, executions, etc.
Is there anyone with experience in this who can guide me?

Here are the commands I am running:

sudo apt install docker.io
sudo docker volume create n8n_data
sudo docker run -it --rm --name n8n -p 5678:5678 -v n8n_data:/home/node/.n8n docker.n8n.io/n8nio/n8n

sudo docker run -d --restart unless-stopped -it --name n8n -p 5678:5678 -e N8N_SECURE_COOKIE=false -e N8N_HOST=“n8n.laizy.io” -e VUE_APP_URL_BASE_API=“https://n8n.laizy.io/” -e WEBHOOK_TUNNEL_URL=“https://n8n.laizy.io/” -e WEBHOOK_URL=“https://n8n.laizy.io/” -v ~/.n8n:/root/.n8n n8nio/n8n

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hey @TomLaizy , there are a few things to point out.

If you were using the volume n8n_data before, you would just reuse the very same volume. No need to create it again. Using the same volume should allow you retaining the very same workflows and credentials. However, it is a different matter if your current instance uses a different volume or even a local filesystem.

In order to upgrade, you need to point out to the version you want to upgrade to. For example, this command indicates that you want to spin up the latest version of n8n

sudo docker run -it --rm --name n8n -p 5678:5678 \
  -v n8n_data:/home/node/.n8n docker.n8n.io/n8nio/n8n:latest
#    ^^^^^^^^ (reusing existing volume)               ^^^^^^ (latest version)
2 Likes