PostgreSQL Network Access – (Solution)

After we installed and configure PostgreSQL properly, it is no problem to access locally, however when we access through the network , we hit following error message.

could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host “” and accepting TCP/IP connections on port 5432?

It is because PostgreSQL disable network access by default. It is required to do some configuration to make it work.

1) Please access postgresql.conf file.


2) Modified it and uncomment listen_addresses field and put ‘*’ to indicate allow access from all network address.


3) Please access pg_hba.conf and put this line , is my network, please change it accordingly

host all all trust


Please access PostgreSQL documentation to understand what inside pg_hba.conf and how to configure it

After all done, PostgreSQL is ready to access through network, actually i find out this feature is very useful, because it can restrict network access from specified ip address or network.

About the Author

author image
Founder of, love Java and open source stuff. Follow him on Twitter. If you like my tutorials, consider make a donation to these charities.


0 Comment threads
0 Thread replies
Most reacted comment
Hottest comment thread
0 Comment authors
Recent comment authors
newest oldest most voted