How to deploy Dash app on local network?


#1

My dash app runs great on my local machine.
I am trying to deploy it on a local network with no internet access for a small number of users less than 5.

Not very familiar with flask, but browsing through the flask documentation:

If you have the debugger disabled or trust the users on your network, you can make the server publicly available simply by adding --host=0.0.0.0 to the command line:

flask run --host=0.0.0.0

So my thinking is adding the above flask run option to the run server function of Dash below. Is there a way to do that? Am I on the right track here? or should i go another path like Gunicorn and nginx here

def run_server(self,
port=8050,
debug=True,
threaded=True,
**flask_run_options):
self.server.run(port=port, debug=debug, **flask_run_options)


#2

Yep, you can definitely pass the ‘host’ keyword argument into app.run_server() (where app is a Dash instance) since, as you can see from the snippet you posted, it just passes on any additional keyword arguments to the Flask app’s run method.


#3

Thanks for the input @nedned.
This worked for me.

if name == ‘main’:
app.run_server(debug=‘False’,port=8080,host=‘0.0.0.0’)