zadroga
zadroga

Reputation: 171

Connect Airbyte in Docker container to local postgres db instance

I recently setup an instance of Airbyte on my local machine using a Docker container. I also have a local instance of Postgres running which I would like to use as a data source in Airbyte. It seems like I cannot connect to the local Postgres instance because of the Docker container. Any thoughts on how to establish this connectivity?

Upvotes: 3

Views: 1991

Answers (3)

Poorna
Poorna

Reputation: 137

zadroga's answer is partially correct. Adding to that you have to also edit the postgresql.conf and pg_hba.conf files (which are located in the Postgresql installation folder /usr/local/var/postgresql).

In postgresql.conf make sure to add the following line.

listen_addresses = '*'

In pg_hba.conf,

host all all 0.0.0.0/0 md5

Then restart the Postgresql server.

Now try to connect to Postgresql server in Airbyte using the following config.

Host: host.docker.internal
Port: 5432
Database Name: your_database
Database User: your_username
Database Password: your_password

Upvotes: 2

zadroga
zadroga

Reputation: 171

I joined the Airbyte Slack channel and was told to use host.docker.internal instead of "localhost" or "127.0.0.1" and it worked.

Upvotes: 11

yamakei
yamakei

Reputation: 1

I had the same problem. Is it difficult to issue a URL for external publication when using ngrok?

ngrok tcp 5432

Upvotes: 0

Related Questions