PostgreSQL database server by default does not allow the remote computers to connect to that. This is restricted for security reasons. To allow remote connections to PostgreSQL database server from other locations you need to change the followings
CONNECT TO THE REMOTE SERVER
You can go to the computer or, in case that’s in a Linux server ssh to login to that
dbuser@oropc:~$ ssh root@remote-host
CHANGE THE LISTEN ADDRESS
By default, PostgreSQL DB server listen-address is set to the ‘localhost’ , and we need to change it so it accepts connection from any IP address; or you can use comma-separated list of addresses.
Open your postgresql.conf file in your editor. We prefer to use notepad++ in Window. In Linux you can use vim or nano.