Set Postgresql open for remote access in EC2


To make PostgreSQL can be accessible from remote, first in EC2 security, please open your port “5432” (if your installation is using default port).

Next, we need to edit pg_hba.conf :

/etc/postgresql/9.3/main/pg_hba.conf and add :

1
host    all             all             0.0.0.0/0               md5

Restart your services and test by

1
psql -h server-ip -U username -d database_name

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.