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 |