Run Metabase Docker network host doesn't appear on assigned port

Hi,

I'm running Metabase with Docker on an Ubuntu VPS and recently tried to connect the application DB to a local MySQL DB on the same server by using Docker network host mode. The logs said the connection to the DB is successful and to finish installation on "0.0.0.0:3000/setup", but when I access the "host-ip:3000/setup" on my Windows PC got and ERR_CONNECTION_TIMED_OUT.

The application still appear when I connect to the "host-ip:3000/setup" without using network host mode, but I couldn't connect to the MySQL DB that way.

Ubuntu: Ubuntu 18.04.5 LTS
Metabase: v0.40.5
Docker: version 20.10.8

Thank you in advance.

Hi @giaminhphamle
Without knowing which ports you have mapped for the container (your Docker run command), then it's difficult to say.
0.0.0.0 just means that Metabase is listening on all interfaces (of the container).
But try reading this: Docker + Metabase + Network: Host

Sorry for I forgot to include it.
The command I ran:
docker run -d --network=host -e "MB_DB_CONNECTION_URI=mysql://localhost:3306/metabase?user=root&password=" --name metabase metabase/metabase

Port mapping doesn't work with host networking, so I assume that Metabase would run on port 3000

@giaminhphamle Please read the topic I linked to. I'm not going to test again, since I could not reproduce last time. Remember that localhost is localhost on the container. Read the topic.

Thanks, I'm reading the topic.