On 3 December 2026 we read the pricing pages and docs of 21 places that host Python, dropped three with no free route left for new accounts, and compared the other 18. Then we wrote the files hosts ask for (a FastAPI app, Procfile, render.yaml, fly.toml, Dockerfile and a GitHub Actions schedule), checked each on a Windows 11 laptop, and ran the app in Docker with a free instance's limits.
The short answer: for a Flask, FastAPI or Django app or API, start with Render (512 MB and 0.1 CPU, spins down after 15 idle minutes, about a minute to wake, no card) or Railway's Free plan ($5 of usage a month, up to 0.5 GB per service, no card). Vercel runs the same app as functions with 2 GB. For a script on a schedule, GitHub Actions is free in public repositories. For a bot that must never stop, Oracle Always Free VMs or Fly.io with a card ($5 a month). For a public Streamlit app, Streamlit Community Cloud. Our FastAPI app used 50 MB. Checked 3 December 2026.
Fastero
Connect your database. Ask questions. Get dashboards.
Postgres, BigQuery, Snowflake, and 10+ sources — live-connected, AI-powered, no dashboard builder learning curve.
Try free →Free Python hosting compared
From each host's pricing page and docs, read 3 December 2026:
| Host | Free allowance | When idle | Card | Best for |
|---|---|---|---|---|
| Render | 512 MB, 0.1 CPU, 750 hours a month | Sleeps after 15 min | No | Web apps, APIs |
| Railway Free | $5 a month; 3 services of 1 vCPU, 0.5 GB | Sleeps after 5–10 min | No | Web apps, bots |
| Fly.io Free | $1 for 7 days; $5 a month with a card | You choose | For the $5 | Apps, bots |
| Vercel Hobby | 2 GB functions, 4 CPU hours a month | Per request | No | APIs |
| PythonAnywhere | 1 web app, 512 MiB disk, allowlisted internet | Renew monthly | No | Flask, Django |
| Azure App Service F1 | 1 GB, 60 CPU minutes a day | Unloads after 20 min | Yes | Trying Azure |
| Google Cloud Run | 180,000 vCPU-seconds a month | Scales to zero | Yes | Containers |
| Google App Engine | 28 F1 hours a day (384 MB) | Scales to zero | Yes | Small apps |
| AWS Lambda | 400,000 GB-seconds a month | Per request | Usually not | Short jobs |
| Azure Functions | 100,000 GB-seconds a month on Flex Consumption; 400,000 on Consumption | Per request | Yes | Timers |
| Cloudflare Workers | 100,000 requests a day, 10 ms CPU | Per request | No | Tiny APIs |
| GitHub Actions | Unlimited in public repos (16 GB runner) | Per job | No | Schedules |
| Oracle Always Free | 2 VMs of 1 GB, plus 2 Arm OCPUs and 12 GB | May be reclaimed | Yes | Bots, servers |
| Google e2-micro | 1 VM: 0.25 vCPU, 1 GB | Always on | Yes | Bots |
| Streamlit Community Cloud | 690 MB to 2.7 GB | Sleeps after 12 h | No | Streamlit |
| Hugging Face Spaces | Static; 2 Gradio Spaces on ZeroGPU | Gradio sleeps after 48 h | No | Demos |
| GitHub / Cloudflare Pages | Static files (GitHub: 1 GB a site) | No server | No | Pyodide |
| Fastero Free | Python 6 h a day; Streamlit apps 8 h a day | Apps sleep | No | Schedules, team apps |
AWS says most new customers can sign up without a payment method. Custom domains are free on Render (2), Fly.io, Vercel and both Pages hosts, but not on Railway Free, PythonAnywhere's free account or Azure F1.

