Skip to content

Cannot connect to the postgres in docker container #1681

@GrzesiuKo

Description

@GrzesiuKo

Today I pulled the newest image of postgres:
docker pull postgres
And started container out of it:
docker run --rm --name pg-docker -e POSTGRES_PASSWORD=docker -d -p 5432:5432 postgres
After that I tried to access the postgres:
psql -h localhost -U postgres -d postgres
And connection failed:
psql: error: could not connect to server: could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432?
could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "localhost" (127.0.0.1) and accepting TCP/IP connections on port 5432?

All the instructions I did according to the repositories documentation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions