Dash on Jupyter hosted in Docker

I have a question similar to old unanswered question from 2021

I am having some hard times getting Dash to run properly in Jupyter (hosted on my local machine in a docker env).

I finally got it to run when biding on such as this:

from dash import Dash, html

app = Dash(__name__)

app.layout = html.Div("Hello!")

if __name__ == "__main__":
    app.run(host='', jupyter_mode="tab", port=6010)

However this returns:
Dash app running on

And thus “breaks” jupyter interaction as it tries to load, since i am accessing it from outside docker it should be on since i mapped the ports.
I have to go and change it to manually each time which doesn’t make for a good experience (and this only works when using the new tab mode “tab”, any other mode such as “inline” etc. will just break).

I tried using

But this still returns the binding.

Since it is in docker, if i set as the host the connection is simply declined, since it is initialized outside of docker, from my localhost.

Is there any way to uses binding while having it return the proxy address ?
Or is there any Flask parameters i am not aware off ?
Or even docker settings other than exposing/mapping the ports ?


So i have figured out a “partial” workaround if ever any one has the same issue.

On windows i installed a “loopback interface network adapter” on which i set a manual ip matching the container one (
This allow my station to have a local route with the same ip, so connecting to itself (same as

And i run the app with:

app.run(host='', jupyter_mode="tab", port=7860)

This at least lets the “tab” mode work (not requiring to edit the ip by hand every time) as the container it ok using it’s docker ip, jupyter will return that ip, and my computer will connect to itself through that dummy interface.

For linux you could have a look at “iptables”

I would still love to get a clean solution rather than that ugly work around, and this doesn’t seem to work for “inline” mode

1 Like