Memory for one free instance, function or job, from each host's pricing page or docs, read 3 December 2026.
Free hosting for a Flask, FastAPI or Django app
Render runs a Python web service from Git on 512 MB and 0.1 CPU. "Render spins down a Free web service that goes 15 minutes without receiving any inbound traffic", and waking it "takes about one minute". The 750 free hours a month cover one service awake all month (a 31-day month has 744), not two. Local files vanish on spin-down, mail ports 25, 465 and 587 are blocked, and bandwidth is 5 GB a month. In render.yaml, always write plan: free: the spec's example notes "Default: 0.5c-512mb", a paid plan.
Railway's Free plan gives $5 of usage a month, which it says covers about 500 MB of RAM or 0.25 vCPU around the clock. Its sleep rule is unusual: "Sleep is triggered by outbound inactivity, not by missing inbound traffic, so a service that keeps sending traffic stays awake". Custom domains and cron need Hobby, $5 a month. Its builder starts a FastAPI app with uvicorn on its own if the file is called main.py, so ours is.
Fly.io gives $1 of credit for 7 days without a card and $5 a month with one; the smallest machine, 256 MB, is $2.19 per 30 days. Two cautions from its docs: "fly deploy creates 2 Machines per app by default", so add --ha=false, and going over the $5 means "the whole month’s usage is billed at standard rates from the first cent". A stopped machine starts in about 2 seconds.
Vercel runs ASGI and WSGI apps: it finds app in main.py or app.py with no config file. A Hobby function gets 2 GB and 1 vCPU for up to 300 seconds, within 4 hours of active CPU, 360 GB-hours of memory and 1 million invocations a month.
PythonAnywhere's free account runs one Flask or Django app that stops monthly unless renewed and can only call allowlisted sites; its 100 CPU-seconds a day count consoles, not the web app, and RAM isn't published. FastAPI needs the ASGI beta, whose help page says: "We're 99.9% certain that there will be a way to host them in a free plan, though!" More in our PythonAnywhere alternatives.
The big clouds (Google and Azure need a card):
- Google Cloud Run runs any container; its free 180,000 vCPU-seconds are 50 hours of one vCPU spent on requests. App Engine standard gives 28 hours a day of an F1 instance.
- AWS Lambda gives 1 million requests and 400,000 GB-seconds, 222 hours at 512 MB, and a run can now last 30 minutes. A FastAPI app needs an adapter such as Mangum; AWS's new Web Functions run web apps "as serverless HTTP servers", but the pricing page doesn't state their free allowance.
- Azure App Service F1: by default "the app is unloaded after 20 minutes without any incoming requests". The Functions grant needs a pay-as-you-go subscription.
- Cloudflare Workers run Python on Pyodide, so only packages built for it work: fine for small handlers, not a pandas API.
Paid hosts are compared in our guide to deploying Python data apps.
The files each host needs, tested
One small FastAPI app is all these hosts need. uptime_s falls back to about zero after a host has slept and woken the app:
"""A small FastAPI app for trying free Python hosts."""
import platform
import time
from fastapi import FastAPI
app = FastAPI(title="pyhost-demo")
STARTED = time.time()
@app.get("/")
def index():
# uptime_s drops back to ~0 after a host puts the app to sleep and wakes it
return {
"service": "pyhost-demo",
"python": platform.python_version(),
"uptime_s": round(time.time() - STARTED, 1),
}
@app.get("/health")
def health():
return {"ok": True}With requirements.txt pinning fastapi==0.165.0 and uvicorn==0.55.0, we started it with the Procfile's own command in Git Bash, on Python 3.14.3:
$ PORT=8766 sh -c "$(sed 's/^web: //' Procfile)" &
$ curl -s localhost:8766/
{"service":"pyhost-demo","python":"3.14.3","uptime_s":0.9}
$ curl -s localhost:8766/health
{"ok":true}
$ curl -s -o /dev/null -w "%{http_code}\n" localhost:8766/missing
404The Procfile, for Heroku-style hosts and Railway (which calls Procfiles deprecated but still reads them):
web: uvicorn main:app --host 0.0.0.0 --port $PORTrender.yaml, Render's Blueprint (its default Python is 3.14.10):
services:
- type: web
name: pyhost-demo
runtime: python
plan: free # leave it out and Render picks paid 0.5c-512mb
buildCommand: pip install -r requirements.txt
startCommand: uvicorn main:app --host 0.0.0.0 --port $PORT
healthCheckPath: /health
envVars:
- key: PYTHON_VERSION
value: 3.14.10fly.toml, with the machine stopping when idle:
app = "pyhost-demo"
primary_region = "iad"
[http_service]
internal_port = 8080
force_https = true
auto_stop_machines = "stop" # stop when idle; the next request starts it
auto_start_machines = true
min_machines_running = 0
[[vm]]
size = "shared-cpu-1x"
memory = "256mb" # $2.19 per 30 days if it never stopsThe Dockerfile, which Fly.io and Cloud Run build and Render and Railway also accept. exec makes uvicorn process 1, so it gets the stop signal:
FROM python:3.14-slim
ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY main.py .
RUN useradd --create-home app
USER app
# Cloud Run, Railway and Render pass the port in $PORT; Fly.io expects 8080
CMD ["sh", "-c", "exec uvicorn main:app --host 0.0.0.0 --port ${PORT:-8080}"]A short script parsed every file with PyYAML 6.0.4 and Python's tomllib. We haven't deployed them from this post:
render.yaml ok type=web runtime=python plan=free health=/health
fly.toml ok port=8080 auto_stop=stop min_running=0 vm=shared-cpu-1x/256mb
Procfile ok web = uvicorn main:app --host 0.0.0.0 --port $PORT
workflow ok cron='41 16 * * 1-5' tz=Europe/Berlin steps=4 manual=TrueVercel needs none of them: main.py and requirements.txt are enough.
Does a Python app fit in 512 MB of RAM?
Yes, easily, unless you multiply it. We built the image (204 MB on disk) and ran it at Render's free size, 512 MB and 0.1 CPU, with Docker 29.5.2:
$ docker run -d --name blog1203-pyhost --memory 512m --cpus 0.1 \
-p 8769:8080 blog1203-pyhost
dd6045276a26
$ until curl -sf localhost:8769/health; do sleep 0.2; done
{"ok":true}
# first answer 10.5 s after docker run
$ curl -s localhost:8769/
{"service":"pyhost-demo","python":"3.14.10","uptime_s":0.5}
$ docker stats --no-stream --format "{{.MemUsage}} {{.CPUPerc}}" blog1203-pyhost
36.29MiB / 512MiB 0.21%Measured three times per variant, the uvicorn process held 50 MB in the container; on Windows, psutil gave 55 MB idle and 78 MB at the peak of 1,000 requests. pandas and a table of a million invented orders are where memory goes:

