Free FastAPI Hosting: Deploy a FastAPI App Without a Dockerfile

FastAPI hosting free of charge for the APIs that grew out of a notebook or a laptop: connect the GitHub repository, and SnapDeploy builds a Python image, starts uvicorn on its own HTTPS address, and redeploys on every push.

Free tier: 4 containers, 512 MB each, 100 hours a month, 10 deploys a day. No credit card. Always-On from $12 a month when the API has to answer 24/7.

Last verified 5 November 2026 against the free-tier docs, the build generator and each competitor's own documentation.

Free FastAPI Hosting in 2026: Who Still Has a Real Free Tier

Most "deploy FastAPI for free" guides still name Heroku's free tier, which ended in November 2022, or Deta Space, which shut down in October 2024. This table is what each provider's own documentation said when we checked it.

Host Free tier for a FastAPI server RAM / CPU Sleeps after Card at sign-up Cheapest 24/7
SnapDeploy4 containers, 100 container-hours/month, 10 deploys/day; no expiry; uvicorn started for you512 MB / 0.25 vCPU15 min idle, wakes in ~60 sNoAlways-On Small $12/month
Render750 instance-hours/month per workspace; 5 GB bandwidth on the Hobby workspace since April 2026512 MB / 0.1 CPU15 min idle, wakes in about a minuteNoStarter $7/month
Railway$5 one-time trial credit for 30 days, then a Free plan with $1/month of credit1 GB / shared vCPU on the trialOpt-in only; credit runs out insteadNo for the trialHobby $5/month minimum usage
Koyeb1 free web service, Frankfurt or Washington only512 MB / 0.1 vCPU1 h idle, wakes in 1–5 sYes, $29 hold since Feb 2026eco-nano $1.61/month
PythonAnywhere1 web app on a pythonanywhere.com subdomain; ASGI/FastAPI only via the beta CLI; 100 CPU-seconds/day; the app expires after a month unused512 MBNo sleep, CPU quota insteadNoHacker $5/month
Fly.ioNo free tier since October 2024; trial of 2 machine-hours or 7 days, then apps stopUp to 2 vCPU / 4 GB on the trialStops at the end of the trialCard or $25 prepaid to keep runningshared-cpu-1x $1.94/month
Vercel HobbyFastAPI runs as a serverless function, not a long-running server; non-commercial use onlyFunction memory, no containerEvery request is a cold or warm functionNoPro $20/month per user

Isolation: every SnapDeploy container, free tier included, runs as its own AWS Fargate task with a reserved 0.25 vCPU and 512 MB, so your FastAPI process never shares a kernel with another customer's app.

Sources: render.com/docs/free, render.com/docs/compute-plans and the 23 April 2026 plan changelog; docs.railway.com free-trial and plans pages; koyeb.com docs (reference/instances, reference/organizations) and pricing; help.pythonanywhere.com (ASGI command line) and the plans page; fly.io free-trial and pricing pages; vercel.com/docs/functions and the Hobby fair-use guidelines. Checked 26 September 2026 and re-read 5 November 2026; if a provider changes its plan, this table will be behind until the next check.

What Happens When You Deploy a FastAPI App Here

Read from the build generator, not from a brochure. Every step below runs on AWS CodeBuild for ARM64, and the image is pushed to a private registry.

  1. Detection. A requirements.txt, pyproject.toml or setup.py makes it a Python project; the word fastapi in requirements.txt selects the FastAPI start command. The build then checks that an entry file exists: main.py, app.py, server.py, run.py, asgi.py or similar.
  2. Python version. Read from runtime.txt, .python-version or the requires-python line in pyproject.toml; 3.11 is the default and comes from the platform's own image mirror. Other versions are pulled from the official Python image.
  3. Dependencies. pip install -r requirements.txt on a slim image with gcc available for packages that compile; a pyproject-only project gets pip install . instead. Poetry and uv lockfiles are honoured.
  4. Runtime. The app runs as a non-root user with PORT=8000 in the environment and the port exposed, on a Small container (512 MB, 0.25 vCPU) on the free tier.
  5. Start. uvicorn main:app --host 0.0.0.0 --port 8000, one worker. If your app object is not app in main.py, enter the start command yourself in the deploy form (Advanced options → Start command) and the generated one is replaced.
  6. Health and traffic. The health check tries /actuator/health, /health, /healthz, /api/health and then /, accepting any 2xx or 3xx. Once it passes, HTTPS traffic flows to <name>.containers.snapdeploy.app and the build and runtime logs are in the dashboard.

Deploy a FastAPI App Step by Step

Three files, the same ones in the sample repository AAR-Labs/fastapi-on-snapdeploy, built and run on ARM64 before this page was written.

1.Put the app in main.py and add a /health route

# main.py
from fastapi import FastAPI

app = FastAPI()

@app.get("/health")
def health():
    return {"status": "ok"}

@app.get("/")
def root():
    return {"message": "Hello from FastAPI on SnapDeploy"}

No if __name__ == "__main__" block is needed: uvicorn imports main:app and binds 0.0.0.0:8000 for you. A server started on 127.0.0.1 in your own code would pass its tests and fail the health check in the cloud; this is the most common first-deploy failure in the build logs.

2.Pin FastAPI and uvicorn in requirements.txt

fastapi==0.115.6
uvicorn[standard]==0.34.0

The build reads the word fastapi here to pick the uvicorn start command. No Dockerfile is required; if you commit one it is used as written, with a two-stage limit on Small containers. A multi-stage example is on the Docker hosting page.

3.Connect the repository, add variables, deploy

