Skip to main content
RapidDev - Software Development Agency
n8n-tutorial

How to Reset Admin Credentials in n8n

To reset admin credentials in n8n, run the CLI command n8n user-management:reset which removes all user accounts and allows you to set up a new admin account from scratch. For Docker deployments, run this command inside the container. This is the only supported method — there is no password reset email or UI option.

What you'll learn

  • How to run the user-management:reset command for your deployment type
  • What the reset command does and does not delete
  • How to create a new admin account after the reset
Book a free consultation
4.9Clutch rating
600+Happy partners
17+Countries served
190+Team members
Beginner6 min read5 minutesn8n 1.0+ (self-hosted only)March 2026RapidDev Engineering Team
TL;DR

To reset admin credentials in n8n, run the CLI command n8n user-management:reset which removes all user accounts and allows you to set up a new admin account from scratch. For Docker deployments, run this command inside the container. This is the only supported method — there is no password reset email or UI option.

Resetting Your n8n Admin Password When Locked Out

If you forget your n8n admin password, the only way to regain access is through the CLI command n8n user-management:reset. This command removes all existing user accounts and resets n8n to its initial setup state, where you can create a new admin account. This tutorial covers how to run the command for different deployment methods: bare metal, Docker, and systemd.

Prerequisites

  • Terminal or SSH access to the server running n8n
  • Permission to run commands as the n8n user or root
  • n8n installed via npm, Docker, or system package

Step-by-step guide

1

Stop the n8n service before resetting

Before running the reset command, stop the n8n service to avoid conflicts with the database. How you stop n8n depends on how you installed it. For systemd, use systemctl stop n8n. For Docker, use docker stop n8n. For pm2, use pm2 stop n8n. If you are running n8n directly in a terminal, press Ctrl+C to stop it. The reset command needs exclusive access to the database, so make sure no other n8n process is running.

typescript
1# Systemd
2sudo systemctl stop n8n
3
4# Docker
5docker stop n8n
6
7# PM2
8pm2 stop n8n
9
10# Direct process press Ctrl+C in the terminal

Expected result: The n8n service is stopped and no n8n processes are running.

2

Run the user-management:reset command

Execute the n8n user-management:reset command. This removes all user accounts from the n8n database, including the admin account and any additional users you created. It does NOT delete workflows, credentials, or execution history — only user accounts. After the reset, n8n will behave as if it was freshly installed, showing the account setup screen on next launch.

typescript
1# Bare metal / npm install
2n8n user-management:reset
3
4# Docker (container named 'n8n')
5docker exec -it n8n n8n user-management:reset
6
7# Docker Compose
8docker compose exec n8n n8n user-management:reset
9
10# If n8n is installed globally with a custom data path
11N8N_USER_FOLDER=/path/to/.n8n n8n user-management:reset

Expected result: The terminal shows a success message confirming that user management has been reset.

3

Start n8n and create a new admin account

Start n8n again using the same method you normally use. Open the n8n UI in your browser. Instead of the login screen, you will see the initial setup wizard that asks you to create a new owner account. Enter your name, email, and a new password. This new account becomes the admin with full access to all workflows, credentials, and settings. Any workflows and credentials from before the reset are still there — only the user accounts were removed.

typescript
1# Systemd
2sudo systemctl start n8n
3
4# Docker
5docker start n8n
6
7# PM2
8pm2 start n8n
9
10# Direct
11n8n start

Expected result: The n8n setup wizard appears, and you can create a new admin account with access to all existing workflows and credentials.

4

Verify the new admin credentials work

