At Sellf we are using PostgreSQL as our backend database and facing with its configuration it wasn’t so immediate as I would expect. I wrote this tutorial for Ubuntu an RoR to easily configure PostgreSQL in combo with Heroku. Some steps are directly cutted from the original guide of PostreSQL written by the Heroku team.

#1 Installation

To install Postgresql you may use the command line and type:

sudo apt-get install postgresql

#2 Basic server setup

To start off, we need to change the PostgreSQL postgres user password; we will not be able to access the server otherwise. As the “postgres” Linux user, we will execute the psql command:

sudo -u postgres psql postgres

Set a password for the “postgres” database role using the command:

\password postgres

and give {your-password} when prompted. The password text will be hidden from the console for security purposes. Type Control+D to exit the posgreSQL prompt.
To create the databases for the development and test environments, simply type: