Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Dmitry blinky-z

🎯
Focusing
View GitHub Profile
@MauricioMoraes
MauricioMoraes / access_postgresql_with_docker.md
Last active Jul 8, 2020
Allow Docker Container Access to Host's Postgres Database on linux (ubuntu)
View access_postgresql_with_docker.md

You have to do 2 things in order to allow your container to access your host's postgresql database

  1. Make your postgresql listen to an external ip address
  2. Let this client ip (your docker container) access your postgresql database with a given user

Obs: By "Host" here I mean "the server where docker is running on".

Make your postgresql listen to an external ip address

Find your postgresql.conf (in case you don't know where it is)

$ sudo find / -type f -name postgresql.conf

You can’t perform that action at this time.