Once you have your PostgreSQL database server installed, up and running, due to security reasons by default remote access to connect with your database instance is disabled.
If you try connecting with your PostgreSQL database server from client machine, you will encounter error.
could not connect to server: Connection refused