Streamlit Cloud
Learn to deploy our application on Streamlit Cloud.
We'll cover the following...
Deployment options
Now that we’ve gone through the steps of developing an application, it’s time to deploy it so users can interact with it.
There are several options to deploy applications, including the following:
- Heroku
- AWS
- Streamlit Cloud
In this lesson, we learn to deploy applications using Streamlit Cloud.
Streamlit Cloud
Connect to the service
When we first access Streamlit Cloud, we see the page shown in the image above.
You need a Github account where our repository (repo) will be situated to deploy on Streamlit Cloud. This is the advisable way to sign up for the service.
The first time we do this, we go through the process of connecting our GitHub account to the service.
The repo should contain the Python script file and a requirements.txt file containing packages needed to build and run our application successfully.
Streamlit Cloud’s Community Tier allows the deployment of just one private repo and unlimited public repos.
Required files
As a demonstration, we use the following script for the application to be deployed. This script sets up a basic photo editor application that lets users upload an image and perform basic manipulation on it:
We need to set up a requirements.txt file with the following entries:
gitdb==4.0.7GitPython==3.1.17gunicorn==20.1.0Markdown==3.3.4streamlit==1.0.0pip==21.3
Replace the library versions with appropriate values as needed.
Deploy the application
Once the repo is in place, we go to our Streamlit Cloud account and click on the “New app” button.
We specify the repo and script file for oour project in the new application window that comes up.
If we have any access credentials needed for the application to run, such as API keys, we need to pass those in as a toml configuration file. This can be done from the deployment page’s “Advanced settings” tab.
With everything in place, we click “Deploy” and let it build the project.
Once completed successfully, we can now access the application from anywhere.