Last active
April 20, 2016 10:29
-
-
Save vshvedov/2af7df3da27e77bc8ad02fad88bf0f8b to your computer and use it in GitHub Desktop.
Make PG accessible from outside in Debian/Ubuntu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/postgresql/9.4/main/postgresql.conf | |
#--------------------------------------------------------- | |
# CONNECTIONS AND AUTHENTICATION | |
#--------------------------------------------------------- | |
# - Connection Settings - | |
listen_addresses = '*' # Postgres, pretty please keep your ears open on everything. | |
Allow remote connections to actually reach your PostgreSQL instance. | |
Next we're going to edit our pg_hba.conf file and configure it to allow remote connections. At the very end of the file, add the following line: | |
# /etc/postgresql/9.4/main/pg_hba.conf | |
host all all 0.0.0.0/0 md5 | |
Restart: | |
sudo service postgresql restart | |
or | |
sudo /etc/init.d/postgres restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment