Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save arif-m150/e5d192b096bdf1a6ba4d452b45f02447 to your computer and use it in GitHub Desktop.
Save arif-m150/e5d192b096bdf1a6ba4d452b45f02447 to your computer and use it in GitHub Desktop.
PostgreSQL Configuration to Allow access from outside network
  cd /etc/postgresql/14/main/

open file named postgresql.conf

add this line to that file

  listen_addresses = '*'
  port = 5432
  max_connections = 80

then open file named pg_hba.conf

  sudo nano pg_hba.conf

sudo nano pg_hba.conf

  host  all  all 0.0.0.0/0 md5

It allows access to all databases for all users with an encrypted password

restart your server

  sudo systemctl restart postgresql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment