Remote connect to postgresql with pgadmin

Hi! So i have a test database running on my droplet, but I just cannot remote connect to it. It PGAdmin I have host as my droplet IP, port as 5432, maintenance DB as postgres and username as postgres and password blank, and I get connection refused errors asking me if my server is listening for TCP/IP connections.

I’ve edited the config file to allow ip’s from “*”, and I thought that was all there was to it… So, am I missing something? Do I need to make additional changes? Or do I need to VPN into digital ocean servers or something?

Any help is appreciated. Thanks in Advance

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Did you change pg_hba.conf?

sudo nano /etc/postgresql/9.3/main/pg_hba.conf

and allow connection by all users to all databases from any IP if the user has right MD5-encrypted password by adding the following line:

host all all md5

I have a step-by-step instruction in my blog (sorry for the shameless plug)

If you are using firewall don’t forget to allow port 5432 for ufw use :

ufw allow 5432/tcp

Links above appear to be dead. This worked for me: Connecting to PostgreSQL on Linux