Postgresql enable remote access

To enable remote access to a postgresql database from a computer or server, in Ubuntu server, first we need to know the ip of the computer in question, for example

Then, from the terminal, enter the directory where postgresql is installed:


open edit pg_hba.conf:

sudo nano pg_hba.conf

and add the following line:

host all all trust

Finally, edit the postgresql.conf file in the same directory as follows:

listen_addresses = '*'

Once saved, you must restart postgresql:

sudo service postgresql restart

Leave a Comment

Your email address will not be published. Required fields are marked *