> ## Documentation Index
> Fetch the complete documentation index at: https://3to1go.docs.thesteau.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Reset the admin password

> Regain access to Central if you're locked out.

`INITIAL_ADMIN_PASSWORD` is only used when Central starts with no user accounts. Changing it later does **not** reset an existing account. `POSTGRES_PASSWORD` is the database password, not the sign-in password.

If you're locked out, reset the password directly in PostgreSQL.

If you can still sign in, use **Admin → Change My Password** instead. Another admin can reset your password through **Users & Access**; that also ends your existing sessions and requires you to choose a new password.

<Steps>
  <Step title="Go to the Central folder">
    SSH into the Docker host and change into the folder with Central's `docker-compose.yml`:

    ```sh theme={null}
    cd 3to1go-central
    ```
  </Step>

  <Step title="Reset the password to admin">
    ```sh theme={null}
    docker compose exec postgres psql -U three_to_one_go -d three_to_one_go -c "CREATE EXTENSION IF NOT EXISTS pgcrypto; UPDATE app_users SET password_hash = crypt('admin', gen_salt('bf', 10)), must_change_password = true WHERE username = 'admin';"
    ```

    If you changed `POSTGRES_USER` or `POSTGRES_DB` in `.env`, use those values in place of `three_to_one_go`.

    This SQL command changes the password and requires a password change, but does not delete existing sessions.
  </Step>

  <Step title="Sign in and choose a new password">
    Open Central and sign in with username `admin` and password `admin`. Central requires you to set a new password right away.
  </Step>
</Steps>
