1. When Community Cloud Is Enough

Streamlit turns a Python script into a web app in an afternoon. Streamlit Community Cloud then puts that app online for free, straight from a GitHub repository. For a class project, a public demo or a portfolio piece, that combination is hard to beat.

Problems start when the app becomes important. A client wants it on their own domain. Your manager wants it private. Users upload files, and the files vanish. The app falls asleep before Monday's meeting.

This guide explains exactly where Community Cloud stops, what any replacement host must support and how the main options compare. It also shows how to add a password and keep data safe, whichever host you pick.

2. Five Limits That Push People to Move

Streamlit documents these limits openly. Each one is reasonable for a free service. Each one can also block a real project.

  1. No custom domain. Your app lives at an address ending in .streamlit.app. You can choose the first part of the address, but you cannot point your own domain at the app.
  2. One private app. Streamlit's documentation states that you are allowed one private app at a time. Every other app must be public.
  3. Sleep after 12 hours. An app with no traffic for 12 hours goes to sleep. The next visitor sees a button to wake it and must wait for the app to start.
  4. Files do not last. When the app reboots, it starts again from a fresh copy of your repository. Files your app wrote, including SQLite databases and user uploads, are gone. Streamlit keeps no backup of them.
  5. Shared resources. Streamlit lists memory limits between roughly 690 MB and 2.7 GB. An app that loads a large DataFrame or a machine learning model can slow down or stop near those limits.

If none of these affect you, stay on Community Cloud. If even one does, read on.

3. What a Streamlit App Needs from Any Host

Streamlit works differently from a typical Flask or Django site. A host that runs Flask well can still break Streamlit. Check these four points before you sign up anywhere.

  • WebSockets. Streamlit keeps a live WebSocket connection between the browser and the server. Every slider move and button click travels over it. The host's proxy must pass WebSocket traffic through. If it does not, the page loads and then shows "Connecting" forever.
  • A process that stays running. Streamlit holds each user's session in memory on the server. Hosts that run code only per request, such as serverless functions, cannot run Streamlit.
  • Enough memory for your data. Streamlit loads your data into the server's memory. A 200 MB CSV file can need two or three times that much memory once pandas loads it. Size your plan for your biggest dataset, not for your code.
  • A folder that survives restarts. If users upload files or your app stores results, you need storage that the host keeps between deploys.

4. The Main Alternatives Compared

Hugging Face Spaces

Spaces is popular with machine learning teams. It runs Streamlit apps from a Git repository and offers free CPU hardware. Free Spaces sleep when idle, and you pay extra for persistent storage and stronger hardware. It is a great home for public model demos. It is less suited to a private business tool on your own domain.

Google Cloud Run

Cloud Run runs any Docker container and can scale down to zero when nobody uses it. You write a Dockerfile, set up a Google Cloud project and configure the service. It supports WebSockets. Its filesystem is temporary, so you need a separate database or Cloud Storage for anything your app saves. It suits teams that already use Google Cloud.

Render and Railway

Both platforms deploy from GitHub and run Streamlit with a start command. Both offer paid persistent disks or volumes. They are a good fit if you also run services in other languages and want them in one dashboard.

Your own VPS

A small Linux server gives you full control at a low monthly price. You install Python, run Streamlit as a systemd service and put Nginx or Caddy in front of it for https. If you use Nginx, you must add the WebSocket upgrade headers yourself. Many "Connecting" errors on self-hosted Streamlit come from a missing header.

location / {
    proxy_pass http://127.0.0.1:8501;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $host;
    proxy_read_timeout 86400;
}

Cloudilio

Cloudilio hosts Python apps only and treats Streamlit as a first-class app type. Upload your project or link GitHub, and Cloudilio detects Streamlit and starts it with the right settings. WebSockets and https work with no setup. Your app gets a data folder that survives every update and is backed up daily. Apps never sleep, and you can connect your own domain on every plan.

5. Comparison Table

This table shows each option's default behavior. Most gaps can be closed with paid add-ons or extra setup.

Feature Community Cloud HF Spaces Cloud Run VPS Cloudilio
Your own domain No Limited Yes Yes Yes
Private apps One Yes Yes You build it Yes, add a password in code
Sleeps when idle After 12 hours On free hardware Scales to zero No No
Files survive restarts No Paid storage No Yes Yes, with daily backups
Setup work Very low Low High High Very low

