Grafana installed on remote machine and docker running Postgres locally

I have a linux virtual machine remotely on the cloud hosted at digitalocean, this machine has grafana installed. Locally I have docker and I launched a postgresql server with the following docker-compose.yml:

version: '3.8'

    image: timescale/timescaledb-ha:pg14-latest
    container_name: timescaledb
      - "5432:5432"
      - timescale-volume:/home/postgres/pgdata/data
      - POSTGRES_DB=postgres
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=password
      - trade-net
    external: true

    external: true

Upon checking my network with network inspect trade-net I get:

"IPv4Address": ""

I would like to connect via grafana now to my postgresql docker container which has been launched from my local machine, the grafana options are the following ones:

I have tried to fill this with :

Database: postgres
User: postgres Password: password

But the connection is never established.

One thing to note is that my postgresql.conf file has :

listen.addresses = '*'

I have also tried my public IP address from my local machine instead of the docker IP address , but it didn’t work as well. I got my public IP address with this command:


connect a VM on a cloud platform like DO to a DB on your local machine does not sound ideal. Are you sure that your local DB is reachable over the public internet? I would also try turning off the ssl mode at first.

also try increasing the verbosity of the Grafana server logs to debug and note any errors. For printing to console, set the console logs to debug as well.