1 min read

Initialize PostgreSQL in Ubuntu 12.04

Install

sudo apt-get install postgresql

Configure

sudo -u postgres createuser -D -P ruser
sudo -u postgres createdb -O ruser ruserdb

Edit /etc/postgresql/9.1/main/pg_hba.conf.

Change this line:

local   all             all                                     peer

to this:

local   all             all                                     md5

Restart service:

sudo service postgresql restart