I am creating an app that uses a PostgreSQL database server, which I run on a Linux(20.1 Ubuntu) machine. However when the Linux machine is not on the same network as the client that is trying to connect to it, I get the error:
Is the server running on host xxx.xxx.xx.xx and accepting TCP/IP connections on port xxxx?
I have an exception in my firewall for the port, and since the fact that it all works on the same network implies to me, that my configurations are good, I don't understand what I'm getting wrong. I already tried everything here.
My pg_hba.conf
looks like this:
local replication all peer
host replication all 127.0.0.1/32 md5
host replication all ::1/128 md5
host all all 0.0.0.0/0 md5
host all all ::/0 md5
And my postgresql.conf
looks like this:
# - Connection Settings -
listen_addresses = '*' # what IP address(es) to listen on;
# comma-separated list of addresses;
# defaults to 'localhost'; use '*' for all
# (change requires restart)
port = 5432 # (change requires restart)
max_connections = 100 # (change requires restart)
Can someone help me/ guide me how they managed this? I already vetted all the answers, but if I missed something, apologies for the duplication. Any help is appreciated.