What changes should I make to my Dash app to prepare for deployment?

Recommendations for setting an app up for Plotly Cloud.

Written By Nathan Drezner

Last updated 26 days ago

Plotly Cloud is designed to automatically detect and run Dash apps, with minimal configuration required when updating your app.

This means all you need to get started is a Python file, with a valid Dash app defined inside of it.

You’ll have an opportunity to select your app entry point file after uploading your app to Cloud, and if you publish from the developer tools UI, the entry point file will be set automatically. You can configure Python version and environment variables either during setup or after you’ve published your app for the first time.

Plotly Cloud can automatically detect your Python dependencies (like pandas, numpy, or any other external packages) and install the latest version if not requirements file is provided. If you want to explicitly configure your dependencies, you can optionally use either a requirements.txt or pyproject.toml.

It’s also not necessary to manually define your app process with a Procfile or similar configuration file (this may be where you set up gunicorn). Plotly Cloud will automatically configure the production server process for your Dash app. If you provide a Procfile, it will be ignored by Plotly Cloud.

You also don’t need to manually expose a server object — e.g. server = app.server — in your app code, though if you add a server manually, it will be ignored by Plotly Cloud.

If, locally, you run your development server with app.run(), you don’t need to remove this configuration when publishing to Cloud. It’s also not necessary to add a conditional if __name__ == “__main__” for your run command.

You can learn about configuring specific app settings — like your Python version or environment variables — after deployment at docs.plotly.com.