Skip to content

Instantly share code, notes, and snippets.

@abhianair
Last active April 27, 2024 15:03
Show Gist options
  • Save abhianair/e97f7b274ba95fdc2c9ae99ef323815d to your computer and use it in GitHub Desktop.
Save abhianair/e97f7b274ba95fdc2c9ae99ef323815d to your computer and use it in GitHub Desktop.
Remotely connecting to digital ocean postgresql server using pgadmin
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. $$$$$$$$$$$
@anko20094
Copy link

Thanks. Is there how do it secure?

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