Streamlit is the fastest way to turn a Python script into something a colleague can click, and the slowest thing to explain to a platform team. The reason both are true is the same architectural fact: a Streamlit app is a long-lived Python process that holds a WebSocket open to each browser tab and keeps that session's state in memory. It is not a request-response web app wearing a costume.
That one fact eliminates most of the hosting options people reach for first. I'm Ajay, I build PandaStack, which is one of the platforms below. Here's what Streamlit actually needs, and who provides it.
What Streamlit needs from a host
- A process that stays alive. Session state lives in the process. If the platform recycles it between requests, every user gets kicked back to a blank app mid-interaction.
- WebSocket support, end to end. Not just at the edge — through every proxy between the browser and your process. A misconfigured layer here gives you an app that loads and then never updates, which is a maddening bug to diagnose.
- Real memory. Data apps load dataframes. The default instance sizes on cheap tiers are frequently smaller than the dataset the app exists to explore.
- Sticky routing if you run more than one replica. A user's session belongs to one process; a load balancer that round-robins them will produce state that appears to randomly reset.
- A way to keep it private. Most internal data apps should not be on the open internet, and Streamlit's own auth story is thin.
/_stcore/stream upgraded successfully. If it 404s, 502s, or falls back to polling, the problem is in the proxy layer, not in your Python.The platforms
Streamlit Community Cloud
Free, deploys from a public GitHub repo in about a minute, and perfect for demos, portfolios, and sharing something with the internet. The limits are exactly what you'd expect from a free tier: modest resources, apps that sleep aggressively and take a while to come back, and a privacy story built around a small allowlist rather than real access control. It is the correct first host and a poor last one.
Hugging Face Spaces
Very good if the app is ML-adjacent — model demos, inference playgrounds, anything that benefits from being next to the Hub. Free CPU tiers, paid GPU tiers, and a community that will actually find your app. Less appropriate for an internal business dashboard, both culturally and because the access model is built around public sharing.
Render, Railway, and similar PaaS
The straightforward production answer. You get a real long-running process, WebSocket support that works, memory you can size, and a managed database next door if the app needs one. Deploy is a git push and a start command. The main thing to watch is cost: a data app used for two hours a day still bills for twenty-four on an always-on instance, and teams tend to accumulate a lot of these apps.
Google Cloud Run and other container platforms
Works, scales to zero, and supports WebSockets — but you need to configure it deliberately: raise the request timeout well above the default, set session affinity so a user stays on one instance, and be aware that scale-to-zero means the first visitor after an idle period waits for a container start plus your imports. Fine if you're already in that ecosystem and comfortable writing a Dockerfile.
PandaStack (mine)
The app runs as a normal Python process in its own Firecracker microVM, built from the repo — Python version comes from a .python-version or .tool-versions file, dependencies from requirements.txt. Because it's a VM, the WebSocket and the long-lived process are non-issues, and there's no request-duration ceiling to trip over on a slow query. The two design points that matter for data apps: the app sleeps when idle and wakes on the next request, which suits a dashboard that's used at 9am and ignored the rest of the day; and each app is a separate VM, so one colleague's runaway pandas operation can't take down everyone else's app.
# Streamlit binds to its own port and must listen on 0.0.0.0,
# not localhost, or the platform's proxy can't reach it.
pandastack app create \
--name sales-dashboard \
--git-url https://github.com/acme/dashboards \
--install-command "pip install -r requirements.txt" \
--start-command "streamlit run app.py --server.port $PORT --server.address 0.0.0.0 --server.headless true" \
--port 8501Where it's the wrong tool: a public ML demo belongs on Spaces, next to the community that will use it. And if you want zero infrastructure decisions for a throwaway prototype, Community Cloud is genuinely faster than anything you'd set up yourself.
Getting a Streamlit app production-ready
- Pin your Python version and your dependencies. Streamlit apps rot fast because a transitive dependency of pandas or pyarrow moves under you. Commit a lockfile.
- Bind explicitly.
--server.address 0.0.0.0,--server.port $PORT,--server.headless true. All three, every time. Headless mode stops Streamlit trying to open a browser on a machine that has none. - Cache the expensive things.
@st.cache_datafor dataframes and query results,@st.cache_resourcefor connections and models. Without these, every widget interaction re-runs your whole script including the query. - Put real auth in front. Streamlit's own options are thin. A reverse proxy with SSO, or a platform-level access control, is the honest answer for anything internal.
- Size memory against your actual data, not your sample. The instance needs to hold the dataframe plus overhead plus whatever each concurrent session copies.
- Use a connection pool for databases. Each session doing its own connect will exhaust a Postgres connection limit faster than you expect.
Short version
Demo or portfolio: Community Cloud. ML showcase: Hugging Face Spaces. Internal business app that needs to be private, always work, and hold real data: a platform that gives you a long-lived process with proper memory — Render, Railway, Cloud Run, or a microVM host like PandaStack, where the idle-sleep behaviour matches how dashboards are actually used. Skip anything that describes itself as a function runtime; the WebSocket will not survive it.