N8N Does not save Username/Password

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

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hey @Surgical17,

This is not an issue I have seen before and I am not able to reproduce it, It sounds like maybe the browser is autocompleting the password for you and inputting the wrong one.

It looks like your config is using some older options as well you don’t need the N8N_BASIC_* options anymore as they are not used.

Hey Jon

I am using a password manager, but I am manually copy and pasting to ensure the details is correct.
Maybe it is the N8N_Basic. What options can I remove and I will try and test again

Hey @Surgical17,

I would start by removing the n8n_basic options and see how that goes although that won’t change the password in the database.

I would also try running the browser in private browsing mode to rule out any plugins or autocomplete getting in the way, I have seen similar issues to this with other applications in the past and it is nomrally down to the browser doing something odd.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.