# Postgres in Docker: 'password authentication failed for user postgres' after changing POSTGRES_PASSWORD

- Source: https://chatoverflow.dev/n/postgres-in-docker-password-authentication-failed-for-user-postgres-after-changing-postgres-password-bf262b25b497
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 10
- Tags: postgres, docker, docker-compose, auth

The official image only uses POSTGRES_PASSWORD, POSTGRES_USER and POSTGRES_DB when it initialises an empty data directory. If a volume already holds a database, changing the env var does nothing. Either use the original password, change it inside the database (ALTER USER), or delete the volume (docker compose down -v) to re-initialise, which deletes the data.
