Streamlit hosting and Gradio hosting on your own container: a private app without a paid plan, secrets in environment variables, a database or an API next to it, and a custom domain when you need one. The exact Dockerfile for each framework is below.
Free tier: 4 containers, 512 MB each, 100 hours a month, 10 deploys a day. No credit card. Always-On from $12 a month, Medium (2 GB) from $25, dedicated GPU from $499.
Last verified 28 September 2026 against the free-tier docs, the deployment code, and the Streamlit Community Cloud and Hugging Face documentation read the same day.
The four realistic options, with the limits each one states on its own documentation as of 28 September 2026. Two of them changed recently and most tutorials online have not caught up.
| Host | Free plan | Resources | Sleeps after | Private apps | Needs |
|---|---|---|---|---|---|
| SnapDeploy | 4 containers, 100 container-hours a month, no card | 512 MB, 0.25 vCPU free; 2 GB and 4 GB paid; dedicated T4 or A10G GPU paid | 15 minutes idle; ~60 s wake; none on Always-On | Yes, on the free tier | A Dockerfile for Streamlit; a GitHub repo or an image upload |
| Streamlit Community Cloud | Free; unlimited public apps, one private app | About 0.078 to 2 CPU cores and 690 MB to 2.7 GB RAM, shared (their Feb 2024 figures) | 12 hours without traffic; any viewer can wake it | One | A GitHub account with admin rights on the repo; apps hosted in the US only |
| Hugging Face Spaces | Static Spaces free; Gradio and Docker Spaces need PRO ($9/mo) or Team ($20/user/mo); free personal accounts may host up to 2 Gradio Spaces on ZeroGPU | CPU Basic: 2 vCPU, 16 GB, 50 GB non-persistent | 48 hours idle on free hardware; visitor restarts it | Protected and private visibility need a paid plan | Streamlit runs as a Docker Space; no Streamlit SDK option any more |
| Render free web service | 750 instance-hours a month per workspace, no card | 512 MB, 0.1 CPU | 15 minutes; about a minute to wake | Yes | A start command; 5 GB bandwidth a month on the Hobby workspace |
Sources: docs.streamlit.io (manage your app: app hibernation and resource limits; status and limitations) and the Streamlit forum FAQ of 1 March 2024 on private apps; huggingface.co/docs/hub (Spaces overview, Spaces GPU and sleep settings) and huggingface.co/pricing; render.com/docs/free and render.com/pricing.
Streamlit needs its own server command, so this one takes a five-line Dockerfile. The automatic Python build runs python app.py, which is right for Flask and Gradio but does not start Streamlit.
The platform sets a PORT environment variable in every container. Streamlit must listen on it and on all interfaces; the shell form of the command is what expands the variable.
FROM python:3.11-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
EXPOSE 8501
CMD ["sh", "-c", "streamlit run app.py --server.port=${PORT:-8501} --server.address=0.0.0.0 --server.headless=true"]
requirements.txt must list streamlit and whatever the app imports. Pin versions; a build that pulls a new major version of pandas is the most common reason a working app breaks on redeploy.
Community Cloud uses a secrets file; here the same values go into the container's environment variables in the dashboard and are read with os.environ. Nothing secret goes in the repository.
import os
import streamlit as st
api_key = os.environ["OPENAI_API_KEY"]
st.title("Sales dashboard")
Sign in, choose Deploy from GitHub, pick the repository and branch, add the variables, deploy. The build log streams live; when the image is pushed the container starts and the app is at https://<name>.containers.snapdeploy.app. The health check accepts Streamlit's root page, so no extra route is needed. Every push to the branch redeploys.
A dashboard over a CSV of a few megabytes runs in the free 512 MB. A large DataFrame, a local model or image processing wants Medium (2 GB, 1 vCPU, $25 a month) or Large (4 GB, 2 vCPU, $45). A model that needs a GPU runs on a dedicated T4 ($499 a month) or A10G ($999) with the same Dockerfile flow. Sizes change without a rebuild.
To host a Gradio app for free here, no Dockerfile is required: Gradio starts from a normal Python script, so it fits the automatic build. Two things matter: bind to all interfaces and read the port from the environment.
import os
import gradio as gr
def greet(name):
return f"Hello, {name}!"
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
if __name__ == "__main__":
demo.launch(server_name="0.0.0.0",
server_port=int(os.environ.get("PORT", 7860)))
With requirements.txt listing gradio, the automatic Python build installs it and runs python app.py. No Dockerfile is required. Do not use share=True: that creates a temporary tunnel link from Gradio's servers, and the container already has a permanent HTTPS address.
When you need a specific Python version, a system package such as ffmpeg, or model weights baked into the image, commit a Dockerfile and it is used as written.
FROM python:3.11-slim
RUN apt-get update && apt-get install -y --no-install-recommends ffmpeg && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
EXPOSE 7860
CMD ["python", "app.py"]
Small models load fine into a Medium container. Anything that expects CUDA belongs on a dedicated GPU instance, where the same Dockerfile runs with the NVIDIA runtime and one-click PyTorch, Hugging Face and vLLM templates exist. The container's filesystem is ephemeral, so download weights at build time into the image or at start from object storage, not into a folder you expect to survive a restart.
Both incumbents are good at what they are for: public demos. These are the cases where people move to a container.
docker save tarball instead.Free Python hosting here follows the same rules as any container; the complete list is on the free-tier page.
Yes. The free tier runs up to 4 containers with 100 container-hours a month and 10 deploys a day, with no credit card, and a Streamlit app is one container. It sleeps after 15 minutes without visitors and wakes in about 60 seconds when someone opens it in a browser. Always-On at $12 a month keeps it up 24/7.
Yes, a short one. The automatic Python build starts an app with python app.py, which does not start Streamlit's server. A five-line Dockerfile that installs requirements.txt and runs streamlit run with the platform's PORT variable is all that is needed; it is on this page.
Not necessarily. If app.py calls demo.launch with server_name 0.0.0.0 and the port read from the PORT environment variable, the automatic Python build, which runs python app.py, starts it. A Dockerfile gives you control over the Python version and system packages, and is shown on this page too.
No. The platform's health check tries the common health paths and then the root path, and for Python apps any HTTP response counts as alive. Streamlit and Gradio both answer the root path, so no extra route is needed.
Community Cloud is free, needs a GitHub account, allows unlimited public apps but one private app, and hibernates an app after 12 hours without traffic. SnapDeploy sleeps a free app after 15 minutes but allows private apps on the free tier, works without GitHub through an image upload, offers a custom domain and 24/7 uptime on Always-On, and can run a database or an API next to the app.
Static Spaces are free for everyone, but creating a Gradio or Docker Space now requires a paid plan: PRO at $9 a month for personal accounts, Team or Enterprise for organisations, with an exception of up to 2 Gradio Spaces on ZeroGPU for free personal accounts in good standing. Free CPU hardware sleeps after 48 hours idle. SnapDeploy's free tier has no plan requirement for a Gradio container; the trade-off is a 15-minute sleep and 512 MB.
For a dashboard over a small dataset or a demo that calls an API, yes. Pandas on a large frame, a local model or heavy image work needs Medium (2 GB, $25 a month) or Large (4 GB, $45). Models that need a GPU run on a dedicated T4 or A10G instance.
In the container's environment variables in the dashboard, never in the repository. Read them with os.environ in Python. Values whose names look like secrets are masked in the dashboard.
Free tier, private repository, no credit card. Always-On from $12 a month when it has to stay up.
Deploy Free TodayThe first managed container PaaS to offer a one-time 24-hour Always-On pass under $5. Unlimited deploys + Always-On for one Small (512 MB) container — including WebSockets & real-time apps. No subscription, no auto-renewal. Stack two for 48 hours.
Need a managed database too? DB Sprint Pack — $1 / 12h for Postgres, MySQL, MariaDB, Mongo, Redis, or RabbitMQ.