How to Update n8n using Docker Compose?

Updating n8n with Docker Compose is essential for the latest features and security. In this guide, we’ll show you how to easily pull the latest image, update your containers, and keep your workflows running smoothly.
How to Update n8n using docker compose?
How to Update n8n using docker compose?

It's important to keep your n8n version up to date. This ensures you get the latest features and fixes.

Update frequently: this avoids having to jump multiple versions at once, reducing the risk of a disruptive update. Try to update at least once a month.

Updating n8n

  1. Preparation for update
    1. Deactivate all workflow or ensure no workflow is executing halfway to avoid errors and maintain data integrity.
  1. Navigate to the directory where your docker-compose.yml file is located.
cd /path/to/your/docker-compose-folder
  1. Stop the Running n8n Container
sudo docker compose down
  1. Pull the latest n8n Docker image.

    This command downloads the latest version of the n8nio/n8n image specified in your docker-compose.yml file.
sudo docker compose pull
  1. Restart the Docker Compose setup to apply the update.

The -d flag runs the containers in detached mode (in the background).

sudo docker compose up -d
  1. Verify the Update

Check if n8n is running and updated by executing:

sudo docker ps
  1. (Optional) Clean Up Old Images

To free up disk space, remove unused Docker images:

sudo docker image prune -a
  1. Read the logs if error.

Check the logs to ensure n8n is running correctly.

sudo docker compose logs n8n
  1. Access the n8n web interface and verify the version:
    1. Open your browser and go to https://<your-subdomain>.<your-domain>.
    2. The version number is displayed in the bottom-left corner of the n8n interface.

Additional Notes

Backup Before Updating.

  • Before updating, it’s a good idea to back up your n8n data:
    1. Export your workflows from the n8n UI.
    2. Back up the n8n_data Docker volume (if using SQLite):
sudo docker run --rm -v n8n_data:/data -v $(pwd):/backup busybox tar cvf /backup/n8n_data_backup.tar /data

Update Docker Compose File (Optional)

If you want to pin n8n to a specific version, update the image field in your docker-compose.yml file:

n8n:
  image: docker.n8n.io/n8nio/n8n:1.76.1  # Replace with the desired version
About the author
Mr Tech King

Mr Tech King

Loves to spread positivity through the art of software and design.

Explore the AI Apps Universe

Subscribe for AI Productivity Tips & Daily Summarised Tech News

Explore the AI Apps Universe

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to Explore the AI Apps Universe.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.