Open your browser and navigate to your n8n instance URL (typically http://localhost:5678). You should see the login screen. Enter the new email address and password you just set. If the login succeeds, your admin credentials have been reset successfully. Check that you can access all workflows and settings as the admin user. If you had other users configured, verify they can still log in with their own credentials as well.

Expected result: You can log in with the new admin credentials and access the full n8n dashboard with all workflows visible.

Complete working example

reset-admin.sh
1#!/bin/bash
2# Reset n8n admin credentials
3# Works for systemd, Docker, and pm2 deployments
4
5set -e
6
7echo "=== n8n Admin Credential Reset ==="
8echo "WARNING: This will remove ALL user accounts."
9echo "Workflows and credentials are NOT affected."
10read -p "Continue? (y/N): " confirm
11
12if [[ "$confirm" != "y" && "$confirm" != "Y" ]]; then
13 echo "Aborted."
14 exit 0
15fi
16
17# Detect deployment method
18if systemctl is-active --quiet n8n 2>/dev/null; then
19 echo "Detected: systemd"
20 sudo systemctl stop n8n
21 n8n user-management:reset
22 sudo systemctl start n8n
23 echo "Reset complete. Open n8n in your browser to create a new admin."
24
25elif docker ps --format '{{.Names}}' | grep -q '^n8n$'; then
26 echo "Detected: Docker"
27 docker stop n8n
28 docker run --rm \
29 --volumes-from n8n \
30 --env-file <(docker inspect n8n --format '{{range .Config.Env}}{{println .}}{{end}}') \
31 n8nio/n8n n8n user-management:reset
32 docker start n8n
33 echo "Reset complete. Open n8n in your browser to create a new admin."
34
35elif pm2 list 2>/dev/null | grep -q 'n8n'; then
36 echo "Detected: PM2"
37 pm2 stop n8n
38 n8n user-management:reset
39 pm2 start n8n
40 echo "Reset complete. Open n8n in your browser to create a new admin."
41
42else
43 echo "No running n8n instance detected."
44 echo "Running reset command directly..."
45 n8n user-management:reset
46 echo "Reset complete. Start n8n and open it in your browser."
47fi

Common mistakes when resetting Admin Credentials in n8n

Why it's a problem: Running the reset command while n8n is still running, causing database lock errors

How to avoid: Stop n8n completely before running n8n user-management:reset. Verify with ps aux | grep n8n.

Why it's a problem: Thinking the reset command deletes workflows and credentials

How to avoid: The command only removes user accounts. All workflows, credentials, and execution history remain intact.

Why it's a problem: Running the command without the correct database connection environment variables

How to avoid: If n8n uses PostgreSQL, set DB_TYPE, DB_POSTGRESDB_HOST, and other connection variables before running the command.

Why it's a problem: Trying to reset credentials on n8n Cloud

How to avoid: The CLI reset command is for self-hosted only. On n8n Cloud, use the forgot password link on the login page or contact n8n support.

Best practices

  • Store your n8n admin password in a password manager to avoid needing resets
  • Back up your n8n database before running the reset command, even though it only removes user accounts
  • Use strong, unique passwords for the n8n admin account
  • Set up multiple admin users so that one can reset another's password from the UI
  • If running n8n in Docker, document the exact docker exec command in your runbook
  • Consider enabling LDAP or SAML authentication on Enterprise plans to avoid local password management

Still stuck?

Copy one of these prompts to get a personalized, step-by-step explanation.

ChatGPT Prompt

I forgot my n8n admin password and cannot log into my self-hosted instance. How do I reset it without losing my workflows? I am running n8n in Docker.

n8n Prompt

Reset my admin password by running n8n user-management:reset inside my Docker container named n8n, then restart the container so I can create a new admin account.

Frequently asked questions

Does n8n user-management:reset delete my workflows?

No. The command only removes user accounts. All workflows, credentials, execution history, and settings remain exactly as they were. You just need to create a new admin account to access them.

Can I reset just my password without removing all users?

No. The user-management:reset command is all-or-nothing — it removes all user accounts. If you have multiple users, they will all need to be re-invited after the reset. Another admin user can change your password from the Users settings page without a reset.

Is there a forgot password option for self-hosted n8n?

Self-hosted n8n does not have a forgot password email flow by default. The only way to reset a forgotten admin password is the CLI command. If you configured SMTP settings, invited users receive password setup emails, but there is no recovery flow.

How do I run the reset command if n8n is in a Docker container?

Use docker exec -it n8n n8n user-management:reset where n8n is your container name. If the container is stopped, use docker run with the same volumes and environment variables to run the command.

What if the reset command gives a database connection error?

The command needs the same database configuration as your running n8n instance. Set DB_TYPE, DB_POSTGRESDB_HOST, and other connection variables as environment variables before running the command, or ensure they are in the .env file.

Can RapidDev help me recover access to a locked n8n instance?

Yes, RapidDev can assist with admin credential resets, database recovery, and setting up proper user management with multiple admin accounts to prevent future lockouts.

RapidDev

Talk to an Expert

Our team has built 600+ apps. Get personalized help with your project.

Book a free consultation

Need help with your project?

Our experts have built 600+ apps and can accelerate your development. Book a free consultation — no strings attached.

Book a free consultation

We put the rapid in RapidDev

Need a dedicated strategic tech and growth partner? Discover what RapidDev can do for your business! Book a call with our team to schedule a free, no-obligation consultation. We'll discuss your project and provide a custom quote at no cost.