The demo app's memory in a Linux container, median of three runs, 3 December 2026: Python 3.14.10, FastAPI 0.165.0, uvicorn 0.55.0, pandas 3.1.2. Invented data.
Memory didn't change with the CPU share; start-up did:
| Our app in Docker, 512 MB, median of 3 | 0.1 CPU (Render's size) | 1 CPU |
|---|---|---|
FastAPI: first answer after docker run |
13.3 s | 2.0 s |
| With pandas and 1 million rows | 19.0 s | 3.1 s |
| Requests a second, 10 at a time | 57 | 498 |
| Median response time | 196 ms | 18 ms |
So on a free instance, run one worker (each uvicorn or gunicorn worker is a full copy; four took 252 MB), and expect a tenth of a CPU to take 13 seconds to start even this small app, on top of the host's own wake-up.
When does a free Python app go to sleep?

Idle time before each host stops a free app, from each host's docs, read 3 December 2026.
The next visitor waits while it wakes: about a minute on Render, about 2 seconds on Fly.io. Pinging an app to keep it awake works on Render only within the 750 hours, and not at all on Railway, which watches outbound traffic.
Connect any database. Ask in plain English.
Start free →Run a Python script on a schedule for free
GitHub Actions is the simplest free scheduler: standard runners are free and unlimited in public repositories, and private ones draw on $12 a month, about 2,000 minutes. Schedules run every 5 minutes at most, can start late, take a time zone, and switch off after 60 days without activity in a public repository. GitHub's terms rule out "any other activity unrelated to the production, testing, deployment, or publication of the software project associated with the repository where GitHub Actions are used", so it suits jobs that belong to the repository.
Our script appends the European Central Bank's daily euro rates to a CSV next to itself, skips a date it already has, and exits with status 1 when the feed fails, so the run is marked failed:
"""Append today's ECB euro reference rates to rates.csv. Safe to run twice."""
import csv
import os
import sys
import urllib.request
import xml.etree.ElementTree as ET
from pathlib import Path
ECB = "https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml"
URL = os.environ.get("RATES_URL", ECB)
WANT = ["USD", "GBP", "JPY", "CHF"]
OUT = Path(__file__).with_name("rates.csv") # next to the script, not the working dir
NS = {"e": "http://www.ecb.int/vocabulary/2002-08-01/eurofxref"}
def fetch():
with urllib.request.urlopen(URL, timeout=20) as resp:
root = ET.fromstring(resp.read())
day = root.find(".//e:Cube[@time]", NS)
rates = {c.get("currency"): c.get("rate") for c in day.findall("e:Cube", NS)}
return day.get("time"), [rates[c] for c in WANT]
def main():
try:
date, values = fetch()
except Exception as exc: # network down, feed changed: fail loudly
print(f"FAILED: {exc}", file=sys.stderr)
return 1
if OUT.exists():
with OUT.open(newline="") as f:
if any(row and row[0] == date for row in csv.reader(f)):
print(f"{date} already in {OUT.name}, nothing to do")
return 0
new = not OUT.exists()
with OUT.open("a", newline="") as f:
w = csv.writer(f)
if new:
w.writerow(["date", *WANT])
w.writerow([date, *values])
print(f"{date} added: " + ", ".join(f"{c} {v}" for c, v in zip(WANT, values)))
return 0
if __name__ == "__main__":
sys.exit(main())Run with Python 3.14.3 on Windows: once, again, and with a feed address that doesn't exist (the exit-code lines are ours):
$ python daily_rates.py
2026-12-02 added: USD 1.0856, GBP 0.83385, JPY 175.17, CHF 0.9223
exit code: 0
$ python daily_rates.py
2026-12-02 already in rates.csv, nothing to do
exit code: 0
$ RATES_URL=https://www.ecb.europa.eu/no-such-feed.xml python daily_rates.py
FAILED: HTTP Error 404: Not Found
exit code: 1The workflow that runs it on weekdays and commits the new row, as .github/workflows/daily-rates.yml (parsed above, not run on GitHub):
name: daily-rates
on:
schedule:
- cron: "41 16 * * 1-5" # 16:41 on weekdays, after the ECB's 16:00 update
timezone: "Europe/Berlin"
workflow_dispatch: # a "Run workflow" button for manual runs
permissions:
contents: write # lets the last step commit rates.csv
concurrency: daily-rates
jobs:
fetch:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.14"
- run: python daily_rates.py
- name: Commit the new row
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add rates.csv
git commit -m "Rates for $(date -u +%F)" || echo "Nothing new"
git pushOther free schedulers: Cloud Run jobs with Cloud Scheduler (3 free jobs per billing account), Lambda with EventBridge Scheduler (14 million free invocations a month), Vercel ("Hobby accounts are limited to daily cron jobs.") and Cloudflare (5 cron triggers). Render, Railway and new PythonAnywhere accounts charge for cron. Crontab basics are in our Python cron job guide, and the team trade-offs in running a Python script online and Python on a schedule without servers.
Free hosting for a Python bot or worker that runs 24/7
A Discord bot or queue worker needs a process that never sleeps. Render's background workers aren't free, PythonAnywhere's always-on tasks are paid-only, and GitHub Actions stops a job at 6 hours. What's left:
- Railway Free: outbound traffic keeps it awake, so a bot holding a WebSocket stays up. At $0.00000386 per GB-second, our 50 MB app would use about $0.51 of the $5 a month on memory, plus CPU (our estimate).
- Fly.io with a card: one 512 MB machine ($3.69 per 30 days) fits the $5. Without an
[http_service]section Fly.io never stops it; deploy with--ha=false. - Oracle Always Free: two 1 GB AMD VMs plus Arm VMs with 2 OCPUs and 12 GB in all, and 10 TB of outbound data. But "Idle Always Free compute instances may be reclaimed by Oracle" if CPU, network and (on Arm) memory stay under 20% for 7 days, which a quiet bot can meet.
- Google e2-micro: the VM is free, its public IPv4 address isn't: $0.005 an hour after one free hour, about $3.72 a month.
Free hosting for Streamlit and other data apps
Streamlit Community Cloud hosts public Streamlit apps from GitHub for free, with one private app and a sleep after 12 hours; see our Community Cloud guide and how to deploy a Streamlit app. On Hugging Face Spaces, "Static Spaces are free for everyone" and a free account 30 days old can host 2 Gradio Spaces on ZeroGPU, but Streamlit now runs only as a Docker Space, which needs PRO at $9 a month (our Spaces guide). A Streamlit app also runs on Render or Railway as an ordinary web service.
Python in the browser: free static hosting with Pyodide
If the Python can run on the visitor's computer, you need no Python host. Pyodide is CPython compiled to WebAssembly, so a plain HTML file can load it from a CDN and run pandas, and any static host can serve it: GitHub Pages (public repositories on GitHub Free, sites up to 1 GB, 100 GB of bandwidth a month), Cloudflare Pages (20,000 files of up to 25 MiB) or a static Hugging Face Space. stlite (Streamlit in the browser) and PyScript work the same way.

Our static test page, served from localhost and opened in Edge 158 with an empty cache. Invented data.
Over three loads with an empty cache, the page downloaded 13.9 MB, with Python ready in a median 4.1 seconds and pandas in 6.5, on a home connection. Everything ships to the browser, so it can't hold an API key or a database password. To write and run Python in a tab instead, see our online Python IDE guide.
Hosts that no longer have a free route
- Koyeb: since February 2026, "New users will only be able to sign up for those plans", meaning Pro ($29 a month) and above, with a payment method.
- Replit: "As of November 2026, the Starter plan is no longer available to new builders".
- Heroku: no free dynos; Eco is $5 a month and sleeps after 30 minutes.
Where Fastero fits
Fastero is an AI and data platform where people and AI agents work together on a team's data. It does two of the jobs on this page, on its Free plan with no end date and no card:
- Scheduled Python scripts. A Python project runs now or on a cron schedule, with secrets as environment variables and a log of every run: 6 hours a day of compute on Free, with ¼ CPU and 0.5 GB per run.
- Streamlit apps behind your team's login. Import one by pasting its Git repository's URL;
st.secretsworks, and viewers sign in for free. On Free an app gets 1 CPU and 2 GB for up to 8 hours a day and sleeps when idle; always-on is on Pro, $20 per editor a month (pricing).

A Python project in a Fastero demo workspace: the code reads its database URL from a secret, and each run keeps its log and files. Invented data.
It isn't a host for public web apps, APIs, webhooks or bots: Fastero doesn't run Flask, FastAPI or Django, has no public links for apps and no custom domains. For those, use Render, Railway, Fly.io or Vercel, and Railway, Fly.io or an Oracle VM for a bot.
FAQ
What is the best free Python hosting?
For a web app or API, Render (512 MB, sleeps after 15 idle minutes) or Railway's Free plan ($5 of usage a month). For a scheduled script, GitHub Actions in a public repository; for a public Streamlit app, Streamlit Community Cloud.
Can I host a Flask or Django website for free?
Yes. Render, Railway, PythonAnywhere and Vercel run Flask and Django free with no card, and Fly.io does with one. PythonAnywhere's free app must be renewed monthly; Render and Railway sleep when idle.
Which free Python hosts don't need a credit card?
Render, Railway, PythonAnywhere, Vercel, Cloudflare Workers, GitHub Actions, Streamlit Community Cloud, Hugging Face's static Spaces and Fastero. Fly.io needs one after its $1 week, and Google Cloud, Azure and Oracle need one to sign up.
How do I stop a free Python app from sleeping?
On most free plans you can't, short of keeping traffic flowing: Render's 750 hours cover one service awake all month, and Railway stays awake while the process sends traffic. Fly.io with a card, an Oracle VM or Google's e2-micro run all the time.
Can I run a Python script 24/7 for free?
Yes: on Railway's Free plan if it keeps a connection open, on Fly.io with a card, or on an Oracle or Google e2-micro VM. Oracle may reclaim a VM under 20% use for 7 days, and Google charges about $3.72 a month for the e2-micro's public IPv4 address.
Is 512 MB of RAM enough for a FastAPI app?
For one worker, easily: ours used 50 MB, or 165 MB with pandas and a million rows in memory. Four workers took 252 MB.
Sources
Read on 3 December 2026:
- PythonAnywhere: Pricing, Free accounts, ASGI beta, Always-on tasks
- Render: Free instances, Pricing, Blueprint spec, FastAPI, Python version
- Railway: Free plan, Plans, Pricing; Railpack: Python, Procfile
- Fly.io: Free plan, Pricing, fly.toml, Autostop
- Koyeb: Joining Mistral AI, Pricing
- Google Cloud: Cloud Run pricing, Free Tier, App Engine pricing, Machine types, Network pricing, Scheduler pricing
- AWS: Lambda pricing, Lambda timeout, Free Tier FAQs, EventBridge pricing
- Microsoft: Functions pricing, App Service pricing, App Service plans, App settings, Free account
- Vercel: Python runtime, Hobby plan, Limits, Cron jobs
- Cloudflare: Python Workers, Workers limits, Pages limits
- GitHub: Workflow triggers, Actions billing, Runners, Pages limits, Actions terms
- Oracle: Always Free resources, Free Tier FAQ
- Hugging Face: Spaces overview, ZeroGPU; Streamlit: Manage your app
- Replit: Starter plan; Heroku: Pricing; Pyodide; Mangum; ECB rates
- Our measurements: Windows 11, Python 3.14.3, FastAPI 0.165.0, uvicorn 0.55.0, pandas 3.1.2, psutil 7.2.2; Docker 29.5.2, python:3.14-slim; Edge 158, Pyodide 314.0.8
Try Fastero free: run your Python scripts on a cron schedule with secrets and run logs, and host your team's Streamlit apps behind its login. No credit card required.
Fastero Dev Team