bugged.be

"Think outside the [B0X]"
Icon

installing postgresql on ubuntu

Steps for installing postgresql server and make it accessible from remote clients.

1 Install

sudo apt-get install postgresql

2 Switch to postgres user

sudo -i -u postgres

3 Update password

ALTER USER postgres WITH PASSWORD '<new password here>'

To exit postgresql cli:

\q <ENTER>

4 Allow remote access

in “/etc/postgresql/9.5/main/postgresql.conf”, change in Connection settings:

listen_addresses='*'

in “/etc/postgresql/9.5/main/pg_hba_conf”, add following lines:

host      all      all      0.0.0.0/0      md5
host      all      all      ::/0           md5

5 Connect

to connect:

jdbc:postgresql:[<//host>[:<5432>/]]<database>

Category: Linux, server, Sql

Tagged: