Share a Streamlit app as a link, with no server
Put the app code in one HTML file that loads stlite, upload it and send a link. Streamlit runs in the reader's browser through Pyodide, so there is no Python server to deploy or keep awake.
A Streamlit app normally needs a running Python process. Streamlit Community Cloud asks for a GitHub repo, and a free server can go to sleep and make the first visitor wait for it to wake up.
stlite runs Streamlit inside the browser on Pyodide, a build of Python for the web. The app becomes one HTML file: host it at a link and each reader's browser runs the Python. This suits calculators, small data explorers and demos that work on data shipped in the file.
Step 1: build the HTML file
Create app.html with these parts:
- ✓<!doctype html>, <meta charset="utf-8"> and <meta name="viewport" content="width=device-width, initial-scale=1"> in the head.
- ✓In the head: <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@stlite/browser@1.12.0/build/stlite.css"> and <script type="module" src="https://cdn.jsdelivr.net/npm/@stlite/browser@1.12.0/build/stlite.js"></script>
- ✓In the body, a <streamlit-app> element. Inside it, <app-file name="streamlit_app.py" entrypoint> with your app code, then </app-file>.
- ✓Paste the Python flush left, with no extra indentation, so Python reads it the same way it reads your .py file.
- ✓Tested with stlite 1.12.0 in Chrome: a loan calculator using st.slider, st.number_input, st.metric, st.line_chart and pandas rendered in about 10 seconds and recalculated when a slider moved.
Step 2: add packages and data
For packages beyond what Pyodide loads by default, add an <app-requirements> element inside <streamlit-app> with one package name per line. Packages with compiled code need a Pyodide build; pure-Python packages install from PyPI.
The app cannot read files from your computer once it is hosted. Put small data in the code itself, for example a CSV string read with pandas.read_csv(io.StringIO(...)), or fetch it from a public URL.
Secrets do not belong here. The whole app, code included, is visible to anyone with the link, so keep API keys and database passwords out of the file.
What the reader sees
The first load downloads the Python runtime, which takes a few seconds before the app appears. After that, widgets respond in the browser with no round trip to a server.
The runtime and stlite load from CDNs, so the reader needs an internet connection.
Upload it and send the link
Drag app.html onto the FileShare Pro dashboard and copy the link. Viewers need no account and no Python install.
Turn on comments and testers can leave a note on the page after typing a name. When the app changes, upload the new file over the old one; the link stays the same: updating a shared link without changing it.
Related: a PyScript page as a link, a marimo notebook as a link and a Panel or HoloViews dashboard as a link.
Frequently asked
Yes. Wrap the app code in one HTML file that loads stlite, upload the file and send the link. Python runs in the reader's browser.
Pure-Python packages and packages that have a Pyodide build work. Packages that need native code without a Pyodide build do not.
Yes. The code ships in the HTML file, so keep secrets and API keys out of it.
Yes. The free plan hosts up to 50 files of up to 100 MB each, with view counts and comments included. Password-protected links are on Pro.
Drop the file, copy the link — live in seconds, free plan included.
Start sharing free