Nginx Proxy Manager Reset Admin Password: SQLite & 2FA Fix

18 min readBy Yun Sanghun (M. Yun)

If you are locked out of Nginx Proxy Manager with 400 Invalid email or password or a lost Two-Factor Authentication (2FA) device, there is no password-reset button in the web interface and no built-in CLI subcommand. Worse, most forum guides tell you to run docker exec -it npm sqlite3 /data/database.sqlite, which immediately fails because the official jc21/nginx-proxy-manager:2.11.3 container image does not ship the sqlite3 binary. I set up Nginx Proxy Manager 2.11.3 in an isolated lab on my Windows 11 PC (Official Docker Desktop, Engine 27.5.1), simulated complete administrator lockouts across passwords, mixed-case Setup Wizard emails, and TOTP 2FA challenges, and tested two database recovery workflows using the Node.js runtime and modules (better-sqlite3 and bcrypt) already bundled inside /app.

TL;DR: Verified Recovery Findings

  • No reset button, no sqlite3 CLI binary: The official documentation has no password-reset procedure, and running which sqlite3 inside the container returns exit code 1. What worked reliably was invoking the container's own bcrypt (cost factor 13) and better-sqlite3 modules inside /app to update auth.secret in /data/database.sqlite. The old password immediately returned HTTP 400 and the new password returned HTTP 200.
  • Critical session trap, after a raw SQL reset, older JWT sessions stay valid: A bearer token issued before my raw SQLite UPDATE continued to return HTTP 200 OK on GET /api/users/me. By contrast, changing the password through NPM's own API (PUT /api/users/1/auth) revoked older tokens with 401 Token was issued before the password was changed. Always log in once after a SQLite reset and change the password a second time through the NPM web UI.
  • Soft-deleting every user puts NPM back into first-run Setup Wizard mode: Running UPDATE user SET is_deleted = 1 caused GET /api/ to report "setup": false again, allowing a temporary administrator account (id=2) to restore id=1 and reset its password without knowing the previous secret.
  • A single capital letter in the Setup Wizard email locks you out on first login: Typing Owner@Example.test in the first-run wizard ended on Invalid email or password, and neither mixed-case nor lowercase spelling could sign in until I ran UPDATE user SET email = lower(email) WHERE id = 1.
  • 2FA backup code trap: An 8-character backup code logs you in via POST /api/tokens/2fa, but trying to disable 2FA with that backup code crashes DELETE /api/users/1/2fa with 500 Internal Error (Token must be 6 digits, got 8). Resetting the password hash also does not turn 2FA off; you must update $.totp_enabled in auth.meta.
  • INITIAL_ADMIN_EMAIL and INITIAL_ADMIN_PASSWORD do nothing once an active user row exists in SQLite.
Nginx Proxy Manager 2.11.3 lab transcript showing mixed-case email lockout, API password change revoking older JWT tokens, SQLite bcrypt cost-13 password reset, and soft-deleting all users
End-to-end lab transcript on jc21/nginx-proxy-manager:2.11.3: replacing auth.secret via Node.js bcrypt (cost 13) restores login immediately, while rotating the password a second time through PUT /api/users/1/auth revokes pre-reset JWT sessions.
Nginx Proxy Manager admin password and 2FA recovery flow showing host database backup, SQLite or MariaDB auth.secret bcrypt hash update, totp_enabled reset, and post-login password rotation revoking old JWTs
Safe NPM Credential Recovery Sequence: Back up /data/database.sqlite to the Docker host (outside the mounted volume) before updating auth.secret with a fresh bcrypt hash, then rotate the password once inside the UI to invalidate pre-reset JWT sessions.

What I Ran in the Lab Environment

To verify every recovery command against real application behavior rather than guessing at database columns, I ran an isolated test harness against jc21/nginx-proxy-manager:2.11.3 with every container port bound strictly to 127.0.0.1. In all commands throughout this guide, replace <npm-container> with your container name from docker ps (for example, gfl-npm-reset), and verify your target user ID (1 when only a single administrator account exists).

