You update n8n by pulling the new image and recreating the container. Your data stays, because it lives in the volume. What can go wrong is not the command: it is jumping versions without reading the notes and having no backup to go back to. Do it in this order.
The update, in order
| 1 |
Take a backup first. Data, compose file and encryption key, as in backing up n8n. When it starts on a new version, n8n may change the structure of the data, and that does not undo itself.
|
|
| 2 |
Read the release notes on the project’s site, especially if you are skipping several versions at once. That is where the changes that force you to alter workflows or variables are listed.
|
|
| 3 |
Pin a version in the compose file, instead of a tag that always moves forward. The exact tag names are on the official image page. That way you always know which version you are on and it changes only when you decide.
|
|
| 4 |
Pull and recreate with docker compose pull and docker compose up -d.
|
|
| 5 |
Check the logs with docker compose logs. Look for errors in the first moments.
|
|
| 6 |
Test the important workflows by hand, one by one: a webhook, a schedule, one credential of each kind.
|
|
What usually breaks
| Symptom |
Likely cause |
What to do |
| n8n does not start afterwards |
An old variable is no longer accepted, or the data migration failed. |
Read the logs; compare your variables with the release notes. |
| A node stopped working |
Its behaviour changed or it was replaced. |
Look the node up in the documentation for your version. |
| Credentials throw errors |
The encryption key changed, or was deleted along with the volume. |
Put the original key back. |
| Webhooks do not answer |
The new container lost WEBHOOK_URL. |
Restore the variable. See n8n webhooks. |
|
Going back is not always just changing the version. If the new version already altered the structure of the data, returning to the old one may not work. The safe road is to restore the backup you took at the start and start the old version.
|
When to update
Update from time to time, without hurry, but do not let it drift too long. An installation left alone for a long time piles up known security flaws and makes the next jump riskier. Do it outside the hours when your important workflows run, and with time to test them. The general method for any application in Docker is in updating a Docker application without losing data.
|
If you have critical workflows, rehearse the update on a copy: restore your backup on a second VPS or in a separate folder, update there, and only then do the real one. Also free up disk space: Docker filling the disk.
|
RECOMMENDED PRODUCT Web hosting with cPanel Domain and SSL included, daily backups and the panel you already know. from 5.940,00 Kz/mo (3-year plan, with coupon) See plans |