GeekHub Learn
Module
Lesson 6.66 of 7 in this module2 min read Module 6: Building Your First AI Chat App

Deploying to Streamlit Cloud

A project that is not deployed does not count. Recruiters cannot click "I built this on my laptop". Today we make it clickable.

You wrote a song. Now it is time to upload it to Spotify. Same song. Suddenly real.

Streamlit Cloud is free, GitHub-integrated, and deploys in 3 clicks. Steps:

  1. Push your app to a public GitHub repo.
  2. Add a requirements.txt.
  3. Sign in at share.streamlit.io with GitHub.
  4. Click "Deploy", choose repo, branch, and file.
  5. Add your API key as a secret in the Streamlit settings (not in code).

You get a public URL like your-app.streamlit.app.

requirements.txt:

streamlit
openai
python-dotenv

In Streamlit Cloud settings, add:

OPENAI_API_KEY = "sk-..."

Load it in your code via st.secrets or os.environ (Streamlit injects secrets as env vars). Make sure your code never tries to read .env in production.

Visualize it

Annotated screenshots of the deploy flow: GitHub commit -> Streamlit dashboard -> click deploy -> live URL.

Try it now

Deploy your chatbot. Share the URL in the GeekHub community. Real feedback is the gift.

Hands-on lab

Deploy. Test from your phone. Have a friend test. Document any bugs.

Try it now

Why must API keys never be in your committed code, even after deployment?

Common mistakes

  • Forgetting requirements.txt
  • Hardcoding the key (free GitHub scanning bots will find it)
  • Public deploy with no spending cap (rate-limit-friendly model = safer first deploy)

Debugging tip

If deploy fails, check the build log on Streamlit Cloud. Almost always a missing dependency.

Challenge

Add a "Star this project on GitHub" link in the sidebar. Hit 5 stars from real humans.

Where this shows up

  • Portfolio demos
  • Internal team tools
  • Public AI utilities

From the field

A deployed Streamlit demo on your resume statistically increases interview callbacks. Recruiters click. Make sure they have something to click.

Recap

Push, deploy, share. Your project is now real.


Quick recall

3 prompts · think before you flip

Prompt 1 of 3

What goes in `requirements.txt`?

Quiz time

1 question · tap an answer to check it

  1. 1. The right place to put your API key for a Streamlit Cloud deploy is

Finished lesson 6.6?

Mark complete to update your module progress and unlock the streak.

Loading