Install Postgresql 9.6 on Ubuntu via bash script command

PostgreSQL Ubuntu

Download postgresql

add-apt-repository "deb $(lsb_release -sc)-pgdg main"
wget --quiet -O - | sudo apt-key add -
apt-get update
apt-get install postgresql-9.6 -y

Allow access from outside you need to change “”  to “” and localhost to “* “

sed -i -e 's#' /etc/postgresql/9.6/main/pg_hba.conf
sed -i -e "s/#listen_addresses = 'localhost'/listen_addresses = '*'/g" /etc/postgresql/9.6/main/postgresql.conf

Note : Run this script as administrator.

Leave a Reply

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