Linux Database Server: Postgresql and pgAdmin

I hope that you use a Debian-based distro!

sudo apt-get install postgresql

Setup the postgres‘s password:

sudo -u postgres psql

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 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!

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s