Database / BetterDB Interview questions
What is host.docker.internal used for with BetterDB Monitor?
When the Valkey or Redis instance you want to monitor runs on your host machine, localhost inside the BetterDB container refers to the container itself, not the host.
Setting DB_HOST=host.docker.internal instead lets the container reach services on the host.
This works out of the box on Docker Desktop (macOS/Windows); on Linux you must add --add-host=host.docker.internal:host-gateway to the docker run command.
The dashboard's one-click "connect to local instance" button auto-detects this and pre-fills the right host.
More Related questions...