connect to droplet running postgresql 9.3 with pgadmin3

Posted May 13, 2014 26.2k views
Hey Folks. I am running ubuntu 14.04 x64 on my own computer, and I am trying to access a droplet that is running 1404 x64 with postgresql 9.3. So I want to connect to the droplet postgresql instance using pgadmin3. I was not sure how to do this though? Are there any particular permissions or services I have to set on the droplet to remotely connect with pgadmin?
1 comment
  • I am wanting to the do same thing however i’m having great difficulty with SSH tunnelling and using my keys. I keep getting Error Code 61 when I try to create my connection. I also can’t find any examples anywhere for this.

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.

Submit an Answer
12 answers
First you need to make sure postgres is accessible remotely. Edit the file "/etc/postgresql/9.3/main/postgresql.conf " and change the "listen line from:

#listen_addresses = 'localhost'


listen_addresses = '*'

Then restart postgres with: "service postgresql restart"

Now you should be ready to connect using pgadmin3. Take a look at the documentation here:

In the host field, use the IP address of your droplet. By default, postgres listens on port 5432. The username and password should be for the database user.

For some more basic postgres help, check out:

Let us know how it goes!
by Justin Ellingwood
PostgreSQL is one of the most powerful and popular relational database management systems available for open source platforms. In this guide, we'll talk about how to get it up and running on an Ubuntu 14.04 VPS instance.
You could use something like:

host all all md5

to enable connections from all IPs provided you have the password. Though it's generally considered better practice to restrict access to certain IP ranges. You can provide multiple different ranges if you move between different trusted networks. Check out the documentation here:
@dangelo: Have you set up a firewall? Make sure port 5432 on the server is actually open. On the server, you can run "netstat -plunt" to see a list of which ports are open with something actively listening for connections.
Hmm, I tried this. I opened the postgresql.conf file, uncommented the listen_address option and set it to "*". I then restarted the postgresql 9.3 service.

The issue I am running into is an error message saying that I need to include an entry in the pg_hba.conf file to include my iprange in the connections. pgadmin indicated I needed to include a "local all all" rule there. However, I am worried about portability as I take my laptop from network to network. Is there any better way to do this?

I am trying to use pgAdmin III to access my postgresql database on Ubuntu 14.04 x32. I did the step above to postgresql.conf, but on my client I get the following error:

"could not connect to server: Connection refused Is the server running on host "" and accepting TCP/IP connections on port 5432?"

Is there anything else that I could do?


Hmm, it looks like that could be my issue:

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0* LISTEN 797/sshd
tcp 0 0* LISTEN 855/postgres
tcp6 0 0 :::22 :::* LISTEN 797/sshd

What would be the best way to open up port 5432 for external connections? (I assume the line opens it locally). Thanks again for your assistance.
@dangelo: It looks like you are actually using port 855 for postgres. So make sure you use that in the pgAdmin III connection dialog.
Even if I use that, I'm still not having success. Do I need to be using SSH tunnelling?

I'm using:
Host: My droplet IP
Port: 855
Maintenance DB: postgres
Username: postgres

Am I missing something? Thanks again for the help. Are you getting the same error message when you change the port or something different?
I am getting the same error message. There wouldn't be a firewall set up on the server by default, would there be?
  • la solución en es la siguiente:

    listen_addresses = ’*’

    por lo general siempre viene comentada con el # por lo que debe eliminarlo.
    adicional debería configurar el pg_hba.conf

    agregar la linea:
    host all all md5

    de esa manera permite conexiones externas a la local.

Previous 1 2 Next