Self-hosted n8n: need safest way to reset existing user password without deleting account/data

Describe the problem/error/question

I’m running a self-hosted n8n instance on Docker through Coolify on a Google Cloud VM.

I can access the n8n login page, but I can’t log in. The “Forgot password” page says email is not configured, so it cannot send a reset email.

Important: I do NOT want to reset user management or create a new account if that removes/replaces the current user. I want to keep the same existing account and preserve all workflows, credentials, and data.

I confirmed the existing user exists in the SQLite database:

adammzannar2009@gmail.com | Adam | Mzannar

I already made a backup of:

  • /home/node/.n8n/database.sqlite
  • /home/node/.n8n/database.sqlite-wal
  • /home/node/.n8n/database.sqlite-shm

Question:
What is the safest supported way to change/reset the password for the existing user only, without deleting the account and without losing workflows, credentials, or data?

What is the error message (if any)?

Forgot password page says:

Please contact your admin. n8n isn’t set up to send email right now.

When trying manual methods, I got:

Cannot find module 'bcryptjs'

attempt to write a readonly database

sqlite3: not found

Also, the Coolify/Traefik route had stale old IP labels because my VM external IP changed. I temporarily accessed n8n directly through the server IP and port.

Please share your workflow

This is not related to a specific workflow. It is a self-hosted login/password recovery issue.

Share the output returned by the last node

Not applicable.

Information on your n8n setup

  • n8n version: 2.13.3
  • Database (default: SQLite): SQLite
  • n8n EXECUTIONS_PROCESS setting (default: own, main): default / not sure
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker through Coolify on Google Cloud VM
  • Operating system: Debian GNU/Linux 12 / Google Cloud VM

n8n CLI reset command will do just that

Can you try this?

1. Identify your Container Name

Run the following command on your VM terminal to find the exact name of your n8n container:

docker ps

(Look for the container running the n8n image; it will likely be something like n8n-nnn or coolify-yyy) .

2. Run the Reset Command

Execute the command using the node user (the user n8n runs as) to avoid permission issues. Replace <container_name> with the name you found in step 1:

docker exec -u node -it <container_name> n8n user-management:reset

Expected Output: Successfully reset the database to default user state.

3. Restart the Container

For the changes to propagate and the setup wizard to trigger, restart the container via Coolify or the CLI:

docker restart <container_name>

4. Re-claim the Account

  1. Open your browser in Incognito/Private mode (this is crucial to avoid stale session cookies).
  2. Navigate to your n8n login page.
  3. You will be redirected to the Owner Setup page.
  4. Enter your email (adammzannar2009@gmail.com) and choose a new password.
  5. Log in. All your workflows and credentials will be there.

Alternatively, you can just configure your docker for smtp email like below

@Adam_Mzannar
if you can configure smtp in n8n, restart the instance and click reset password, there’s a good chance it will work. DO NOT USE docker exec -u node -it <container_name> n8n user-management:reset; that will do what you don’t want.

N8N_EMAIL_MODE=smtp
N8N_SMTP_HOST=smtp.gmail.com
N8N_SMTP_PORT=587
N8N_SMTP_USER=your-email@gmail.com
N8N_SMTP_PASS=your-google-app-password
N8N_SMTP_SENDER=your-email@gmail.com
N8N_SMTP_SSL=false
N8N_SMTP_STARTTLS=true

Why not? It does not

The following aim is also achieved

Is there something I have missed out?
I would not recommend this approach if OP has multiple user accounts on this docker

Welcome @Adam_Mzannar to our community! I’m Jay and I am a n8n verified creator.

You can update the password hash directly in the SQLite database without touching any other user data. Stop the n8n container first, then run: sqlite3 /path/to/database.sqlite "UPDATE user SET password='$2b$10$NEW_HASH' WHERE email='your@email.com';". Generate the bcrypt hash with cost 10 using any bcrypt tool (e.g., node -e "const b=require('bcryptjs'); console.log(b.hashSync('newpassword', 10))"). Restart the container and log in with the new password. Only the password column changes - all workflows, credentials, and settings stay intact.

OP already stated

hi Kjooleng! from the research I did, this command resets everything, both, he doesn’t want that: “I DON’T want to reset user management or create a new account if that will remove/replace the current user”

It will not because

Anyway I will let OP decide

Hi @kjooleng
according to the documentation, the action returns user management to the pre-configuration state and removes all user accounts. Workflows/credentials may remain in the database but user accounts are removed/recreated

Reset Admin Password on Locally Hosted n8n - Questions - n8n Community

The safest approach to reset a specific user’s password without touching other accounts: directly update the password field in the user table in your database. Generate a bcrypt hash of the new password (use any bcrypt tool or a one-time Node.js script: require('bcryptjs').hash('newpassword', 10)), then run UPDATE user SET password = '<hash>' WHERE email = 'user@example.com' in SQLite or Postgres. This touches only that one user’s password field and nothing else - no account deletion, no credential impact.