The connection attempt failed for Postgres DB

Hello, I am kindly requesting for assistance with connecting Metabase to Postgres. I am running Metabase on Docker and Postgres is on Windows. The issue is with the host. When I query Postgres for the host it says it is * and no further information.
Postgres version 16
Metabase v0.46.6.4

Diagnostic Info:
"browser-info": {
"language": "en-US",
"platform": "Win32",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/ Safari/537.36 Edg/117.0.2045.47",
"vendor": "Google Inc."
"system-info": {
"file.encoding": "UTF-8",
"": "OpenJDK Runtime Environment",
"java.runtime.version": "11.0.20+8",
"java.vendor": "Eclipse Adoptium",
"java.vendor.url": "",
"java.version": "11.0.20",
"": "OpenJDK 64-Bit Server VM",
"java.vm.version": "11.0.20+8",
"": "Linux",
"os.version": "",
"user.language": "en",
"user.timezone": "GMT"
"metabase-info": {
"databases": [
"hosting-env": "unknown",
"application-database": "h2",
"application-database-details": {
"database": {
"name": "H2",
"version": "2.1.212 (2022-04-09)"
"jdbc-driver": {
"name": "H2 JDBC Driver",
"version": "2.1.212 (2022-04-09)"
"run-mode": "prod",
"version": {
"date": "2023-07-28",
"tag": "v0.46.6.4",
"branch": "release-x.46.6.x",
"hash": "7c60aca"
"settings": {
"report-timezone": null

Error in the logs:
Caused by: *
at java.base/ Source)
at java.base/ Source)
at java.base/ Source)
at org.postgresql.core.PGStream.createSocket(
at org.postgresql.core.PGStream.(
at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(
... 36 more
2023-10-03 11:23:10,218 DEBUG middleware.log :: POST /api/database 400 427.2 ms (1 DB calls)
{:message "The connection attempt failed."}

please post the connection string to the postgres DB


Solved! I used 'host.docker.internal' as the hostname to enable docker access the db service on localhost