6. Put Your App Behind a Password

A shared password is the fastest way to keep an internal dashboard private. It takes about fifteen lines and works on any host. Store the password as a secret, never in your code.

import hmac
import os

import streamlit as st


def check_password() -> bool:
    if st.session_state.get("signed_in"):
        return True
    password = st.text_input("Password", type="password")
    if password and hmac.compare_digest(password, os.environ["APP_PASSWORD"]):
        st.session_state["signed_in"] = True
        st.rerun()
    elif password:
        st.error("That password is wrong.")
    return False


if not check_password():
    st.stop()

st.title("Sales dashboard")
# The rest of your app goes here

st.stop() ends the script for anyone who has not signed in, so they never see your data. hmac.compare_digest compares the passwords safely. On Cloudilio, add APP_PASSWORD on your app's Secrets page.

For separate accounts per person, Streamlit 1.42 and later include st.login(). It signs users in through an OpenID Connect provider such as Google or Microsoft. It takes more setup, and it gives each user their own identity in st.user.

7. Keep Data Between Restarts

Write every file your app must keep into one folder that your host preserves. On Cloudilio, that folder is /app/data, and the path is also in the APP_DATA_DIR environment variable. This example saves user uploads there.

import os
from pathlib import Path

import streamlit as st

DATA_DIR = Path(os.environ.get("APP_DATA_DIR", "data"))
UPLOADS = DATA_DIR / "uploads"
UPLOADS.mkdir(parents=True, exist_ok=True)

uploaded = st.file_uploader("Upload a CSV file", type="csv")
if uploaded:
    (UPLOADS / uploaded.name).write_bytes(uploaded.getvalue())
    st.success(f"Saved {uploaded.name}")

st.write("Saved files", sorted(p.name for p in UPLOADS.iterdir()))

Use @st.cache_data for slow data loads. The cache lives in memory and empties on restart, which is fine, because the source files stay in the data folder.

8. Move Your App to Cloudilio

Moving an existing Community Cloud app takes about ten minutes.

  1. Check your requirements.txt. List streamlit and every package your app imports. Community Cloud may have installed some for you.
  2. Keep your packages.txt. If your app needs system programs, such as ffmpeg or Tesseract, Cloudilio installs the ones listed in packages.txt, the same file Community Cloud uses.
  3. Move your secrets. Community Cloud reads secrets from st.secrets. On Cloudilio, add each one on the Secrets page and read it with os.environ["NAME"]. Change those lines in your code.
  4. Point file writes at the data folder. Use the pattern from the previous section for any file your app saves.
  5. Create the app. Upload a zip of your project or link your GitHub repository. Cloudilio detects Streamlit and publishes the app in about a minute.
  6. Connect your domain. Open the Web address page, enter your domain and add the DNS record it shows you at your domain company. Cloudilio sets up https by itself once the record is in place.

9. Questions People Ask

Can I use a custom domain with Streamlit Community Cloud?

No. You can choose a custom subdomain ending in .streamlit.app. To use your own domain, you need another host. Embedding the app in an iframe on your own site is a common workaround, but it is fragile, and some browsers block it.

How do I keep a Streamlit app from sleeping?

On Community Cloud, an app sleeps after 12 hours without traffic, and scheduled pings are an unreliable fix. A host that runs apps continuously solves the problem for good. Cloudilio apps never sleep.

How much memory does a Streamlit app need?

A small app with modest data runs in 256 MB. Apps that load large DataFrames, charts with many points or machine learning models often need 1 GB or more. Watch your app's memory graph for a week after launch and size your plan to the peaks.

Can several people use my Streamlit app at once?

Yes. Each visitor gets their own session. Every session uses some memory, so a busy app needs more memory than a quiet one. Share heavy data across sessions with @st.cache_data or @st.cache_resource so it loads only once.

Cloudilio Engineering Team
Infrastructure Architecture Group • Cloudilio

Cloudilio hosts Python apps. You publish Flask, Django, FastAPI, Streamlit and plain Python scripts without managing a server, and your app's data stays safe between updates.