Introduction
A Streamlit app running on localhost is a demo; deployed, it's a product you can put on your resume, share with clients, or submit as a portfolio piece. Streamlit Community Cloud hosts your apps free, straight from a GitHub repo, and deployment takes about five minutes once your repo is shaped correctly.
This guide covers the whole path: repo prep, deployment, secrets, and the three errors that account for most failed first deployments.
Step 1: Shape Your Repo
Your GitHub repo needs exactly three things (see the Git guide if the repo doesn't exist yet):
app.py.pip freeze > requirements.txtThe requirements file is where 90% of deploy failures originate. The cloud machine starts empty; if you import plotly and it's not in requirements.txt, the app crashes with ModuleNotFoundError — locally it worked because you installed it months ago and forgot.
Step 2: Deploy
app.py).The build log streams live: pip installing your requirements, then booting the app. Two minutes later your app lives at https://yourname-app-name.streamlit.app. Every git push to the linked branch redeploys automatically — the same push-to-deploy rhythm as the Cloudflare Pages workflow.
Step 3: Secrets the Right Way
Apps with API keys — the Mistral chatbot, the PDF chat — must not commit keys to GitHub. Streamlit's answer is secrets management:
MISTRAL_API_KEY = "sk-..."import streamlit as st
key = st.secrets["MISTRAL_API_KEY"]Locally, the same code reads a .streamlit/secrets.toml file in your project — one code path, two environments, zero committed secrets.
The Three Classic Deploy Errors
streamlit-audio-recorder pip-installs differently from its import name.data.csv with a relative path, but the cloud's working directory differs. Use pathlib.Path(__file__).parent / "data.csv" to anchor paths to the script.Resource Limits to Know
The free tier gives each app ~1GB RAM and modest CPU — plenty for every tutorial on this site, tight for the image classifier's TensorFlow models (use MobileNet, not ResNet) and the larger Whisper sizes (stick to tiny/base).
Key Concepts
What to Try Next
st.navigation for a portfolio of tools in one deploy.FAQ
Is Streamlit Community Cloud really free?
Yes — unlimited apps with resource limits per app, supported by Streamlit (Snowflake). For higher limits and org features, paid tiers exist, but most learning projects never hit them.
Can I deploy private-repo apps?
Yes — authorize the Streamlit GitHub app for the repo during deployment; the flow is identical.
How do I update a deployed app?
Push to the linked branch — the app rebuilds automatically. No manual redeploy step exists, which is the feature.