- 70 Views
- 06/12/2025
How to upgrade n8n version using dockerfile
To update n8n when you're running it using a Dockerfile + docker-compose, you have two options depending on whether you're building your own image or using the official n8n image.
1. If you use a custom Dockerfile (like your example)
Your docker-compose.yml shows:
build: .
Meaning it builds from Dockerfile in the same folder.
To update n8n, you must edit Dockerfile to pull a newer version.
Step 1: Update Dockerfile
# Or latest stable:
# FROM n8nio/n8n:latest
# (your custom commands below if any)
Replace the existing version with the newest one.
Step 2: Rebuild the image
Run
Or
Step 3: Restart n8n
docker-compose up -d
That’s it — n8n is updated.
2. If you want to stop using a Dockerfile
You can update easier by using the official image directly:
image: n8nio/n8n:latest # or a specific version
restart: always
ports:
- "5678:5678"
environment:
- N8N_HOST=n8n.yourdomain.com
- N8N_SECURE_COOKIE=false
- GENERIC_TIMEZONE=Asia/Ho_Chi_Minh
- N8N_BASIC_AUTH_ACTIVE=true
- N8N_PORT=5678
Then update with:
docker-compose up -d
3. Confirm the new version
Inside the container:
Or in UI → Settings → About.
Thanks for visit my website
