Connecting to local PostgreSQL started within docker

Hi all,

I set up a local installation with docker [] and like to connect the PostgreSQL-Server obviously running. I found some credentials in the file


But even the user musicbrainz mentioned there is not connected!


Ends up with

Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections. [SQL State=08001]

Changing host from localhost to doesn’t make it work neither. Can someone tell me how to connect to PostgreSQL please?

Many thanx


One possible reason could be:

1 Like

Thank you. Almost perfect, now the test-user can connect. How do I get superuser postgres connected? I used login-name postgres and database musicbrainz_db but got The server requested password-based authentication, but no password was provided. [SQL State=08004] on an empty password and FATAL: password authentication failed for user "postgres" [SQL State=28P01] on password postgres.

You can try this one:


Works perfectly fine, thank you!

musicbrainz-docker> psql -h -U musicbrainz -W
psql (12.4)
Geben Sie »help« für Hilfe ein.

musicbrainz=# \l
                                       Liste der Datenbanken
      Name      | Eigentümer  | Kodierung | Sortierfolge | Zeichentyp |     Zugriffsprivilegien     
 musicbrainz    | musicbrainz | UTF8      | en_US.utf8   | en_US.utf8 | 
 musicbrainz_db | musicbrainz | UTF8      | C            | C          | 
 postgres       | musicbrainz | UTF8      | en_US.utf8   | en_US.utf8 | 
 template0      | musicbrainz | UTF8      | en_US.utf8   | en_US.utf8 | =c/musicbrainz             +
                |             |           |              |            | musicbrainz=CTc/musicbrainz
 template1      | musicbrainz | UTF8      | en_US.utf8   | en_US.utf8 | =c/musicbrainz             +
                |             |           |              |            | musicbrainz=CTc/musicbrainz
(5 Zeilen)