Password does not match for user "postgres" Password does not match for user "postgres" postgresql postgresql

Password does not match for user "postgres"


The Postgres password is set on the first initialization if the db (when the var/lib/postgresql/data folder is empty). Since you probably ran docker-compose before with a different password, the new one will not take effect. To fix this, remove the volume in your host machine and have docker-compose automatically recreate it next time you run docker-compose up. Note that removing this volume will delete all data stored in PostgreSQL


This might have to do with your volumes. Try pruning your volumes and then bring up your containers again. MAKE SURE YOU DON'T NEED THE VOLUMES BEFORE YOU PRUNE THEM!

To see what existing volumes you have

docker volume ls

And then clear them out if you can

docker volume prune


Another way to fail with POSTGRES_PASSWORD is to set a password with forbidden characters. You won't get any warnings, but you won't be able to login with this password.