Hi All
I am experiencing a issue with my N8N where I need to reset user management every time docker restarts.
The Nodes and flows do stay, but my username and password does not work.
I followed the below steps:
docker exec -it n8n user-management:reset
And I need to do this every time I restart docker.
Is there any permanent solution?
Information on your n8n setup
- n8n version:Latest
- Database (default: SQLite):Postgres
- Running n8n via: Docker (Portainer)
- Operating system:Ubuntu
Docker Compose:
version: '3.8'
networks:
n8n_net:
driver: bridge
services:
n8n:
container_name: n8n
#image: naskio/n8n-python:latest
image: n8nio/n8n:latest
restart: unless-stopped
user: 0:0
ports:
- 5678:5678
environment:
- N8N_USER_MANAGEMENT_DISABLED=True
- DB_TYPE=postgresdb
- DB_POSTGRESDB_HOST=postgres
- DB_POSTGRESDB_PORT=5432
- DB_POSTGRESDB_DATABASE=n8ndatabase
- DB_POSTGRESDB_USER=adminusr
- DB_POSTGRESDB_PASSWORD="pss343434"
- WEBHOOK_URL=https://n8.domain.com/
- EXECUTIONS_PROCESS=main
- N8N_BASIC_AUTH_ACTIVE=true
- N8N_EDITOR_BASE_URL=https://n8.domain.com/
- N8N_BASIC_AUTH_USER=admin
- N8N_BASIC_AUTH_PASSWORD="Test@132"
- N8N_PROTOCOL=http
- NODE_ENV=production
- GENERIC_TIMEZONE=Africa/Harare
- N8N_EMAIL_MODE=smtp
- N8N_SMTP_PORT=587
- N8N_SMTP_HOST=smtp.office365.com
- [email protected]
- N8N_SMTP_PASS=thepassword
- [email protected]
- N8N_SMTP_SSL=false
- N8N_ENCRYPTION_KEY="eNrrgergIJIJOiu87HUHI8665UGU"
volumes:
- /home/ubuntu/DockerCompose/n8n:/home/node/.n8n
- /home/ubuntu/DockerCompose/n8n/local-files:/data/files
- /home/ubuntu/DockerCompose/n8n/python_scripts:/data/py_scripts
- /home/ubuntu/DockerCompose/n8n/requirements.txt:/data/requirements.txt
networks:
- n8n_net
links:
- postgres
depends_on:
postgres:
condition: service_healthy
postgres:
image: postgres:11
restart: always
container_name: n8n_postgres
user: 0:0
environment:
- POSTGRES_USER=adminusr
- POSTGRES_PASSWORD="pss343434"
- POSTGRES_DB=n8ndatabase
- POSTGRES_NON_ROOT_USER=admin
- POSTGRES_NON_ROOT_PASSWORD="adminpss454544"
volumes:
- /home/ubuntu/DockerCompose/n8n/database:/var/lib/postgresql/data
- ./init-data.sh:/docker-entrypoint-initdb.d/init-data.sh
healthcheck:
test: ['CMD-SHELL', 'pg_isready -h localhost -U adminusr -d n8ndatabase']
interval: 5s
timeout: 5s
retries: 10
ports:
- 3306:3306
networks:
- n8n_net```
Note:
- All passwords and user above changed (Random information)
- There is a N8N Python image and some volumes for it. This was just a test as I wanted to test a different image and also try and set a way to run Python scripts with N8N
- I ran the container as Root for testing purposes