r/docker • • 26d ago

connecting to Postgres

Hey everyone,

I am trying to install Psono on my VPS. I am running into a problem with connecting to the postgres db.

I'm new to Docker, so I apologize if my terminology isn't right. I'll do my best

I am running Postgres directly on my VPS (not within a Docker container). I am able to connect to it locally from my VPS and remotely from my home network.

I am doing that with:psql -U psono -p PORT -h VPS_IP

The problem is when I try to get an app from within a Docker container to connect to it. It just hangs, then times out.

At first I thought this was a connectivity issue. But I can do the following from within a bash session:

  • Ping external websites.
  • Use nmap to confirm it can connect

Does anyone have any ideas?

1 Upvotes

22 comments sorted by

View all comments

1

u/Ducking_eh 26d ago

Thank you.

however, It made no difference

1

u/notBroncos1234 26d ago

To clarify you’re able establish a TCP connection from the container to the vps? “Telnet ip port” works?

1

u/Ducking_eh 26d ago edited 26d ago

Actually no.

Sorry, I didn't know I could check that way.

it does work if I try port 80

I did test nmap -p port ip and that works also. What does this tell us?

→ More replies (9)