Getting Postgres DB connection error when running JSM on docker locally

I’m running Postgres and JSM through Docker (e.g. desktop app), and when connecting to Postgres in JSM database connection window I keep getting the error below.

Error connecting to database

Connection to localhost:5433 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.

Connection refused

There is no issue with database credentials and availability in my local environment, as I’m able to connect through terminal. I have also added “listen_addresses = ‘*’” in postgresql.conf, but no success, is there anything I can check or do?

FYI. I’m running postgres not on default port, just in case the port was a problem, but still the same issue.


Thanks in advance!

For anyone who will encounter this issue, here is the solution:
Just replace “localhost” with “host.docker.internal” when connecting DB