This commit is contained in:
Niklas Böhlke 2025-06-16 13:24:56 +02:00 committed by GitHub
commit d76cbd6cfd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -5,11 +5,15 @@ title: "🔑 Reset Admin Password"
# Resetting Your Admin Password 🗝️
If you've forgotten your admin password, don't worry! Below you'll find step-by-step guides to reset your admin password for Docker 🐳 deployments and local installations of Open WebUI.
If you've forgotten your admin password, don't worry! Below you'll find step-by-step guides to reset your admin password for Podman 🦭 and Docker 🐳 deployments and local installations of Open WebUI.
## For Docker Deployments 🐳
Hier ist dein korrigierter Text. Die Formatierung (Markdown + Emojis) bleibt vollständig erhalten, es wurden ausschließlich sprachliche und grammatikalische Fehler korrigiert:
Follow these steps to reset the admin password for Open WebUI when deployed using Docker.
---
## For Podman 🦭 or Docker 🐳 Deployments
Follow these steps to reset the admin password for Open WebUI when deployed using Podman or Docker.
### Step 1: Generate a New Password Hash 🔐
@ -19,18 +23,68 @@ First, you need to create a bcrypt hash of your new password. Run the following
htpasswd -bnBC 10 "" your-new-password | tr -d ':\n'
```
**Note:** The output will include a bcrypt hash with special characters that need to be handled carefully. Any `$` characters in the hash will need to be triple-escaped (replaced with `\\\`) to be used correctly in the next step.
**Note:** The output will include a bcrypt hash with special characters that need to be handled carefully. Any `$` characters in the hash will need to be escaped or triple-escaped based on your system (replaced with `\` or `\\\`) to be used correctly in the final step.
### Step 2: Update the Password in Docker 🔄
### Step 2: Install sqlite3 on your machine (optional, if already installed)
Next, you'll update the password in your Docker deployment. Replace `HASH` in the command below with the bcrypt hash generated in Step 1, making sure to triple-escape any `$` characters. Also, replace `admin@example.com` with the email address linked to your admin account.
**Important:** The following command may not work in all cases. If it doesn't work for you, try the alternative command below it.
Installation on Ubuntu:
```bash
docker run --rm -v open-webui:/data alpine/socat EXEC:"bash -c 'apk add sqlite && echo UPDATE auth SET password='\''HASH'\'' WHERE email='\''admin@example.com'\''; | sqlite3 /data/webui.db'", STDIO
sudo apt install sqlite3
```
Installation on RHEL:
```bash
sudo yum install sqlite
```
### Step 3: Get the path to the database file (optional, if known)
For Podman 🦭:
```bash
podman volume inspect open-webui
```
For Docker 🐳:
```bash
docker volume inspect open-webui
```
Copy the mount point and test if you can access the path and the database file itself.
To test if you can access the path:
```bash
sudo ls -l MOUNTINGPOINT_PATH
```
To test if you have access to the DB file:
```bash
sudo sqlite3 /MOUNTINGPOINT_PATH/webui.db "SELECT email, password FROM auth WHERE email='EMAIL';"
```
**Note:** Insert the path and enter the email address you want to check the hash for.
### Step 4: Update the password in the database 🔄
Next, you'll update the password in your Podman or Docker deployment. Replace `HASH` in the command below with the bcrypt hash generated in Step 1, making sure to escape any `$` characters. Also, replace `EMAIL` with the email address linked to your admin account.
```bash
echo "UPDATE auth SET password='HASH' WHERE email='EMAIL';" | sudo sqlite3 /MOUNTINGPOINT_PATH/webui.db
```
**Important:** The following command may not work in all cases. If it doesn't work for you, please try to escape or triple-escape the `$` characters. This varies between systems! You can verify whether the escaping was successful using the following command:
```bash
sudo sqlite3 /MOUNTINGPOINT_PATH/webui.db "SELECT email, password FROM auth WHERE email='EMAIL';"
```
The output should return the email address and the hash you generated in Step 1 — if the output differs from that hash, its not going to work. Check if there are backslashes in the output and adjust the command if necessary.
## For Local Installations 💻
If you have a local installation of Open WebUI, here's how you can reset your admin password directly on your system.