3

I have postgres 13.10 and PGAdmin4 7.1 installed on Ubuntu 22.04

In PGAdmin4 UI, I want to "add new server" with these configurations

name
postgres-local

username postgres

pw postgres

hostanme / address 127.0.0.1

port 5432

server group Servers

so I have run in my terminal

sudo -i -u postgres

psql

ALTER USER postgres WITH PASSWORD 'postgres';

Then I login into PGAdmin4, try to add new server inserting the cofigurations above, but as I click on save I get this error

unable to connect to server: connection failed: connection refused is the server running on that host accepting tcp/ip connections?

What could be the problem?

What I already tried

I have checked that postgres is running correctly via sudo service postgresql status.

enter image description here

I have already tryed to

edit file /etc/postgresql/13/main/postgresql.conf uncommenting
listen_addresses = 'localhost'
and changing it into
listen_addresses = '*'

edit file /etc/postgresql/13/main/pg_hba.conf changing lines

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

to

# IPv4 local connections:
host    all             all             0.0.0.0/0               md5

restarting postgres

sudo service postgresql restart

But I had no success.

Tms91
  • 595

1 Answers1

4

Have you made sure that postgres is running on that port?

sudo netstat -lntp | grep postgres

Have you made sure that the firewall is not blocking that port?

sudo ufw allow 5432
CB_Ron
  • 237