---
sidebar_position: 1
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.

## For Docker Deployments 🐳

Follow these steps to reset the admin password for Open WebUI when deployed using Docker.

### Step 1: Generate a New Password Hash 🔐

First, you need to create a bcrypt hash of your new password. Run the following command on your local machine, replacing `your-new-password` with the password you wish to use:

```bash
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.

### Step 2: Update the Password in Docker 🔄

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.

```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
```

## 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.

### Step 1: Generate a New Password Hash 🔐

Just as with the Docker method, start by generating a bcrypt hash of your new password using the following command. Remember to replace `your-new-password` with your new password:

```bash
htpasswd -bnBC 10 "" your-new-password | tr -d ':\n'
```

### Step 2: Update the Password Locally 🔄

Now, navigate to the `open-webui` directory on your local machine. Update your password by replacing `HASH` with the bcrypt hash from Step 1 and `admin@example.com` with your admin account email, and execute:

```bash
sqlite3 backend/data/webui.db "UPDATE auth SET password='HASH' WHERE email='admin@example.com';"
```


#### Alternate Docker Method

_If you have issues with the above._  I had issues chaining the `bash` commands in `alpine/socat`, _since `bash` doesn't exist._

1. **Run `alpine` linux connected to the open-webui volume.**

    ```bash
    docker run -it --rm -v open-webui:/path/to/data alpine
    ```
    _`/path/to/data` depends on __your__ volume settings._

    1. Install `apache2-utils` and `sqlite`:

        ```sh
        apk add apache2-utils sqlite
        ```
    1. Generate `bcrypt` hash:

        ```sh
        htpasswd -bnBC 10 "" your-new-password | tr -d ':'
        ```

    1. Update password:

        ```sh
        sqlite3 /path/to/data/webui.db
        ```

        ```sql
        UPDATE auth SET password='HASH' WHERE email='admin@example.com';
        -- exit sqlite: [Ctrl + d]
        ```

        
---

📖 By following these straightforward steps, you'll regain access to your Open WebUI admin account in no time. If you encounter any issues during the process, please consider searching for your issue on forums or community platforms.
```