Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

Hey im having some trouble allow remote connections to postgres from other ec2 instances using the named security group feature to rules.

I have set the listens directive in postgres.conf to "*" and have allowed all ips in the pg_hba.conf file to

host all all md5

i have a security group for the instance trying to connnect called appserver and one called db for the postgres instance. the db security group allows TCP connections from 5432 from any instance with the appserver security group

However this simply dosent work. I cannot establish a connection to postgres remotely. To validate things are working with postgres in general i allowed for the db security group for port 5432 and it worked.

I really dont know what else to try now!

share|improve this question
Are you sure that the instance from which you are trying to make connection, is a part of appserver security group .. because usually it works ? – GeekRide Dec 20 '12 at 6:47
@GeekRide yeh 100% – Mike Waites Dec 20 '12 at 14:32
Is this setup in VPC or just simply EC2 and no VPC is included ? – GeekRide Dec 20 '12 at 18:31
@GeekRide this is simply EC2 and no vpc – Mike Waites Dec 25 '12 at 0:01
are you using an external dns to connect from one instance to another? i.e and not – Alistair Prestidge Jan 7 '13 at 21:07

Your Answer


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

Browse other questions tagged or ask your own question.