I tried use docker just install this docker container https://hub.docker.com/r/mdillon/postgis/ run this command from manual:

docker run --name some-postgis -e POSTGRES_PASSWORD=mysecretpassword -d mdillon/postgis

And now wnat to enter in psql:

su postgres

ANd i just can not login. I always thoght that postgres is default password but it not allow this.

What i can miss there?

  • Did you try sudo su - postgres? May 28, 2019 at 12:18

1 Answer 1


There isn’t a default password. The default authentication mode for PostgreSQL is set to ident, not to sql DB user/password.

Running cat /var/lib/pgsql/9.3/data/pg_hba.conf will show you that.

What that actually means is that in order correctly connect to PostgreSQL you must be logged in as the correct OS user that was used to install it. You practically authenticate with the OS user.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .