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.
Sign up for Streamlit Community Cloud
- Go to share.streamlit.io/signup.
- Click "Continue with Google".
- Enter your Google credentials and follow Google's authentication prompts.
- After authenticating with Google, click "Connect GitHub account".
- Enter your GitHub credentials and follow GitHub's authentication prompts.
- Click "Authorize streamlit".
- To finish, fill in your information and click "Continue" at the bottom of the screen.
- 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.
Create a new app with GitHub Codespaces
- Click the down arrow (expand_more) to expand the options under "New App".
- Click "Create new app with GitHub Codespaces".
- You will be prompted that "Streamlit is requesting additional permissions". Click "Authorize streamlit".
- The Streamlit Hello repository will be forked to your GitHub account. Fill in a repository name and click "Create!"
- 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.
- Wait for GitHub to set up your codespace.
- 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.
Edit your app in GitHub Codespaces
- 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.
- 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.
- See your edits and keep going!
Stop or delete your codespace
When you are done, remember to stop your codespace on GitHub to avoid any undesired use of your capacity.
- 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.
Click "Stop codespace" if you'd like to return to your work later. Otherwise, click "Delete."
Still have questions?
Our forums are full of helpful information and Streamlit experts.