This documentation is for Dash Enterprise.
Dash Enterprise is the fastest way to write & deploy Dash apps and
10% of the Fortune 500 uses Dash Enterprise to productionize AI and
data science apps. Find out if your company is using Dash Enterprise
This page applies to Dash Enterprise 5. If your organization uses Dash Enterprise 4, view information about app structure, buildpacks, and the deployment lifecycle at
The deployment and release lifecycle begins when you
git push to Dash Enterprise —
Dash Enterprise creates a new Docker image based off of the changes that you pushed
and runs the image as Docker containers.
The files you include in your project folder determine how Dash Enterprise builds,
deploys, and releases your apps and workspaces.
Buildpacks are the technology responsible for transforming deployed code into the Docker image
that is then run as a container on Dash Enterprise.
It’s a higher-level abstraction of a Dockerfile.
Dash Enterprise supports pip and Conda buildpacks.
Pip and Conda are package managers that you can use to handle your app’s
We recommend using pip because it allows for faster app deployments. Conda’s dependency resolver increases the time it takes to install dependencies during development and deployment (15 mins compared to 7 mins).
Use Conda if mandated by your organization or if your app requires packages that cannot be installed with pip, like
Note that the Conda buildpack is not currently compatible with internet-restricted Dash Enterprise instances.
For an example of an app that uses the Conda buildpack, see the Conda app in the App Catalog.
By convention, this is usually called
index.py. This file is
called by the command you specify in your
Procfile. It contains your Python
code and must be placed in your project’s root directory. This file must also contain a
line that defines the
server variable so that it can be exposed for the
import dash app = dash.Dash(__name__) server = app.server ...
Describe your app’s Python dependencies in a
requirements.txt file if you want Dash Enterprise to use the pip buildpack, or describe them in
environment.yml file if you want Dash Enterprise to use the Conda buildpack.
Note that adding both
environment.yml to your app currently causes Dash Enterprise to detect only the pip buildpack, so it
is not possible to use both sets of features from these files in the same app.
Procfile is a required text file that tells Dash Enterprise which processes to run on
startup, like starting your app’s web server, scheduling jobs, and running background processes.
This file is always named
Procfile—with no file extension. It must be placed in your app’s root
directory and uses the following format:
Dash app Procfile examples
A simple Dash app
Procfile looks like this:
web: gunicorn app:server --workers 4
A Dash app running a background task queue might have a
Procfile similar to this:
web: gunicorn app:server --workers 4 worker: celery -A app:celery_instance worker
Note: Process type names are arbitrary except for
web—a special process.
In the example above,
worker could be anything, but we recommend using descriptive names as they appear in logs.
A Dash app periodically generating reports with the Snapshot Engine might have a
Procfile like this:
web: gunicorn index:server --workers 4 worker: celery -A index:celery_instance worker --concurrency=2 scheduler: celery -A index:celery_instance beat
More on web processes
web is the only process type that can receive external HTTP traffic. Use this
to run your Dash app with
gunicorn, your Dash app’s web server. In the following
example we declare
gunicorn as our web server with
web: gunicorn app:server --workers 4 --preload
This command is a standard
used to run your Dash app. It’s the production alternative to running your app with
app refers to a file named
server refers to the variable named
inside that file (see the
app.py section in this document). If the entry point to your
index.py instead of
app.py, then this would be
web: gunicorn index:server --workers 4 --preload.
gunicorn accepts a wide variety of settings.
Here are a few common flags:
--workersspecifies the number of worker processes used to run the Dash app.
web: gunicorn app:server –workers 4
--preloadallows you to reduce your app’s memory consumption and speed up boot time. You can also use preload to avoid the
[CRITICAL] WORKER TIMEOUTerror.
--preloadflag if you are using shared database connection pools (see Database Connections).
web: gunicorn app:server --workers 4 --preload
--timeout(default 30). Workers silent for more than this many seconds are stopped and restarted. A
[CRITICAL] WORKER TIMEOUTerror is printed. To resolve a timeout issue caused by an app that takes more than
--preloadflag. It’s okay to increase the
--timeoutif you can’t use
web: gunicorn app:server --workers 4 --timeout 240
See the Gunicorn docs on timeout for more information.
Do not increase the
--timeout to resolve an issue with a callback taking more than 30 seconds to execute; use
.gitignore is a text file that determines which files and folders are ignored by Git.
Files listed in the
.gitignore are not copied to the server when you deploy your app.
venv *.pyc .DS_Store .env
Aptfile can be used to install system-level packages via the APT package manager. It supports:
Aptfile is included in your project, an
apt-get update is triggered before installing the packages.
Packages from standard APT repositories
Packages from APT repositories might include database drivers that your app requires.
In the following example we are installing
Specific .deb files
You can also add links to specific
.deb files to be installed:
Custom APT repositories
Aptfile can also contain additional APT
:repo:deb <a href="https://apt.example.com/">https://apt.example.com/</a> example-distro main
Important: Dash Enterprise requires that custom APT repositories have a TLS/SSL certificate from a globally trusted certificate authority (CA).
To use APT packages in your apps when Dash Enterprise is internet-restricted, you need to specify a custom APT repository that Dash Enterprise has network access to. See an example in
Developing Apps when Dash Enterprise Is Internet-Restricted.