Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I installed postgresql 8.4.x on Ubuntu server 10.04 on x386 box. I also did the following steps

edited /etc/postgresql/8.4/main/postgresql.conf and added the following lines
listen_addresses = ‘*’
password_encryption = on

edited /etc/postgresql/8.4/main/pg_hba.conf and added
host all all y.y.y.y md5

I enabled the firewall to open port 5432 and checked to see if the port is open bye typing sudo ufw status and I could see that 5432 is open.

Then finally I restarted the postgres service.

However, from my PC, I am not able to connect to the postgresql server -- I get the error as "could not connect to server: Connection refused . Is the server running on host x.x.x.x and accepting TCP/IP connections on port 5432 ?".

What can I do to ensure that postgres can listen to my connections ?

Thank you,


share|improve this question

I found out that I actually did not save my changes to postgresql.conf which meant that the server was only listening to localhost interface and not to other interfaces. Duh!

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.