1

I am using Ubuntu 22.04 and Postgresql 14.

I have configured Metabase on Docker with Nginx. All are installed on the same machine - localhost. The Metabase page opens at the following address : http://127.0.0.0:3000. When I try to add Postgres database, it gives an error that the host and port settings are not correct.

I have checked the postgresql.conf file and everything seems to be correct (host - localhost, port - 5433 (I changed it as per a suggestion on Stack Overflow)).

Docker works fine - checked with Hello World container.

Can someone help ? Do I need to specify host in a different way in Metabase add database menu (I have been giving it as localhost). The port of 5433 is the same. I have checked the user and password.

Am facing a similar issue even for MySql. So it might be related to how the settings are given in Docker.

Stuck badly. Any help will be appreciated.

Sachin
  • 85
  • 9
  • 2
    I think https://stackoverflow.com/a/31249288/19032206 answers your question. Edit pg_hba.conf to include docker addresses (host all all 172.17.0.0/16 md5), and use 172.17.0.1:5432 instead of localhost:5432 when creating connection in Metabase. – qaziqarta Aug 15 '22 at 11:40
  • That is perfect. I could change the conf files (you need to change both postgresql.conf and pg_hba.conf. Thank you !! Somehow I am unable to mark this as an answer. – Sachin Aug 15 '22 at 12:11
  • no worries - you can upvote the answer from the link if it was helpful for you. – qaziqarta Aug 15 '22 at 19:32

0 Answers0