ComponentVerified Lab Configuration & Scope
Nginx Proxy Manager2.11.3 (jc21/nginx-proxy-manager:2.11.3), default SQLite database at /data/database.sqlite
Docker RuntimeOfficial Docker Desktop on Windows 11 / Linux VM, Docker Engine 27.5.1, ports bound to 127.0.0.1
Test AccountsIsolated lab accounts on example.test addresses (owner@example.test, temp-admin@example.test)
Verification HarnessAutomated REST API calls (/api/tokens, /api/users) paired with headless Playwright browser automation and in-container Node.js SQLite queries

During initial provisioning through Playwright, I immediately encountered a subtle first-run lockout that masquerades as a forgotten password: entering an email address with capital letters in the Setup Wizard creates the administrator row in SQLite but fails the automatic login step with 400 Invalid email or password (a database-level email normalization bug, distinct from browser-enforced Secure cookie rejections over plain LAN HTTP in n8n Secure Cookie error in Docker).

Nginx Proxy Manager first-run Setup Wizard showing Invalid email or password after submitting mixed-case Owner@Example.test paired with live login verification after lower(email) fix
First-run Setup Wizard lockout (GitHub Issue #5323): submitting Owner@Example.test creates the admin row in SQLite but fails automatic login with Invalid email or password because token lookup compares against a lowercased string.

Before You Change Anything: Back Up /data/database.sqlite and Inspect User IDs

Every recovery method in this guide mutates live tables inside /data/database.sqlite. Before running any UPDATE statement, create both an in-container rollback copy and a host-side copy outside the /data volume. An in-container copy alone lives on the same mounted volume and will not protect you if the volume itself is accidentally removed or corrupted.

docker exec <npm-container> cp /data/database.sqlite /data/database.sqlite.before-reset
docker cp <npm-container>:/data/database.sqlite ./database.sqlite.host-backup

When you try to inspect the database with docker exec <npm-container> which sqlite3, the command exits with code 1 because the image omits the sqlite3 CLI binary to keep the runtime footprint small. However, the container ships Node.js along with the exact modules the backend uses inside /app: better-sqlite3 and bcrypt. By passing -w /app to docker exec, you can query the user table directly to confirm your account's id, email, is_deleted, and is_disabled flags:

docker exec -i -w /app <npm-container> node --input-type=module - <<'EOF'
import Database from 'better-sqlite3';
const db = new Database('/data/database.sqlite');
console.log(db.prepare('SELECT id, email, is_deleted, is_disabled FROM user').all());
EOF
Terminal audit showing which sqlite3 returning exit code 1 inside jc21/nginx-proxy-manager:2.11.3, backing up /data/database.sqlite, and querying user and auth rows with better-sqlite3
Because jc21/nginx-proxy-manager:2.11.3 omits the sqlite3 CLI binary, inspecting /data/database.sqlite requires invoking the bundled better-sqlite3 module inside /app after backing up the database file.

Method 1: Replace the Password Hash Directly in SQLite (bcrypt Cost 13)

Nginx Proxy Manager separates user profile metadata from authentication secrets across two SQLite tables. The user table holds the account identity (id = 1, email = 'owner@example.test'), while the auth table stores the password digest in the secret column on the row matching WHERE user_id = 1 AND type = 'password'. Inspecting backend/models/auth.js in the NPM source confirms that passwords are hashed using bcrypt with cost factor 13, producing a 60-character string prefixed with $2b$13$.

Instead of installing Python or third-party hashing tools on the Docker host (or risking bash variable expansion corrupting the $2b$13$ prefix when pasting hashes into double-quoted shell strings) you can generate the cost-13 hash and execute a parameterized SQLite UPDATE inside a single atomic Node.js heredoc script:

docker exec -i -w /app <npm-container> node --input-type=module - <<'EOF'
import bcrypt from 'bcrypt';
import Database from 'better-sqlite3';
const hash = await bcrypt.hash('NEW-PASSWORD-HERE', 13);
const db = new Database('/data/database.sqlite');
console.log(db.prepare("UPDATE auth SET secret = ? WHERE user_id = 1 AND type = 'password'").run(hash));
EOF
Code editor displaying the copy-pasteable Method 1 Node.js script using bcrypt cost 13 and better-sqlite3 inside /app to update auth.secret in /data/database.sqlite
Method 1 direct hash replacement script: running Node.js inside /app with better-sqlite3 and bcrypt (cost 13) updates auth.secret in a single atomic SQLite transaction (changes: 1).

Why Raw SQLite Resets Leave Pre-Reset JWT Sessions Active

In my lab run, executing the Method 1 heredoc script returned { changes: 1, lastInsertRowid: 0 } in roughly 305 ms. I immediately tested POST /api/tokens without restarting the container: the previous password was rejected with HTTP 400 Invalid email or password, and the new password returned HTTP 200 OK with a fresh RS256 bearer token. Because NPM reads from /data/database.sqlite on every login request, no container restart is required.

However, testing active session tokens revealed a critical security nuance that standard password-reset tutorials miss. Before running the SQLite UPDATE, I saved a valid bearer token for User #1. After replacing auth.secret via raw SQL, I called GET /api/users/me with that pre-reset bearer token, and the API still returned HTTP 200 OK. Because a direct SQL write to the auth table bypasses NPM's internal user-update service, it does not advance the user.modified_on timestamp that NPM compares against a token's iat (issued-at) claim.

Split terminal comparison showing old password rejected with HTTP 400 and new SQL password accepted with HTTP 200 on the left versus pre-reset JWT token remaining HTTP 200 valid on the right
While updating auth.secret in SQLite immediately blocks the old password (HTTP 400) and accepts the new password (HTTP 200), bearer tokens minted prior to the raw SQL write remain valid until the password is rotated once through the NPM API.

Mandatory Two-Step Post-Reset Hardening: Rotate via API and Scrub Shell History

Because a raw SQLite write leaves older JWT bearer tokens valid and requires typing your temporary password on the command line, treat Method 1 as a two-part procedure. Immediately after signing in with your SQL-injected password, perform two hardening actions:

  1. Change the password a second time through NPM's UI or API (PUT /api/users/1/auth): When I rotated the password through NPM's own endpoint, replaying the older bearer token against GET /api/users/me immediately failed with HTTP 401 Unauthorized and the message Token was issued before the password was changed. Rotating through the application updates the user timestamp, revokes pre-reset browser sessions, and renders the temporary CLI password obsolete.
  2. Clear the temporary password from your shell history: Even though rotating the password in the UI invalidates the string you typed in the heredoc, scrub the command from ~/.bash_history or ~/.zsh_history so plaintext credential patterns never linger on the host disk.
Terminal showing PUT /api/users/1/auth password rotation revoking older bearer tokens with HTTP 401 Token was issued before the password was changed and scrubbing shell history
Completing Method 1 safely: rotating the temporary reset password through PUT /api/users/1/auth triggers NPM's token timestamp check, immediately rejecting pre-reset sessions with HTTP 401.

Rotating Passwords in the WebUI (/users) and Admin-to-Admin Overrides

In day-to-day operation, the cleanest way to complete the post-reset rotation is directly inside the Nginx Proxy Manager web interface at http://127.0.0.1:81/users. Clicking the three-dot action icon on the right side of the Lab Owner (owner@example.test) row opens the account menu containing Edit Details, Edit Permissions, and Change Password.

Inspecting how the Change Password modal interacts with PUT /api/users/:id/auth also explains why our second recovery method works without hashing passwords on the command line. When you change your own password while signed in as User #1, the API requires the current password field. However, when a different administrator account updates User #1's password, NPM allows the administrator override without asking for User #1's current password.

Live Nginx Proxy Manager 2.11.3 Users view at /users showing Lab Owner administrator row and three-dot action menu with Edit Details, Edit Permissions, and Change Password
Live Nginx Proxy Manager 2.11.3 Users view (/users): changing the password through the UI invokes PUT /api/users/1/auth to invalidate prior JWTs, and allows a secondary administrator to reset a locked account without entering Current Password.

Method 2: Soft-Delete All Users (is_deleted = 1) to Re-Trigger the Setup Wizard

Back in 2019 (GitHub Issue #230), the maintainer noted that marking every user as soft-deleted in SQLite caused older versions of Nginx Proxy Manager to respawn the default admin@example.com / changeme account. Modern releases of NPM use a first-run Setup Wizard instead of respawning a hardcoded login, so I tested what happens when you mark all users as deleted in database.sqlite:

docker exec -i -w /app <npm-container> node --input-type=module - <<'EOF'
import Database from 'better-sqlite3';
const db = new Database('/data/database.sqlite');
console.log(db.prepare('UPDATE user SET is_deleted = 1').run());
EOF

As soon as is_deleted = 1 was committed, querying GET /api/ switched from "setup": true back to "setup": false, the exact state that unlocks the unauthenticated first-run Setup Wizard (POST /api/users). Security warning: because creating the initial administrator in "setup": false mode requires no authentication, only run Method 2 while port 81 is bound to 127.0.0.1 or blocked from external networks.

Code editor displaying the 4-stage Method 2 recovery script setting user.is_deleted = 1 to trigger setup: false, creating temporary admin id=2, restoring id=1, and resetting id=1 password
Method 2 zero-hash recovery workflow: setting is_deleted = 1 re-enables first-run setup ("setup": false) so a temporary admin can restore User #1 and reset its password through the API without hashing secrets on the CLI.

Restoring User #1 From the Temporary Admin & Why INITIAL_ADMIN_* Fails

Once GET /api/ reported "setup": false, I completed the 4-stage recovery without ever hashing a password in the shell:

  1. I created a temporary administrator (temp-admin@example.test, assigned id = 2) via the setup wizard request (POST /api/users) and signed in. My existing proxy host (count = 1) was completely intact.
  2. I un-deleted the original owner account in SQLite by setting is_deleted = 0 WHERE id = 1:
docker exec -i -w /app <npm-container> node --input-type=module - <<'EOF'
import Database from 'better-sqlite3';
const db = new Database('/data/database.sqlite');
console.log(db.prepare('UPDATE user SET is_deleted = 0 WHERE id = 1').run());
EOF
  1. While authenticated as the temporary administrator (id = 2), I called PUT /api/users/1/auth (equivalent to clicking Change Password on User #1 in the UI). Because an administrator was resetting another user, NPM accepted the new password with no current password required.
  2. Finally, I signed back in as owner@example.test (id = 1), confirmed my proxy host was still online, and deleted the temporary administrator (DELETE /api/users/2).

I also tested whether recreating the container with INITIAL_ADMIN_EMAIL=init@example.test and INITIAL_ADMIN_PASSWORD environment variables resets a locked account. When an active user already existed in SQLite, no Creating a new user line appeared in the container logs and signing in as init@example.test failed with HTTP 400.

Split terminal comparison showing INITIAL_ADMIN_EMAIL and INITIAL_ADMIN_PASSWORD ignored when a user exists versus fixing mixed-case Owner@Example.test via UPDATE user SET email = lower(email)
Two common recovery traps: INITIAL_ADMIN_* environment variables are ignored whenever an active user row exists in SQLite, while mixed-case emails require UPDATE user SET email = lower(email) to match NPM's lowercased login lookup.

Locked Out Right After the Setup Wizard: The Mixed-Case Email Bug (Issue #5323)

If you get locked out seconds after finishing the first-run Setup Wizard on a brand-new installation, check whether you typed any uppercase letters in your email address. In my lab test, I submitted Owner@Example.test in the Setup Wizard. Clicking Save displayed the red banner Invalid email or password, even though querying SQLite showed the row [{"id":1,"email":"Owner@Example.test","is_deleted":0}] had been created and GET /api/ now reported "setup": true.

After that, signing in with Owner@Example.test and signing in with owner@example.test both failed with HTTP 400. Inspecting the NPM backend source reveals why (GitHub Issue #5323): user creation stores the email string verbatim with capital letters intact, whereas the login handler (POST /api/tokens) lowercases the submitted email before querying SQLite. Lowercasing the stored column in database.sqlite fixed the lockout immediately:

docker exec -i -w /app <npm-container> node --input-type=module - <<'EOF'
import Database from 'better-sqlite3';
const db = new Database('/data/database.sqlite');
console.log(db.prepare('UPDATE user SET email = lower(email) WHERE id = 1').run());
EOF
Nginx Proxy Manager 2.11.3 2FA lab log showing 8-character backup code login, DELETE /api/users/1/2fa HTTP 500 Token must be 6 digits got 8 bug, and SQLite json_set totp_enabled false bypass
2FA recovery telemetry: an 8-character backup code logs you in but crashes DELETE /api/users/1/2fa with HTTP 500 (Token must be 6 digits, got 8), requiring a SQLite json_set update on auth.meta to switch totp_enabled to false.

Two-Factor Authentication (2FA) Lockouts & Verifying Intact Proxy Hosts

Starting in recent Nginx Proxy Manager releases, administrators can enable TOTP Two-Factor Authentication from the user menu. To see how 2FA interacts with password resets and lost authenticator devices, I enabled 2FA on User #1 via POST /api/users/1/2fa and POST /api/users/1/2fa/enable. Enabling 2FA generated a 32-character TOTP secret and 8 single-use backup codes of 8 characters each.

With 2FA active, submitting the correct password to POST /api/tokens no longer returns a bearer token directly; instead, it returns 200 requires_2fa and a short-lived challenge token. Submitting a wrong second-factor code to POST /api/tokens/2fa returned 400 Invalid verification code, while submitting either a valid 6-digit TOTP code or one of the 8-character backup codes returned 200 token (decrementing backup_codes_remaining from 8 to 7) and preserved all configured Proxy Hosts in /nginx/proxy.

Live Nginx Proxy Manager 2.11.3 Proxy Hosts view at /nginx/proxy confirming whoami.localhost -> http://whoami:80 remains Online after SQLite password and 2FA recovery
Post-recovery verification in the live Nginx Proxy Manager 2.11.3 WebUI: all configured Proxy Hosts and SSL assignments in /data/database.sqlite remain intact after resetting auth.secret and disabling stale TOTP 2FA.

Why Backup Codes Crash DELETE /api/users/1/2fa With HTTP 500 & How to Switch 2FA Off in SQLite

While testing 2FA recovery, I uncovered two critical traps that block administrators who lose their phone:

  • Trap 1: Disabling 2FA with an 8-character backup code fails with 500 Internal Error: After signing in with an 8-character backup code, I tried to turn 2FA off so I could register a new phone (DELETE /api/users/1/2fa?code=<backup-code>). The API crashed with HTTP 500 Internal Error, and the container logged: [Express] warning Token must be 6 digits, got 8. Because the disable endpoint validates the code exclusively as a 6-digit TOTP integer (GitHub Issue #5451), a backup code lets you log in but cannot disable 2FA through the UI.
  • Trap 2: Resetting the password hash does not turn 2FA off: After running Method 1 to replace auth.secret, logging in with the new password still returned 200 requires_2fa because 2FA metadata lives inside the JSON column auth.meta.

When your authenticator app is gone (or when both your phone and backup codes are lost) use SQLite's built-in json_set() function to flip $.totp_enabled to false inside auth.meta:

docker exec -i -w /app <npm-container> node --input-type=module - <<'EOF'
import Database from 'better-sqlite3';
const db = new Database('/data/database.sqlite');
console.log(db.prepare("UPDATE auth SET meta = json_set(meta, '$.totp_enabled', json('false')) WHERE user_id = 1 AND type = 'password'").run());
EOF
Code editor showing SQLite json_set(meta, '$.totp_enabled', json('false')) command to disable 2FA alongside full auth.meta reset and external MariaDB/MySQL JSON_SET queries
Copy-pasteable SQLite json_set one-liner to disable 2FA on a locked administrator account, paired with the matching MariaDB/MySQL JSON_SET and auth.secret update queries for multi-container stacks.

Verifying Immediate Login After the Database 2FA Switch-Off

In my lab test, running the json_set(meta, '$.totp_enabled', json('false')) one-liner updated 1 row ({ changes: 1, lastInsertRowid: 0 }) while leaving the existing backup_codes array intact inside the JSON object. Notice the use of json('false') rather than a plain string 'false': in SQLite, json('false') writes a true JSON boolean (false) so JavaScript strict truthiness checks inside NPM evaluate meta.totp_enabled as disabled.

Immediately after running that command, calling POST /api/tokens with the account's password bypassed the second-factor challenge completely and returned a full RS256 bearer token (HTTP 200 OK). Once signed back into the web UI, you can open the user menu, select Two-Factor Auth, and enroll a fresh authenticator device.

Split terminal comparison showing DELETE /api/users/1/2fa failing with HTTP 500 on an 8-character backup code and password reset leaving requires_2fa active versus SQLite json_set recovery
Why password resets alone fail on 2FA-enabled accounts: auth.secret updates do not clear auth.meta.totp_enabled, and 8-character backup codes trigger a 6-digit validation crash on DELETE /api/users/1/2fa.

Empirical Benchmark: Node.js bcrypt Cost Factors vs Recovery Workflow Latency

Why does Nginx Proxy Manager use cost factor 13 in backend/models/auth.js, and how long does each recovery path take inside a live Docker Desktop container? I benchmarked bcrypt.hash() across cost factors 10, 12, 13, and 14 inside jc21/nginx-proxy-manager:2.11.3 and timed all four database remediation workflows end to end.

At cost factor 10, hashing takes just 39.4 ms; at cost factor 12, it takes 151.9 ms; at NPM's default cost factor 13, a single hash takes 304.9 ms; and at cost factor 14, latency doubles to 608.9 ms. Because cost 13 keeps each login check around 0.3 seconds, Method 1 (hashing a new secret in SQLite plus rotating once via PUT /api/users/1/auth) completes in 2.4 seconds total, 2.8x faster than the 5-step Method 2 soft-delete workflow (6.8 seconds).

Matplotlib benchmark chart comparing Node.js bcrypt.hash latency across cost factors 10, 12, 13 (304.9 ms), and 14 (608.9 ms) and end-to-end recovery workflow duration
Empirical timing inside jc21/nginx-proxy-manager:2.11.3: cost-13 bcrypt hashing takes 304.9 ms per operation, making Method 1 (2.4 s total including API token revocation) 2.8x faster than Method 2 soft-delete recovery (6.8 s).

Complete HTTP Login Error Reference & Authentication State Machine

Because Nginx Proxy Manager intentionally returns generic error strings on several failure paths, matching the exact HTTP status code and response message to the internal authentication stage saves significant debugging time. The table below summarizes every login and 2FA error observed during our empirical runs:

HTTP Status & Error MessageEndpointEmpirical Cause in NPM 2.11.3 Source & Lab Runs
400 Invalid email or passwordPOST /api/tokensReturned for a wrong password, a non-existent email, a mixed-case email stored by the Setup Wizard (Owner@Example.test), a soft-deleted user (is_deleted = 1), or a disabled user (is_disabled = 1).
401 Token was issued before the password was changedGET /api/users/meBearer token iat timestamp is older than the user's password-change timestamp after rotating via PUT /api/users/1/auth.
400 Invalid verification codePOST /api/tokens/2faSubmitted TOTP 6-digit code or 8-character backup code did not match auth.meta.
500 Internal Error (Token must be 6 digits, got 8)DELETE /api/users/1/2faAttempting to disable 2FA using an 8-character backup code instead of a 6-digit TOTP code (Issue #5451).
Architecture diagram of Nginx Proxy Manager 2.11.3 authentication pipeline mapping POST /api/tokens, identity.toLowerCase, SQLite user and auth schema, bcrypt cost 13, totp_enabled, and JWT modified_on checks
Internal authentication architecture of Nginx Proxy Manager: how user.is_deleted, user.email casing, auth.secret ($2b$13$), auth.meta.totp_enabled, and user.modified_on interact during login and session validation.

Who Can Run These Commands: Docker Socket Access Equals NPM Admin Access

Every database recovery procedure in this guide requires zero knowledge of the current Nginx Proxy Manager password or 2FA secret. It requires only docker exec access on the Docker host. Method 2 additionally relies on reaching port 81 while GET /api/ is temporarily in "setup": false mode.

From an infrastructure security standpoint, anyone who belongs to the docker Unix group on your server (or any container mounted with /var/run/docker.sock) has full, unauthenticated read/write control over /data/database.sqlite, your upstream proxy destinations, and your Let's Encrypt private keys in /etc/letsencrypt. Always keep port 81 bound to 127.0.0.1:81:81 (reaching it via SSH tunnel or WireGuard VPN) and treat host Docker privileges as equivalent to root and NPM administrator access.

Complete Nginx Proxy Manager lockout triage and recovery decision matrix matching HTTP 400, 401, and 500 login errors to verified better-sqlite3 commands and host security boundaries
Complete Nginx Proxy Manager lockout recovery matrix: matching HTTP 400/401/500 login errors to exact better-sqlite3 commands, session revocation rules, and host Docker socket access controls.

Limits, Scope Boundaries, and What I Did Not Test

  • SQLite deployments only: All commands in this post were tested against the default SQLite database at /data/database.sqlite. External MariaDB/MySQL and PostgreSQL deployments store the same user and auth columns in a separate database container; while we included the equivalent SQL syntax in IMG_12 for reference, external database engines were not tested in this run.
  • Version scope: Tested on jc21/nginx-proxy-manager:2.11.3 running on Official Docker Desktop (Engine 27.5.1) with all ports bound to 127.0.0.1. Earlier 2.x releases that seeded a hardcoded admin@example.com user on every empty boot behave differently when all users are soft-deleted.
  • Untested edge cases: I did not test live restoration from database.sqlite.before-reset under active proxy load, whether a full container restart invalidates pre-reset JWTs without calling PUT /api/users/1/auth, or re-enrolling a second TOTP phone immediately after the json_set database switch-off.

Last reviewed: 2025-02-14. Tested on Nginx Proxy Manager 2.11.3 (SQLite at /data/database.sqlite) with Official Docker Desktop (Engine 27.5.1), all ports bound to 127.0.0.1, using isolated test accounts only. Setup Wizard and WebUI states were captured via headless Playwright automation against the live container, and all database recovery steps were executed through the bundled Node.js runtime inside /app.

Nginx Proxy Manager SQLite Bcrypt & 2FA Recovery Q&A

Why does docker exec sqlite3 fail inside the official Nginx Proxy Manager container?

The jc21/nginx-proxy-manager:2.11.3 image does not bundle the sqlite3 CLI binary. Instead, execute recovery queries using the bundled Node.js runtime and NPM's pre-installed internal better-sqlite3 / knex database modules together with bcryptjs.

Why do pre-existing JWT bearer tokens still work right after a raw SQLite password reset in NPM?

Writing a new bcrypt hash directly to the auth table bypasses NPM's internal user service and leaves modified_on unchanged, so existing JWTs pass validation. Log in once with the reset password and change it a second time in the NPM web UI to revoke older tokens.

Why did entering an 8-character backup code fail with HTTP 500 when disabling 2FA in NPM?

NPM logs you in with an 8-character backup code, but its DELETE /api/users/1/2fa disable endpoint validates the confirmation code strictly as a 6-digit TOTP integer. If your phone is lost, clear the 2FA record in database.sqlite via Node.js.

100% Client-Side Utilities · Printable A4 Runbook

Run Prefilled Sizing Math & Download the 1-Page Runbook

Generate declarative Caddy 2, Nginx, and Traefik v3 configs (zero SQLite admin lockouts) and size PostgreSQL pools.

Paired Prefilled Calculators & Vector PDF Checklist

Yun Sanghun (M. Yun) · Linux, Docker & AI Infrastructure Engineer