# Streamlit hosting in 2026: how to deploy a Streamlit app, and where

> A Streamlit app in production runs streamlit run on the platform's port and on 0.0.0.0, headless, behind a proxy that carries its WebSocket, with secrets in the environment rather than a committed secrets.toml and enough memory for its data and models. On Livops a repository with app.py and requirements.txt starts from a push, for 39 credits a month (39,000 so'm). Here is how Streamlit Community Cloud, Hugging Face Spaces, Render and Railway compare.

Source: https://livops.dev/en/hosting/streamlit-hosting

By Livops team, the people who build and run Livops. Updated 23 November 2026.

A Streamlit app is a Python script that Streamlit's own server runs again on every interaction, talking to each open browser tab over a WebSocket. Hosting one is mostly about running that server the right way on someone else's machine: on the port it is given, without trying to open a browser, with its secrets outside the repository and with memory for every viewer at once. This page covers each need, compares Streamlit Community Cloud, Hugging Face Spaces, Render and Railway with each provider's own numbers, and ends with exactly what Livops reads and starts.

## What does a Streamlit app need in production?

### The platform's port and address, headless

Streamlit listens on port 8501 by default, and `server.address` is unset[2]. A platform tells the app which port to use, so pass it, and listen on every interface so the platform's proxy can reach it. `server.headless` decides whether Streamlit tries to open a browser window on start[2]; on a server there is none to open. Every option can go on the command line, which wins over `STREAMLIT_*` variables and every `config.toml`[1]:

```sh
streamlit run app.py --server.port $PORT --server.address 0.0.0.0 --server.headless true
```

`browser.gatherUsageStats` is on by default and sends usage statistics to Streamlit[2]; turn it off with `--browser.gatherUsageStats false` if you would rather it did not.

### A proxy that keeps the WebSocket open

Streamlit keeps a persistent, two-way WebSocket between the browser and the server, and each browser tab opens its own connection and its own session[3]. So the host's proxy has to carry WebSockets, not only plain requests. It also means a deploy that replaces the server closes those connections, and every open tab has to reconnect to the new one.

### Secrets in the environment, not in the repository

Locally, secrets live in `.streamlit/secrets.toml`; Streamlit's documentation says to add that file to `.gitignore` and calls unencrypted secrets in a git repository a bad practice[4]. Root-level keys in it are also readable as environment variables[4], so code that reads `os.environ` works both on your machine and on a platform that passes variables in:

```python
import os
import streamlit as st

api_key = os.environ["OPENAI_API_KEY"]
```

### Memory for every viewer

The machine running the app provides the compute and storage for all of its users[3], and since every tab is a separate session[3], a DataFrame loaded inside the script is loaded again for each one. `st.cache_data` is the recommended way to cache data such as a DataFrame read from CSV, and `st.cache_resource` the way to load an ML model or a database connection once and share it across all sessions[5]:

```python
@st.cache_resource
def load_model():
    return joblib.load("model.joblib")

@st.cache_data
def load_sales():
    return pd.read_csv("sales.csv")
```

pandas with a few hundred megabytes of data, or a model from `transformers`, is usually where 512 MB stops being enough. File uploads are capped at 200 MB per file by default (`server.maxUploadSize`)[2]; size the memory for the largest file you accept.

### A health check

Streamlit's own Docker example checks `/_stcore/health`[6]. Point the platform's health check there, and a version that never got its server up is never given traffic.

## The options at a glance

