Getting 'Connection refused' after installing PostgreSQL and PG Admin 4
Edit postgresql.conf and change listen_addresses = 'localhost' to listen_addresses = '*'
Edit pg_hba.conf file and add an entry for the IP/network you are connecting from.
To allow anyone to connect add:

host    all             all             0.0.0.0/0            md5

Only one IP (10.0.0.10):

host    all             all             10.0.0.10/32            md5
Change firewall settings on the server to allow connections to port 5432.