Pricing Docs Blog Apps Tools Support Start Free
Python

Deploy FastAPI in 60 Seconds

FastAPI is the modern Python framework for building APIs with automatic docs and async support. Deploy it with one command - no Uvicorn wrangling, no ASGI setup.

Deploy FastAPI $3/mo - $10 credit when you add a card

The usual way to deploy FastAPI

  1. Uvicorn needs specific configuration: worker count, host binding, loop policy, and whether to use --reload in prod (you shouldn't)
  2. Deciding between Uvicorn standalone, Uvicorn behind Gunicorn, or Hypercorn - and configuring whichever you choose
  3. ASGI middleware ordering matters in production: CORS, trusted hosts, and proxy headers must be configured differently than in dev
  4. Managing Python path issues on the server so uvicorn main:app resolves correctly from the right working directory
  5. Auto-generated /docs and /redoc endpoints need authentication or disabling in production but work fine in dev

FastAPI is a joy to develop with, but the ASGI deployment stack is a maze of Uvicorn flags and proxy headers.

Or just run one command

$ instapods deploy my-fastapi-app --preset python
→ Uploading files...
→ Installing dependencies (pip install -r requirements.txt)...
→ Starting with uvicorn main:app...
✓ Live at https://my-fastapi-app.instapods.app

What you get

Recommended plan for FastAPI

Launch Plan
$3/mo
  • 1 vCPU
  • 512 MB RAM
  • 10 GB storage
  • HTTPS included
  • Custom domain support
  • SSH & web terminal access
Deploy FastAPI

FastAPI deployment notes

Entry Point

Name your main file main.py and your FastAPI instance "app". InstaPods auto-detects this and starts Uvicorn with the correct module path.

Async Performance

FastAPI async endpoints run on Uvicorn's event loop. The Launch plan handles typical API workloads. Use Build or Grow for CPU-heavy ML inference.

Auto Documentation

The /docs (Swagger) and /redoc endpoints work immediately at your InstaPods URL. Add authentication middleware if you want to restrict access in production.

FastAPI hosting FAQ

How much does FastAPI hosting cost?

FastAPI hosting on InstaPods starts at $3/mo on the Launch plan (1 vCPU, 512MB RAM, 10GB disk), which handles typical API workloads. For CPU-heavy ML inference or higher concurrency, the Build plan at $7/mo (2 vCPU, 1GB RAM) or Grow at $15/mo is more appropriate. All plans include SSH, HTTPS, and flat billing with no per-request charges.

Is FastAPI hosting free?

No persistent FastAPI hosting is genuinely free. Render and Fly.io have free tiers that sleep after inactivity, which breaks the async-server model FastAPI relies on. Deta Space has a free tier but limited resources. InstaPods starts at $3/mo on a real always-on server, with a $10 credit when you add a card.

How do I deploy a FastAPI app?

On InstaPods, run `instapods deploy my-app --preset python` from inside your FastAPI project. Name your main file main.py and your app instance "app"; the CLI auto-detects this and starts Uvicorn with the correct module path. Total time from deploy command to live URL: about 60 seconds. The /docs (Swagger) and /redoc endpoints work immediately.

Does FastAPI need Uvicorn or Gunicorn in production?

FastAPI runs on Uvicorn (ASGI). On InstaPods we start Uvicorn directly for typical workloads; for high-concurrency production deployments, we run Uvicorn workers behind Gunicorn to use multiple processes. You do not configure this by hand; InstaPods picks the right combination based on your plan.

Can I use FastAPI with Postgres or Redis?

Yes. Add managed Postgres, MySQL, Redis, or MongoDB as a service on the same pod (`instapods services add my-app postgres`). Credentials are exposed as env vars (DATABASE_URL, REDIS_URL). For SQLAlchemy or asyncpg, point the connection string at these env vars.

How does FastAPI hosting on InstaPods compare to Render or Fly?

InstaPods is flat $3-49/mo with databases included and SSH access on every plan. Render starts at $7/mo plus separate Postgres fees. Fly.io is usage-based and the bills can vary. For FastAPI apps with predictable traffic, InstaPods is meaningfully cheaper and easier to budget for.

Should I protect the /docs endpoint in production?

FastAPI exposes /docs (Swagger UI) and /redoc by default. For internal APIs, this is fine. For customer-facing APIs, add authentication middleware or disable the endpoints in production (set docs_url=None when constructing FastAPI()). The same pattern works on InstaPods as on any other host.

Can I use a custom domain with my FastAPI app?

Yes, included on every plan. Add the domain in the InstaPods dashboard, set a CNAME, SSL auto-issues. Useful for API products where you want api.yourdomain.com instead of an instapods.app subdomain.

Deploy FastAPI in 60 seconds

One command. Real server. HTTPS included. No DevOps degree required.

Start Free