jesfaj7 Posted February 26 Posted February 26 I try to connect to postgres database on docker from my local but I recive this message: Failed DBMS: PostgreSQL (no ver.) Case sensitivity: plain=mixed, delimited=exact Connection to vps95.heliohost.us:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections. I use this string connection: jdbc:postgresql://vps95.heliohost.us:5432/ The info of my account is:IPv4: 65.19.166.234IPv6: 2001:470:1:1ee::95SSH Port: 22Memory: 1 GBCPUs: 2Storage: 50 GBOS: Ubuntu22Domain: vps95.heliohost.us I don't know if this is the right way to make a connection.
wolstech Posted February 27 Posted February 27 I assume you're connecting from your PC and not from something else that's running on the VPS? If so, do you have a firewall configured on the VPS and is port 5432 open inbound through it so the connection can reach the pg server? 1
jesfaj7 Posted February 27 Author Posted February 27 (edited) I created the account yesterday, only installed Docker and create the container but I don't know if the VPS have by default a firewall, I do not configured any one. Neither I know if the port 5432 is open, I have been assume that yes. Note: yes, I try to connect from my local PC using DBeaver Edited February 27 by jesfaj7
wolstech Posted February 27 Posted February 27 Krydos would be the one who would know more about vps issues. 1
Krydos Posted February 27 Posted February 27 The firewalls on VPS are off by default when it is built. So it is only active if you enable it. Since you're running the database inside Docker instead of directly on the VPS you have to allow the remote connection twice. Once it get outside the Docker container, and then again to get outside the VPS. If you install PostgreSQL directly it's a little easier and you only have to allow it once instead of having two layers. This link should help you https://stackoverflow.com/a/37704532 If after reading this stackoverflow you still have questions, let us know. 1
jesfaj7 Posted February 27 Author Posted February 27 Thanks you Krydos, the problem was that I not had expose the port 5432 for the Docker container, I saw the error reading the Stackoverflow link that you shared
Recommended Posts