pgadmin4 : postgresql application server could not be contacted.

I found the same issue when upgrading to pgAdmin 4 (v1.6). On Windows I found that clearing out the content inside C:\Users\%USERNAME%\AppData\Roaming\pgAdmin\sessions folder fixed the issue for me. I believe it was attempting to use the sessions from the prior version and was failing. I know the question was marked as answered, but downgrading may not always be an option.

Note: AppData\Roaming\pgAdmin is a hidden folder.


We got the same issue. so no any change in the file. but start pgAdmin 4 using administrator.

The following step. 1. right click pgAdmin 4 icon 2. select "Run As Administrator"


I had the same issue on Windows 10, with a new installation of PostgreSQL 10.

I solved it by including the path C:\PostgreSQL\10\bin ({your path to postgresql}\bin) to system environment variables.

To access environment variables: Control Panel > System and security > System or right click on PC, then > Advance system settings > Environment variables > System variables > Path > Edit.


It seems in most of the cases Postgres trying to use information from previous sessions to find/connect the server and failing. Clearing out the previous session info helped me, it is a combination of 2 already mentioned answers above:

  1. Navigate to Postgres session's folder C:\Users\YourUsernameOrAdmin\AppData\Roaming\pgAdmin\sessions
  2. Delete all the data from this folder.
  3. Start PgAdmin in administrator mode.

Cheers!