Você precisa ajustar
pg_hba.conf :https://www.postgresql.org/docs /current/static/auth-pg-hba-conf.html
Depois de adicionar seu próprio host e usuário correspondente, reinicie o servidor postgresql para que você possa se conectar.
Além disso, você pode precisar habilitar sua porta na rede:https://www.cyberciti.biz/tips/postgres-allow-remote-access-tcp-connection.html