LMSouq
server-admin Open

Allow docker container to connect to a local/host postgres database

MA
marty_c
1 month ago
3 views
Problem Description
I've recently been playing around with Docker and QGIS and have installed a container following the instructions in [this tutorial](http://kartoza.com/qgis-desktop-in-docker/). Everything works great, although I am unable to connect to a localhost postgres database that contains all my GIS data. I figure this is because my postgres database is not configured to accept remote connections and have been editing the postgres conf files to allow remote connections using the instructions in [this article](http://blog.jsinh.in/how-to-enable-remote-access-to-postgresql-database-server/#.VZqPgnXInK5). I'm still getting an error message when I try and connect to my database running QGIS in Docker: could not connect to server: `Connection refused Is the server running on host "localhost" (::1) and accepting TCP/IP connections to port 5433?` The postgres server is running, and I've edited my **pg_hba.conf** file to allow connections from a range of IP addresses (172.17.0.0/32). I had previously queried the IP address of the docker container using `docker ps` and although the IP address changes, it has so far always been in the range 172.17.0.x Any ideas why I can't connect to this database? Probably something very simple I imagine! I'm running Ubuntu 14.04; Postgres 9.3

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base