Unable to connect to server: PgAdmin 4

You can configurate your newly created server to run on localhost and port 5432.

First select the “Connection” tab in the “Create-Server” window. Then, configure the connection as follows:

  • Enter your server’s IP address in the “Hostname/ Address” field. Default is localhost.

  • Specify the “Port” as “5432”.

  • Enter the name of the database in the “Database Maintenance” field.

  • Enter your username as postgres and password (use the same password you used when previously configuring the server to accept remote connections) for the database.

  • Click “Save” to apply the configuration.

NOTE You first have to install PostgreSQL on your machine and run it or run it with docker.


In case someone is running the pgadmin-4 in docker, and not able to connect to postgres container, like me. The solution is to first find the ip at which the docker image is running.

Step-1, make sure the postgres container is running.

Step-2 write command- PS C:\docker> docker ps Should result as below or similar,

enter image description here

Step3- in order to find the ip address running the postgres use part of container ID and analyze like below command

PS C:\docker> docker inspect fc834 enter image description here Note: Here I have only used part of container id that is fc834..

This should result the following or similar, Step4-

Use this ip address in the connection as below with your correct username and password

enter image description here enter image description here


You may need to installing PostgreSQL Server first.


You can verify if the folder is created in the below folder, C:\Program Files\PostgreSQL