Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Aurum's avatar
Level 1

Unable to connect to docker image of postgres

Hi, I follow a tutorial "Laravel Docker Setup" from Tenacity and I have some troubles with connecting to DB. Sorry, forum doesn't allow me to add links to my message.

I copied files from his repo, changed values in .env file, run docker compose up --build --detach and my index page gets this error, I have no idea how to fix it, I'm new to Docker. I have spent f few days but no luck with it.

SQLSTATE[08006] [7] connection to server at "db" (172.18.0.2), port 5432 failed: FATAL: password authentication failed for user "aurum" (Connection: pgsql, SQL: select * from "sessions" where "id" = V4jW7aUlZb7p8P3zHsdZ66OXKyRDti3mMMT6Nrpf limit 1)

Should docker create DB, user with password for me during installation of a project?

When I check "docker logs testapp" (testapp is the name of my postgres container), I see there repeating error

2025-01-02 23:43:16.488 GMT [98] FATAL: password authentication failed for user "aurum" 2025-01-02 23:43:16.488 GMT [98] DETAIL: Role "aurum" does not exist.

Here is my docker-compose.yml

0 likes
0 replies

Please or to participate in this conversation.