Skip to content

Instantly share code, notes, and snippets.

@vshvedov
Last active April 20, 2016 10:29
Show Gist options
  • Save vshvedov/2af7df3da27e77bc8ad02fad88bf0f8b to your computer and use it in GitHub Desktop.
Save vshvedov/2af7df3da27e77bc8ad02fad88bf0f8b to your computer and use it in GitHub Desktop.
Make PG accessible from outside in Debian/Ubuntu
# /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