Rul
Rul

Reputation: 167

Port 5432 is closed on Google Compute Engine

Currently I need to establish remote connection with my server (Ubuntu 16.04 LTS). I Install Postgresql and I made the following settings:

/etc/postgresql/9.5/main/postgresql.conf:

listen_addresses='*'

/etc/postgresql/9.5/main/pg_hba.conf:

host    all             all             0.0.0.0/0               md5

If run this command: netstat -anpt | grep LISTEN shows the port is listening enter image description here

but when I try to establish the connection, I have this error: enter image description here

And this tool tells me that the port is closed: enter image description here

Upvotes: 1

Views: 1913

Answers (1)

Marlon Abeykoon
Marlon Abeykoon

Reputation: 12495

Allowing only on Configurations of Postgresql server is not enough. You need to add a firewall rule in google compute engine. Check this

Firewall rules control incoming or outgoing traffic to an instance. By default, incoming traffic from outside your network is blocked.

Upvotes: 4

Related Questions