Image for post
Image for post

Deploy Plotly Dash app with Dash DAQ components on AWS cloud

To share a Dash app, you need to “deploy” your Dash app to a server. The guide below works for Dash application with and without Dash DAQ components. We’ll deploy app on AWS in easiest way.

Dash “Hello, World!”

Let’s create new directory (e.g. medium). Create new application.py file with code below:

Note: Line app.scripts.config.serve_locally = True is required for Dash DAQ components.

Python dependencies

Navigate to project directory (e.g. medium)and create new requirements.txt file with code below:

AWS Elastic Beanstalk

AWS Elastic Beanstalk is an easy-to-use service for deploying and scaling web applications and services developed with Python.

Install the Elastic Beanstalk Command Line Interface (EB CLI):

If you want install EB CLI on Amazon Linux, use instruction below:

Initiate EB

Navigate to project directory (e.g. medium)and initializes your directory with the EB CLI:

Select a default region (e.g. eu-west-1). Enter application name (e.g. medium).

Enter Y.

Select Python version (e.g. Python 3.6).

Enter n.

Deploy Dash app

Create a new environment:

Enter environment name (e.g. medium-dev). Enter DNS CNAME prefix (e.g. medium-dev). Select a load balancer type (e.g. application).

Open the application URL in a browser:

Image for post
Image for post

Update Dash app

Let’s update Dash app. Change:

line to:

Deploy new source code to the environment:

Open the application URL in a browser:

Image for post
Image for post

Delete Dash app from AWS cloud

Terminate the environment:

Written by

Python Developer and Artificial Intelligence Engineer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store