Concise instructions for setting up remote access to a fresh PostgreSQL 9.1 installation on Ubuntu 12.04 because I’m tired of googling every other month for it.

In /etc/postgresql/9.1/main/postgresql.conf

listen_addresses = '*'

And in /etc/postgresql/9.1/main/pg_hba.conf:

host    all     all      0.0.0.0      0.0.0.0.      md5

Note that this is horribly insecure, letting any user connect to any database.. It’s just an example.

Finally, restart Postgres.

sudo service postgresql restart