Use Community Cloud to develop with GitHub Codespaces

To use GitHub codespaces for Streamlit development, a properly configured devcontainer.json file is needed to set up the environment. Fortunately, Community Cloud is here to help! Although Streamlit Community Cloud is primarily used to deploy and share apps with the rest of the world, we've build in some handy features to make it easy to use GitHub Codespaces. This guide explains how to create a Community Cloud account and use an automated workflow to get you into a GitHub codespace and live-editing a Streamlit app. The automated workflow will fork our Streamlit Hello app to your GitHub account, deploy it, then open up a codespace for you to start editing. All this happens right in your browser, no installation required.

You will be signing in to your Google and GitHub accounts during this process. If you do not already have these accounts, you can create them before you begin. If you do not want to use a Google account, you can create your account with any email.

  1. Go to share.streamlit.io/signup.
  2. Click "Continue with Google".
Sign up for Streamlit Community Cloud with Google
  1. Enter your Google credentials and follow Google's authentication prompts.
  2. After authenticating with Google, click "Connect GitHub account".
Connect your GitHub account to Streamlit Community Cloud
  1. Enter your GitHub credentials and follow GitHub's authentication prompts.
  2. Click "Authorize streamlit".
Authorize streamlit to connect to your GitHub account
  1. To finish, fill in your information and click "Continue" at the bottom of the screen.
Set up your Streamlit Community Cloud account
  1. You will be taken to your Streamlit workspace. If you see a warning icon (warning) next to "Settings" in the upper-right corner, this will be addressed in the next steps.
Your new workspace in Streamlit Community Cloud
  1. Click the down arrow (expand_more) to expand the options under "New App".
Options to deploy a new app from your workspace in Streamlit Community Cloud
  1. Click "Create new app with GitHub Codespaces".
Deploy a new app from a sample app template
  1. You will be prompted that "Streamlit is requesting additional permissions". Click "Authorize streamlit".
Authorize streamlit to access private repositories
  1. The Streamlit Hello repository will be forked to your GitHub account. Fill in a repository name and click "Create!"
Fork the sample Streamlit app
  1. Click "Create new codespace" to confirm the creation of a codespace on your GitHub account. Read more about GitHub Codespaces the learn about monthly limits for free use and paid plans.
Create your GitHub Codespace
  1. Wait for GitHub to set up your codespace.
GitHub preparing your Codespace
  1. GitHub will automatically execute the commands to launch your Streamlit app within your codespace. Your app will be visible in a "Simple Browser" on the right. This may take a minute to complete from when your codespace first appears on screen.
Your new GitHub Codespace
  1. Go to the app's main file (Hello.py) and add some text to the title in st.write(). Try typing ":balloon:" at the beginning.
Edit the title of your sample Streamlit app
  1. Files are automatically saved in your codespace with each edit. Click "Always rerun" in the upper-right corner of your app to automatically rerun with each edit.
Select "Always rerun" to automatically see edits in your running app
  1. See your edits and keep going!
See the results of your edit to your Streamlit app

When you are done, remember to stop your codespace on GitHub to avoid any undesired use of your capacity.

  1. Go to github.com/codespaces. At the bottom of the page, all your codespaces are listed. Click the overflow menu icon (more_horiz) for your codespace.
Stop or delete your GitHub Codespace
  1. Click "Stop codespace" if you'd like to return to your work later. Otherwise, click "Delete."

    Stop your GitHub codespace
    Delete your GitHub codespace
  2. Congratulations! You just deployed an app to Streamlit Community Cloud. ๐ŸŽ‰ Head back to your workspace at share.streamlit.io/ and deploy another Streamlit app.

See your deployed Streamlit app
forum

Still have questions?

Our forums are full of helpful information and Streamlit experts.