Any one help me how to create docker-compose.yaml file

I have like this..For example if i update to latest n8n whether my workspace will get saved properly?Did i miss anything below..Pls share me if anyone has exact yaml file

version: “3”
services:
n8n:
image: n8nio/n8n:latest
container_name: n8n
ports:
- “5678:5678”
environment:
- N8N_HOST=IP
- N8N_PORT=5678
- N8N_PROTOCOL=https
- N8N_BASIC_AUTH_ACTIVE=true
- N8N_BASIC_AUTH_USER=sth
- N8N_BASIC_AUTH_PASSWORD=pwd
- N8N_RUNNERS_ENABLED=true
- N8N_RUNNERS_MODE=internal
- N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true
volumes:
- C:/n8n/n8n-data:/home/node/.n8n
restart: unless-stopped
stop_grace_period: 60s

hi there, the memory of your workspace will be saved here

  • C:/n8n/n8n-data:/home/node/.n8n

so it does not matter if you update the n8n to the latest one or still uses this one, the data will persist on that path above

and to update n8n, you need to pull the latest image
docker pull n8nio/n8n:latest
and then
docker compose down

docker compose up -d

your n8n should be updated and your data will still be there

if this helps please mark it as the answer

1 Like

Thanks for reply.. I have fixed this issue

1 Like