How did I do?*

Configure PostgreSQL server for remote connections

  • Download from https://www.enterprisedb.com/downloads/postgres-postgresql-downloads and install on your server
  • Navigate to <installation directory>/PostgreSQL/16/data and open "postgresql.conf" and "pg_hba.conf" files in a text editor
  • In "postgresql.conf, ensure that:
    • listen_addresses = '*' (or your IP range, as long as it doesn't say "localhost")
    • port = 5432
  • In "pg_hba.conf, ensure the following line is added to the bottom of the file
    • host     all     all     all     scram-sha-256 (or more specific DB/user/IP instead of "all")
  • Open start menu > Services and find "postgresql-x64-16 PostgreSQL Server 16" and restart the service
  • Open Windows Defender Firewall > Advanced settings > Inbound rules and add a new rule for port 5432
  • Ensure any other firewalls also allow this port (e.g. AWS security group inbound rule)