How to run dash on a public ip?


I’m not able to find any documentation about it, I hope these kind of questions are acceptable on the forum, thanks!


1 Like

Oh, so I figured this, it’s just like flask,

if __name__ == '__main__':
    app.run_server(debug=True, host='')

Just like Flask, app.run_server should be used only for development. You need a proper WSGI server for production.


How would you configure Dash to run on a WSGI server? I’m new to Flask :slight_smile: I was trying to run a dashboard on pythonanywhere with no luck. I found this thread from their site where someone else was trying to do the same. If anyone has any advice that would be great!

1 Like

This works for me:

server = Flask(__name__)
app = dash.Dash(name='app1', sharing=True, server=server, csrf_protect=False)

to run:
gunicorn ...flags.. "app:server"

or, in Dockerfile:

EXPOSE  5000
WORKDIR "/src"
CMD gunicorn -w 10 -b -t 100000 --max-requests 20 app:server

I have just deployed a guide to deployment (heroku) here as well: Hope that helps! :slight_smile:

1 Like

That’s great I’ll check it out! Thanks!

I am trying to deploy Dash on Azure Web App Services. I followed the tutorial (thanks for it) but it deviates in the deployment process. Somehow I always receive “You do not have permission to view this directory or page.” after deploying. Any ideas?

Branching this off to a separate discussion here: Deploying Dash on Azure

A post was split to a new topic: Dash - global variables and gunicorn

Not sure if anyone still looking for the solution here but as I spend couple of hours looking for it I have created docker files for both python2 and python3 for dash server with external ip address here.


I also created a Dash app mounted on a docker that allows it as well.

You can also change the code and just hit refresh to see the change on the app.

Hope it helps

1 Like

I tried your docker. It works with . but if you I use different plotly script. it cannot start. does it only support

You need to play with this line in docker file.

CMD [“python”, "”]

Here you suppose to tell python which script to run.


Hi, Taha,
thanks for your information. currently I run the docker image you created by this way.
docker run -d --mount src=pwd,target=/world,type=bind -p 8060:8050 dash_image python3 /world/

I can run the plotly pyton ( located in the host machine. (I used “–mount” parameter.) The problem is that when I changed to another plotly python script, it cannot run.

for example, in this script I used below.

import dash
import dash_core_components as dcc
import dash_html_components as html
import pandas as pd
import plotly.graph_objs as go
from flask import Flask

server = Flask(name)

df = pd.read_csv(

#external_stylesheets = [‘’]

#app = dash.Dash(name, external_stylesheets=external_stylesheets)

app = dash.Dash(name=‘app1’, sharing=True, server=server, csrf_protect=False)
app.layout = html.Div([
marks={str(year): str(year) for year in df[‘year’].unique()}

dash.dependencies.Output(‘graph-with-slider’, ‘figure’),
[dash.dependencies.Input(‘year-slider’, ‘value’)])
def update_figure(selected_year):
filtered_df = df[df.year == selected_year]
traces = []
for i in filtered_df.continent.unique():
df_by_continent = filtered_df[filtered_df[‘continent’] == i]
‘size’: 15,
‘line’: {‘width’: 0.5, ‘color’: ‘white’}

return {
    'data': traces,
    'layout': go.Layout(
        xaxis={'type': 'log', 'title': 'GDP Per Capita'},
        yaxis={'title': 'Life Expectancy', 'range': [20, 90]},
        margin={'l': 40, 'b': 40, 't': 10, 'r': 10},
        legend={'x': 0, 'y': 1},

if name == ‘main’:
app.run_server(debug=True, host=‘’)

the python file is called
It cannot run, even I just use “python3” .
can you give me some clue?
thanks in advance.

I’ve solved the problem. I changed the line below
"app = dash.Dash(name=‘app1’, sharing=True, server=server, csrf_protect=False)“ to
app = dash.Dash(name=‘name’, sharing=True, server=server, csrf_protect=False)

and " if name == ‘ main ’:" to
if name == ‘main’:

how to solve this

Cross-Origin Read Blocking (CORB) blocked cross-origin response with MIME type application/json. See for more details.

Is your site failing to load, or are you just worried about the warning message? If it’s just blocking a file, that shouldn’t be a problem in production.