How to deploy Dash App internally in local network?


I am quite new to the topic of deploying and trying to understand how things work. I saw the deployment tutorial with heroku but such a hosting platform in so solution for me.

What we have is an internal network (not quite intranet) within my department. Now what I want is to deploy the Dash App to an self hosted server since we have a 24/7 running computer and I want to use this. But what is the order to deploy a Dash App? Is Docker used? Do I put the App in the Docker Container and then launch that Container? I just now the basics of Container and try to figure out what part Docker plays in deploying and for example where Apache Server comes in.

Many thanks in advance.

Hi @Gobrel ,

The first thing you should verify is whether the server you want to deploy on is reachable from all the computers that will be used to access the app (clients).

Using docker is not necessary but I would personally recommend it. What docker does is that it provides an isolated environment (a container) for your app. This is especially useful if you run multiple services (apps) on your server and these might have conflicting dependencies. Running each app in its own container prevents the apps from conflicting with each other.

In principle, deploying a dash app is the same thing as deploying a flask app since dash is built on top of flask. Perhaps you can search for something like “flask gunicorn docker tutorial”…

I remember I used this tutorial some time ago. Maybe you can start with that. Don’t worry about the parts related to Amazon Web Services.

The steps that you will need to do:

  1. Make sure your server is reachable by your intended clients.
  2. Setup gunicorn as a wsgi server for your dash app. Do you remember the line you get whenever you start your dash app?
    WARNING: This is a development server. Do not use it in a production deployment.
    Use a production WSGI server instead.
    You use gunicorn to solve this.
  3. Write your Dockerfile.
  4. Build a docker image based on your Dockerfile.
  5. Get the image to your server. You can either build the image directly on the server or you can build it on another machine and then upload it to an image registry. The default registry is dockerhub. Dockerhub allows you to have one private repo (aka image) and multiple public repos. Once you upload your image to the registry, you can download it again from your server.
  6. Create a docker container from you docker image. Once you do that, you will have your app deployed on the server.

I hope this helps. If you have further questions, feel free to ask.

1 Like

You can have a look at this repo:

It is a simple dash app that is deployed using gunicorn and docker.