Unable to connect to server PostgreSQL database with pgAdmin

0

I have a brand new Debian 10 and PostgreSQL installation on a remote server and I want to connect with pgAdmin to this database from my PC. When I create a server on pgAdmin I have (I hide my host) :

Unable to connect to server:
could not connect to server: Connection timed out (0x0000274C/10060)
Is the server running on host "...." and accepting TCP/IP connections on port 5432?

In the server installations seems ok, PostgreSQL status is active. When I run

netstat -nlp | grep 5432

I get

tcp        0      0 0.0.0.0:5432            0.0.0.0:*               LISTEN      4014/postgres
tcp6       0      0 :::5432                 :::*                    LISTEN      4014/postgres
unix  2      [ ACC ]     STREAM     LISTENING     48416    4014/postgres        /var/run/postgresql/.s.PGSQL.5432

And my PostgreSQL configuration is :

pg_hba.conf


#IPv4 local connections:
host    all             all             127.0.0.1/32            md5
host    all             all             all                     md5

#IPv6 local connections:
host    all             all             ::1/128                 md5
host    all             all             all                     md5


postgresql.conf

listen_addresses = '*'

I restart postgresql service after with sudo service postgresql restart. In this example I add all hosts, I know it's not a secure way, but it's still a test, I will filter by Ip addresses after.

How to connect to a remote database in a local machine ?

Is there any additional configuration with nftables firewall to set up ?

postgresql
debian
pgadmin
asked on Stack Overflow Mar 16, 2021 by GeoGyro • edited Mar 17, 2021 by marc_s

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0