Publishing from Local Files
Already have a Dash app written and ready to publish? This guide can help you take the app files on your workstation and turn them into a published app on Plotly Cloud.
Preparing your app files
Plotly Cloud expects your app files to meet certain requirements. In this step, you'll review your files and make any adjustments needed to meet the requirements.
To prepare your app files:
-
Make sure that the file containing your Dash app definition is named
app.py
. (You can upload an app with more than one Python file, but the entry point must be namedapp.py
). -
In your
app.py
file, add a lineserver = app.server
. -
List your app dependencies in a
requirements.txt
file. This file lets Plotly Cloud know which dependencies to install for your app.Tip
You can generate a
requirements.txt
based on the Python packages present in a local environment where your app successfully runs (ideally a virtual environment dedicated to your app). To do this, activate the environment and then runpip freeze > requirements.txt
. You can also check the environment's Python version withpython --version
(you'll be asked to select a Python version in a later step). -
Make sure that the total size of your files is less than 80 MiB.
Uploading your app files to Plotly Cloud
To upload your app files:
-
Go to Plotly Cloud: https://cloud.plotly.com/
-
Select New.
-
In a different window, browse to your app files. Multi-select the files and/or folders and then drag them to the upload area. Alternatively, if your app files are all in a single folder, you can select the upload area and then select your folder.
Plotly Cloud verifies that your files meet the requirements described above. If you accidentally upload unneeded folders like
.git
or.venv
, they are omitted to reduce the final app size.If you forget some files or if you need to make further changes to meet the requirements, select Remove and then drag the new set of files.
Configuring general settings
Several options are available under Configuration:
-
Name: Identifies your app when you manage it on Plotly Cloud. You can change the automatically generated name to one that you prefer.
-
App URL: The unique URL where users will go to view the live app. You can change the default URL if you have a Plotly Pro plan (or higher).
-
Python version: The Python version that Plotly Cloud will use to build your app. It must be compatible with the dependencies in your
requirements.txt
file in order for your app to successfully build. -
Environment variables (optional): Values that your app code expects in the live app environment. For more information, see Environment Variables.
When everything looks good, select Save & publish.
You're taken to your apps list where you can monitor the status of your new app. If Plotly Cloud is able to successfully build and run your app, its status progresses to Running (you can follow along in the logs).
Select View in new tab to view the live app.