Sign in with email or GitHub, choose Deploy from GitHub, pick the repository and branch, and add environment variables in the dashboard rather than in the code: DATABASE_URL, API keys, ALLOWED_ORIGINS for CORS. Values whose names look like secrets are masked. The first build takes one to five minutes.

4.Push to redeploy, and open /docs

Every push to the linked branch rebuilds and redeploys; a failed build never replaces the running version. FastAPI's interactive documentation is at https://<name>.containers.snapdeploy.app/docs from the first deploy.

Why Free FastAPI Apps Sleep, and What to Do About It

A uvicorn process that never exits costs the host money every hour it runs, so every free tier that is still alive either sleeps the process or meters it. SnapDeploy sleeps a free container after about 15 minutes without traffic and wakes it in about 60 seconds on the next browser visit; sleeping time does not count against the 100 hours. Render sleeps after 15 minutes, Koyeb after an hour, PythonAnywhere meters CPU seconds instead.

For a portfolio API, a class project or a backend that a few people open a few times a day, that is fine. For an API that a mobile app, a cron job or another service calls around the clock, it is not: those callers do not trigger the wake, and they will see a 503 wake page while the container is asleep. That API belongs on Always-On, from $12 a month per container, which also removes the deploy limit and turns on WebSockets and custom domains.

Two more things a free container cannot do: keep files between restarts (the filesystem resets on redeploy, restart and wake, so SQLite is for demos only) and run a background worker without an HTTP port. Keep state in a database add-on or an external database, and give workers a small FastAPI health route.

Project Layouts, Sizes and the Database

Detection is by requirements.txt and an entry file, so most repositories deploy as they are. The best hosting for FastAPI depends less on the framework than on whether the process must stay up, which is the free-versus-Always-On question.

main.py at the root

The default layout: app = FastAPI() in main.py, started as uvicorn main:app. Nothing to configure.

A package: app/main.py

Enter the start command in the deploy form, for example uvicorn app.main:app --host 0.0.0.0 --port 8000, and keep an __init__.py in the package.

Poetry, uv, pyproject.toml

Honoured by the build. Keep fastapi and uvicorn in the dependencies, and add a requirements.txt if you want the FastAPI start command picked automatically.

Async, one worker

Small (512 MB, 0.25 vCPU) serves one async uvicorn worker well. Use async def routes with async database drivers, and cap the connection pool at a handful of connections.

Databases

Managed PostgreSQL, MySQL, MariaDB, MongoDB, Redis and RabbitMQ add-ons, each with a $1 12-hour trial; or an external database through DATABASE_URL. SQLAlchemy async and asyncpg both work.

Custom domain and WebSockets

Both come with Always-On: your domain with a certificate issued for you, and FastAPI WebSocket routes held open.

Free FastAPI Hosting Questions, Answered

Is there free FastAPI hosting without a credit card?

Yes. SnapDeploy's free tier runs up to 4 containers with 100 container-hours a month and 10 deploys a day, and sign-up needs only an email address or a GitHub account. Render's free web services also need no card. Koyeb has required a card with a $29 hold since February 2026, and Fly.io has had no free tier since October 2024.

Do I need a Dockerfile to deploy a FastAPI app?

No. When requirements.txt lists fastapi, the platform builds a Python 3.11 image, installs the requirements, and starts uvicorn main:app --host 0.0.0.0 --port 8000. Keep the FastAPI() instance in main.py at the repository root, or set your own start command in the deploy form. If you commit a Dockerfile it is used as written.

Why does my FastAPI app fail with "entry point not found" or "not responding on its port"?

The generated start command is uvicorn main:app. If your app object lives in app.py or in a package such as app/main.py, either rename it to main.py at the root or enter the start command yourself, for example uvicorn app.main:app --host 0.0.0.0 --port 8000. The app must bind 0.0.0.0 and listen on the PORT variable, 8000 by default.

Which Python versions are supported?

Python 3.11 by default. The version is read from runtime.txt, .python-version or pyproject.toml; 3.11 comes from the platform's own image mirror, other versions from the official Python image. pip with requirements.txt, Poetry, uv and pyproject-only projects are all supported.

Can I host a FastAPI app for free 24/7?

Not on any free tier we checked. Free containers sleep after about 15 minutes without traffic and wake in about 60 seconds on the next browser visit. An API that other services call around the clock needs Always-On, from $12 a month per container, which also removes the deploy limit and allows WebSockets and a custom domain.

How many uvicorn workers can I run on the free tier?

One. A Small container has 512 MB of RAM and 0.25 vCPU; a single async worker serves a typical FastAPI app well there. Medium (2 GB) and Large (4 GB) containers run on Always-On.

Where does the database go?

Managed PostgreSQL, MySQL, MariaDB, MongoDB, Redis and RabbitMQ are paid add-ons wired into the container's environment, each with a $1 12-hour trial. An external database such as Neon or Supabase works too: put its connection string in DATABASE_URL.

Does my app need a /health route?

Not strictly. The health check tries /actuator/health, /health, /healthz, /api/health and then /, accepting any 2xx or 3xx response. A one-line @app.get("/health") route makes the check unambiguous and costs nothing.

Proud Member Of

As Seen On

Deploy Your FastAPI App Today

Free tier, no credit card, no Dockerfile needed. Always-On from $12 a month when the API must answer 24/7.

Deploy Free Today
FIRST OF ITS KIND

Sprint Pack — $1 for 24 hours

The first managed container PaaS to offer a one-time 24-hour Always-On pass under $5. Everything in Always-On Small for one Small (512 MB) container — runs 24/7, no daily deploy limit, WebSockets & real-time apps. No subscription, no auto-renewal.

Need a managed database too? DB Sprint Pack — $1 / 12h for Postgres, MySQL, MariaDB, Mongo, Redis, or RabbitMQ.