0

Context

I have an old laptop I'd like to host a database on to serve a MEVN stack hosted on AWS. That MEVN stack currently does use Mongo, the goal is to transition to a local (my laptop) Postgresql DB. Goal is to learn more about Postgres & SQL.

Problem

I am first trying to learn how I can remote into the laptop through another computer however am ending up with Unable to connect to server: connection timeout expired on pgAdmin 4. I'd like some help on how I can successfully remote into the laptop postgres server.


I have:

  • changed postgresql.conf to listen_address = '*' on default port 5432
  • added host all all 0.0.0.0/0 md5 to pg_hba.conf
  • Added an inbound rule in Windows Firewall to allow any IP on port 5432
  • Disabled Windows Firewall entirely. netstat -a -b shows
[svchost.exe]
TCP 0.0.0.0:5432 MyComputer:0 LISTENING
  • Restarted the postgresql Server through Services

Running psql -U postgres -h 192.168.86.229 -p 5432 does not return any errors. Info for registering the server on my desktop in pgAdmin looks like this:

https://i.imgur.com/VWmeSmm.png

2
  • 192.168.86.229 is a private IP address. It is like referring to "Uncle Bob". My Uncle Bob and your Uncle Bob are probably not the same person. How did you conclude this is the correct address to use?
    – jjanes
    Commented May 9, 2023 at 1:06
  • @jjanes I realized I was using the private IP a little bit after posting this and tested the public IP to end up with the same result. I did use the private originally however simply because I was following this guide, where although they don't say which IP to use, the IP in their picture is also private.
    – Ryan
    Commented May 9, 2023 at 2:18

1 Answer 1

0

As mentioned in the comments, using the private IP was wrong. However at the time the public IP did not work either.

What resolved the issue was port forwarding both of my routers (verizon & google mesh) to listen for incoming connections on 5432. Once I set this up, I was able to connect remotely through the internet.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.