Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save laurianops/3f30e604eafb61799de041a5bd7679b7 to your computer and use it in GitHub Desktop.
Save laurianops/3f30e604eafb61799de041a5bd7679b7 to your computer and use it in GitHub Desktop.
Remotely connecting to digitalOcean postgresql server
1) Login to your droplet with super admin privilage.
2) Navigate to /etc/postgresql/{version}/main.
3) open postgresql.conf sudo nano postgresql.conf
add line
listen_addresses = '*'
Save and Exit.
4) open ph_hba.conf sudo nano pg_hba.conf
add line
host all all all md5
save and exit.
5) Allow TCP connection though port 5432
sudo ufw allow 5432/tcp
6) Restart postgresql service
sudo service postgresql restart
7) Now open your pgadmin application in your client machine.4
8) Object -> Create -> Server
9) Unside Popup.
-> Fill name (any)
-> Goto Connection
-> Fill Hostname with your server IP
-> Port 5432
-> Maintance Database -> Database name -> Defalt is postgres
-> Username -> postgres (database username NOT SERVER USER NAME)
-> password -> postgres password ( database password NOT USER PASSWORD)
$$$$$$$ IF NONE OF THIS ABOVE WORK CONTACT BATMAN, HE HAVE ALL THE WAYS OF KILLING THINGS WHICH ARE AGAINST THE UNIVERSE. $$$$$$$$$$$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment