Question

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

Subscribe
Share

Hi, were you ever able to get this solved? I am having the same issue on a Django 1-click install on Ubuntu. I have the name, user, and password, also trying on port 5432, using the Pycharm IDE’s. I have been able to connect to remote MySQL and SQL-Servers elsewhere in the past using this IDE.


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

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.

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

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 0.0.0.0/0 md5

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

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 0.0.0.0/0 md5

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

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 0.0.0.0/0 md5

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

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 0.0.0.0/0 md5

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

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 0.0.0.0/0 md5

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

This comment has been deleted

I do the samething and works when i change password

sudo -u postgres psql

ALTER USER sammy PASSWORD ‘newpassword’;

@kirilscherbach you’ve provided a much better instruction than the official page of Digital Ocean. The problem is that you haven’t enabled the right url slug etc " How to configure your Postgresql database on Digital ocean" or “How to bla bla bla” and it would have saved me time searching for how to do exactly what you wrote.

You’ve done a fine job writing that article. Hope you change your url slug. ;)