| Option | What it is | Smallest paid always-on app | What you still maintain |
| --- | --- | --- | --- |
| Livops | A platform; servers in Uzbekistan | From 39 credits (39,000 so'm) a month | Your code |
| Streamlit Community Cloud | Streamlit's own free hosting | No paid tier on the pages we read; free apps sleep after 12 hours without traffic[8] | Your code |
| Hugging Face Spaces | ML demo hosting, Git repositories | PRO, $9 a month, to create a Space that runs on compute[15][12]; CPU Upgrade, 8 vCPU and 32 GB, $0.03 an hour or $22 a month, runs without sleeping[15][14] | Your code; a Dockerfile if you leave the Streamlit SDK |
| Render | A platform with web services | $7 a month: 0.5 CPU, 512 MB; $25 for 1 CPU, 2 GB[16] | Your code |
| Railway | A platform billed by usage | Hobby: $5 a month, including that much usage; then about $10 per GB of memory and $20 per vCPU a month[19] | Your code |

Other providers' prices are from each provider's own page, read on 23 November 2026; the dates are in Sources below. Livops prices are the ones the cabinet bills today.

## Each option

### Livops

A Streamlit repository is read, not asked about: Livops finds the script, writes the `streamlit run` command with the port and the headless flags, and runs it as a web app with an address and HTTPS (details below). Payment is in so'm through Payme or Click, with no card, and the servers are in Uzbekistan — close to users there, farther from users elsewhere. One app's memory stops at 2 GB, the largest tier, so a large model is better on Hugging Face's bigger hardware; and you do not get root.

### Streamlit Community Cloud

The easiest start there is: connect a GitHub repository, public or private, and the app is deployed, all for free[7]. Every user gets the same resources, from 0.078 to 2 cores, from 690 MB to 2.7 GB of memory and up to 50 GB of storage, and Streamlit says these limits may change at any time without notice[8]. An app with no traffic for 12 hours goes to sleep[8]. You may have one private app at a time[9], and all apps are hosted in the United States, with no choice of location[10]. Secrets are pasted in TOML into the app's Advanced settings[11].

### Hugging Face Spaces

The place for an ML demo, with GPUs by the hour. The Spaces overview now lists three SDKs — Gradio, Docker and static HTML — and creating a Space that runs on compute needs a paid plan: PRO for a personal account[12], at $9 a month[15]. The Streamlit page still describes an `sdk: streamlit` Space, where only port 8501 is allowed[13]. The free CPU Basic hardware has 2 vCPU and 16 GB[12], more memory than any other free option here, and goes to sleep after 48 hours without use[14]. Its disk is not persistent[12]. Variables and secrets reach a Streamlit Space as environment variables[12].

### Render

A web service accepts inbound WebSocket connections from the internet[18]. The smallest paid one is $7 a month for 0.5 CPU and 512 MB, and 2 GB with 1 CPU is $25[16]: fixed prices that are easy to plan around. Render takes credit and debit cards[16]. Open WebSocket connections close when an instance is replaced, during a deploy for example[18].

### Railway

The Hobby plan is $5 a month including that much usage; past it, memory is about $10 per GB and CPU about $20 per vCPU a month, billed by the second[19]. Hobby services are always on, and a service can grow to 48 GB of memory[19] — far past the 2 GB Livops stops at. Railway is paid by credit card[19].

## Free demo or always-on app: what changes?

Most Streamlit apps start as a demo, and the free tiers are built for that: somebody opens the link, the app wakes, they look around. The trade-off shows up when the app becomes part of somebody's day. A sleeping app makes the first visitor wait while it starts and loads its data again. A free tier's limits can change under you[8]. And a dashboard for a company usually wants a database it can write to and a disk that survives a restart, which the free tiers either do not give or give for a limited time. If the app is a demo for strangers, a free tier is the right tool. If people depend on it every morning, pay for something that stays on.

## Where can you host a Streamlit app for free?

- **Livops** has no free tier for apps. On an account that has not paid yet, the first bot or app runs for 15 minutes on a zero balance, once, so you can open it. Static sites are free, and one 500 MB database per team is free once the account has credits.
- **Streamlit Community Cloud** is free[7], with up to 2.7 GB of memory, sleep after 12 hours without traffic[8] and one private app at a time[9].
- **Hugging Face Spaces** has free CPU Basic hardware, 2 vCPU and 16 GB[12], which sleeps after 48 hours without use[14]; but creating a Space that runs on compute needs a paid plan, and static Spaces are the free ones[12].
- **Render** gives free instances to web services, with 750 free instance hours a month per workspace; a free web service spins down after 15 minutes without inbound traffic and takes about a minute to start again, and WebSocket messages on an open connection count as traffic[17].
- **Railway** has a Free plan with $1 of usage a month and up to 0.5 GB of memory per service, whose services sleep after 5 to 10 minutes without outbound traffic; a trial gives $5 of credit for 30 days, with no card[19].

## Deploy Streamlit on Livops

1. Push a repository with the entry script at its root — `streamlit_app.py`, `app.py`, `main.py` or `Home.py` — and `requirements.txt`. In the cabinet, click **New project** and choose the repository, or upload the folder as a `.zip`.
2. Choose the memory. When the requirements name pandas, scikit-learn, SciPy or matplotlib, the form suggests 512 MB; for torch, TensorFlow or transformers, 1 GB. It is a suggestion with its price beside it: keep it or change it.
3. Put your keys under **Variables**, marked as secret, with the names your code reads from `os.environ`. For a database, add PostgreSQL under **Databases**: `DATABASE_URL` and the `PG*` variables are written into the app by themselves.
4. Deploy. The log shows the install and the start, and the app gets a `<name>.livops.app` address with HTTPS.

Livops makes it a Streamlit app when `streamlit` is among the dependencies, or imported in the code, and one of `streamlit_app.py`, `app.py`, `main.py`, `Home.py` or `home.py` in the repository root imports it; the first one in that order is the script. For `app.py` it starts:

```sh
.venv/bin/streamlit run app.py --server.port 3000 --server.address 0.0.0.0 --server.headless true --browser.gatherUsageStats false
```

`PORT` is 3000 unless you change it, and the app has a minute to answer on it. Around that command:

- **If `requirements.txt` leaves `streamlit` out** but the code imports it, the server is installed for you.
- **Secrets** marked as secret are never shown again after saving, not in the cabinet, the API or to the assistant. New values take effect on the next deploy, or now if you restart the service.
- **Memory** is a tier of 256, 512, 1024 or 2048 MiB, set with `memory` in `livops.json` when the project is created and in the settings afterwards; the tier is part of what you pay for. An app that runs out is stopped, and the log says `Killed` or exit code 137.
- **If the new version does not start**, the previous one keeps serving. Recent versions stay in **Deploys** for a one-click rollback.
- **Files** written to `/app/data` (the `DATA_DIR` variable) survive restarts and deploys; the code folder is read-only and `/tmp` is wiped, and holds 128 MB. A file the app writes for later belongs in `/app/data`, and data that matters in the database, which is backed up every night.

To set the start yourself, for a script in a subfolder or with options of your own, put `livops.json` in the repository root:

```json
{
  "kind": "web",
  "start": ".venv/bin/streamlit run dashboard/app.py --server.port $PORT --server.address 0.0.0.0 --server.headless true",
  "healthPath": "/_stcore/health",
  "memory": 1024
}
```

`healthPath` is optional: it is the path Livops checks to know the app is alive, and Streamlit answers on `/_stcore/health`. `kind`, `start` and `memory` are read when the project is created and changed in the settings after that.

A Streamlit app is **from 39 credits a month (39,000 so'm)**. One credit is 1,000 so'm, and bought credits never expire. See [Pricing](https://livops.dev/en/docs/pricing) for plans, which give more credits than they cost, and [Frameworks and livops.json](https://livops.dev/en/docs/frameworks) for every field.

## Questions

**Which command does Livops start a Streamlit app with?**

streamlit run on the script it finds, on the platform's port, on every interface, headless and without usage statistics: .venv/bin/streamlit run app.py --server.port 3000 --server.address 0.0.0.0 --server.headless true --browser.gatherUsageStats false. It looks at streamlit_app.py, app.py, main.py, Home.py and home.py in the repository root, in that order, and takes the first that imports streamlit.

**My entry script is in a subfolder. What then?**

Write the start yourself, in livops.json or in Settings, for example .venv/bin/streamlit run dashboard/app.py --server.port $PORT --server.address 0.0.0.0 --server.headless true. Only the root files above are looked at.

**Where do my secrets go if secrets.toml is not in the repository?**

Under Variables, marked as secret, and your code reads them with os.environ. A secret's value is never shown again after you save it, not even to the assistant. Keep .streamlit/secrets.toml in .gitignore for local work.

**How much memory does a Streamlit app need?**

It depends on what it loads. Every browser tab is its own session, so data loaded per session is held once per viewer; load shared data and models once with st.cache_data and st.cache_resource. On Livops memory is a tier of 256, 512, 1024 or 2048 MB, and an app that runs out is stopped with Killed or exit code 137 in the log.

**Does a Streamlit app on Livops go to sleep?**

No. A paid app runs around the clock, whether or not anybody has it open. There is no free tier for apps; on an account that has not paid yet, the first app runs for 15 minutes on a zero balance, once.

**How much does a Streamlit app cost on Livops?**

From 39 credits a month, which is 39,000 so'm at 1,000 so'm a credit; the memory tier is part of the price. Credits are bought in so'm through Payme or Click, with no card, and bought credits never expire.

**Who wrote this comparison?**

The Livops team. Every price and limit of another provider on this page links to that provider's own page, with the day we read it.

## Sources

1. [Streamlit — Configuration options](https://docs.streamlit.io/develop/concepts/configuration/options). Checked 23 November 2026.
2. [Streamlit — config.toml](https://docs.streamlit.io/develop/api-reference/configuration/config.toml). Checked 23 November 2026.
3. [Streamlit — Understanding Streamlit's client-server architecture](https://docs.streamlit.io/develop/concepts/architecture/architecture). Checked 23 November 2026.
4. [Streamlit — Secrets management](https://docs.streamlit.io/develop/concepts/connections/secrets-management). Checked 23 November 2026.
5. [Streamlit — Caching overview](https://docs.streamlit.io/develop/concepts/architecture/caching). Checked 23 November 2026.
6. [Streamlit — Deploy Streamlit using Docker](https://docs.streamlit.io/deploy/tutorials/docker). Checked 23 November 2026.
7. [Streamlit Community Cloud — Overview](https://docs.streamlit.io/deploy/streamlit-community-cloud). Checked 23 November 2026.
8. [Streamlit Community Cloud — Manage your app](https://docs.streamlit.io/deploy/streamlit-community-cloud/manage-your-app). Checked 23 November 2026.
9. [Streamlit Community Cloud — Share your app](https://docs.streamlit.io/deploy/streamlit-community-cloud/share-your-app). Checked 23 November 2026.
10. [Streamlit Community Cloud — Status and limitations](https://docs.streamlit.io/deploy/streamlit-community-cloud/status). Checked 23 November 2026.
11. [Streamlit Community Cloud — Secrets management](https://docs.streamlit.io/deploy/streamlit-community-cloud/deploy-your-app/secrets-management). Checked 23 November 2026.
12. [Hugging Face — Spaces overview](https://huggingface.co/docs/hub/spaces-overview). Checked 23 November 2026.
13. [Hugging Face — Streamlit Spaces](https://huggingface.co/docs/hub/spaces-sdks-streamlit). Checked 23 November 2026.
14. [Hugging Face — Using GPU Spaces (hardware, billing, sleep time)](https://huggingface.co/docs/hub/spaces-gpus). Checked 23 November 2026.
15. [Hugging Face — Pricing](https://huggingface.co/pricing). Checked 23 November 2026.
16. [Render — Pricing](https://render.com/pricing). Checked 23 November 2026.
17. [Render — Deploy for free](https://render.com/docs/free). Checked 23 November 2026.
18. [Render — WebSockets](https://render.com/docs/websocket). Checked 23 November 2026.
19. [Railway — Pricing](https://railway.com/pricing). Checked 23 November 2026.
