Allow postgress remotely ubuntu 22.04

 Check Postgress config file
sudo -u postgres psql -c "SHOW config_file;"

Change localhost to * for all network
sudo  vim /etc/postgresql/14/main/pg_hba.conf
#listen_addresses = 'localhost'
 listen_addresses = '*'
 

 Add below line in pg_hba.conf file

sudo vim /etc/postgresql/13/main/pg_hba.conf
# TYPE  DATABASE    USER    ADDRESS       METHOD
host    all         all     0.0.0.0/0       md5
 
 
Restart postgres service
sudo systemctl restart postgresql

Share on Google Plus

About Penguin Technology

I am a passionate cloud and DevOps professional specializing in Linux and open-source solutions. Through this blog, I share my knowledge and experience with the community, offering tips and insights on cloud technologies and DevOps practices.
    Blogger Comment

0 comments:

Post a Comment