Skip to main content
Photo of DeepakNess DeepakNess

Updating self-hosted n8n

Unproofread notes

I hadn't updated my self-hosted n8n instance for over 6 months, so I decided to do it today and didn't realize it was this easy. I just ran a bunch of commands, and it was successfully updated:

  1. sudo apt update && sudo apt upgrade – refresh package lists and install OS updates on the server.
  2. docker pull docker.n8n.io/n8nio/n8n – download the newest n8n image.
  3. docker ps -a – list all containers so you can see the n8n container ID and name.
  4. docker stop [CONT_ID] – stop the old n8n container.
  5. docker rm [CONT_ID] – remove the stopped n8n container.
  6. cd n8n-docker-caddy/ – go into the folder that has your docker-compose.yml.
  7. docker compose pull – fetch the latest images defined in docker-compose.yml for both n8n and Caddy.
  8. docker compose down – stop and remove the running Compose stack, keeping your volumes and data.
  9. docker compose up -d – start the updated stack in the background.

And done! I'm now running the latest n8n with your existing data and config.

Comment via email