Search code examples
postgresqlgoogle-cloud-platformcloudpgadmin-4

Unable to connect PostgreSQL(pgAdmin 4) to the Google Cloud Platform


I have instance on Google Cloud Platform and I'm trying to connect it to the pgAdmin 4.

So here is my postgresql.conf enter image description here

So I've tried the following:

I've wrote the instance ip as well as the username and password.

And I get the following error: enter image description here

I've added my IP Address on cloud instance, but this didn't help as well.

enter image description here

Is there something else what I can try?


Solution

  • Posting this as a community wiki as this is based on the comments shared by @AdrianKlaver:

    Given that you get a timeout expired error, which generally means a firewall blocked the connection, this is likely to be an issue on the port 5432 not being open to external access, so if you change that this might work.

    NOTE: Just remember that you once you do this you will have opened the database to public access as determined by the IP's you allow in. Make sure your pg_hba.conf and role security are sufficient to deal with this. You can find more information on how to set this up by following both of this documenation links for Client Auth and to Create Roles