Updating self-hosted n8n

I hadn't updated my self-hosted n8n instance for over 6 months (updating docs), 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 my existing data and config.

Update: Nov 06, 2026

n8n 3.0 is coming, and once it's stable, pulling the latest image as shown above can move you from 2.x to 3.x. The n8n 3.0 announcement lists the Function and Function Item nodes as removed, with the Code node as the replacement, along with other legacy nodes like Cron and Interval. Take a full backup of your instance before upgrading.

Upgrade Watch is a paid kit of workflows for self-hosted n8n that scans a 2.x instance for workflows that will stop on 3.0, then alerts you for 48 hours after the upgrade if a workflow doesn't come back. The link applies a 20% discount.

Some links here are affiliate or referral links. Buying through them supports this site at no extra cost to you, and it doesn't affect my opinions.