I have a PostGIS database setup in PostgreSQL on port 5432 on an AWS Windows server shared with Geoserver, which is running on port 8080. I can connect from Geoserver to the PostGIS database with no issues using "localhost" as the host. The server is on the public domain so I can access Geoserver from any computer outside of out AWS network with an address, for example: http://product.company.com.au:8080/geoserver/web.

I need to be able to access the PostGIS database from applications outside the network, specifically from GISCloud. When I try to connect to the database from GISCloud (using http://product.company.com.au as the host), I get the error "Test Failed: Sorry, but you cannot use 'localhost'".

I imagine that this is either a configuration setting in PostgreSQL, however I have tried a few of the changes shown in other similar posts without any luck.

Alternatively, is it just a case of opening the specific port and this will work?

Or is there more to it than that?

closed as off-topic by Ian Turton May 17 '18 at 6:16

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    Have you opened up Postgres for outside connections in pg_hba.conf? postgresql.org/docs/9.1/static/auth-pg-hba-conf.html Is port 5432 open on your firewall? – Michael Stimson May 17 '18 at 3:27
  • I've followed the instructions to edit the pg_hba.conf, updated the postgresql.conf to listening_addresses='*', and checked the firewall advanced settings on the local machine and there is an inbound rule to allow TCP for postgresql on port 5432. I then used "netstat -na | findstr "5432" in the command line and it showed that and [::]:5432 were both listening. Could the firewall be blocked on the network even though it appears to be allowed on the local server?\ – TravisMoon May 17 '18 at 5:03
  • That's the whole point of a firewall, to block incoming connections. If you're on windows it's a good idea to edit your services file to allow the connection.. from here I would try to connect on an intranet workstation to your server to see if it's the server or the firewall. Note that isn't a valid IP address. – Michael Stimson May 17 '18 at 5:47
  • I just figured this out 2 weeks ago: 1st. edit your config file blog.bigbinary.com/2016/01/23/… and then you need to create an inbound rule exception for port 5432 through the firewall. – ziggy May 22 '18 at 12:24
  • Thanks for the replies, it turns out that the port was blocked at the network level, so adjusting the firewall settings on the server wasn't enough. I'm currently working with our IT department as well as the application we want to connect with the database to set up our firewall so it only allows specific requests and isn't completely open on that port. After a bit more research I agree that this question is more IT related than GIS related. – TravisMoon May 23 '18 at 2:19

Browse other questions tagged or ask your own question.