I hope that you use a Debian-based distro!
sudo apt-get install postgresql
Setup the postgres‘s password:
sudo -u postgres psql \password
digit the new password, then press Ctrl+D to exit from psql.
Edit this file (adjust your version number, I’ve used 9.1 for write this guide)
sudo vi /etc/postgresql/9.1/main/postgresql.conf
and change these lines (caution with apices, don’t cut&paste):
#listen_addresses = ‘localhost’ –> listen_addresses = ‘*’
#password_encryption = on –> password_encryption = on
finally define who can access the server:
sudo vi /etc/postgresql/9.1/main/pg_hba.conf
add to the end of file:
host all all [ip address] [subnet mask] md5
here you can specify a single host or a complete subnet, for example:
host all all 192.168.160.0/24 md5
Now we can configure pgAdmin, that is a free and open source graphical user interface administration tool for PostgreSQL, which is supported by many computer platforms.
Install your version, I continue with a GNU/Linux Debian-based:
sudo apt-get install pgadmin3
Open pgAdmin and add your server:
- Name: [any descriptive name]
- Host: [ip address of the server]
- Password: [your postgres’s password]
End: here we are!