I can't get a connection up when creating a PostGIS-store.

  • GeoServer is running fine on IP:80/GeoServer.
  • PostGIS is running and working fine with PSQL commands
  • Created database/table 'mydb' and 'mytable' then changed ownership to Postgres


Error creating data store, check the parameters. Error message: Unable to obtain connection: Cannot create PoolableConnectionFactory (FATAL: no pg_hba.conf entry for host "", user "postgres", database "main", SSL off)

PG_HBA.CONF # Database administrative login by Unix domain socket #local all postgres peer local all postgres trust # TYPE DATABASE USER ADDRESS METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     peer
# IPv4 local connections:
host    all             all               md5
# IPv6 local connections:
host    all             all             ::1/128                 md5
host    all             all             md5
host    all             all              md5
#allow replication connections from localhost, by a user with the# replication privilege.
#local   replication     postgres                                peer
#host    replication     postgres            md5
#host    replication     postgres        ::1/128                 md5

Any idea what is going wrong?

I'm on a Ubuntu on AWS-EC2.

  • What happens when you add local all postgres md5? – Michal Zimmermann May 8 '14 at 13:19
  • 1
    I have a geoserver and several datastore postgis (ownership: postgres) on my machine. The only different with your pg_hba.conf file is the METHOD: trust; however I have enabled also LISTEN ADDRESS: "*" in postgresql.conf – MickyInTheSky May 8 '14 at 15:00
  • 1
    What is the security group configuration on your EC2 instance? I resolved this error connecting to my RDS instance by opening the right port in the EC2 security group. Given postgres is running on the same instance, the security group might/not apply. – Steven Kalt Dec 6 '17 at 19:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.