Hosting

FastAPI Hosting with Uvicorn and Git Deploy

Run a FastAPI app on VeloxaHost: Python 3.11, Uvicorn as your start command, dependencies from requirements.txt on each Git deploy, HTTPS handled for you.

FastAPI runs on a VeloxaHost Python site with Uvicorn as the server. The site is its own container with Python 3.11 and a virtual environment at /opt/app/venv; your app runs as the veloxa-app system service. The site's web server answers on your domain with a free Let's Encrypt certificate and forwards requests to 127.0.0.1:8000, where Uvicorn listens.

A new Python site's default start command is Gunicorn serving a WSGI app. FastAPI is an ASGI app, so you set the start command to Uvicorn when you create the site.

Deploy from Git

Prepare the repository

The deploy installs from requirements.txt at the root of the app; it does not read pyproject.toml or uv.lock. If you manage dependencies with uv or Poetry, export a requirements.txt and commit it. At minimum:

fastapi[standard]

FastAPI's docs note that fastapi[standard] brings Uvicorn with it. If you install plain fastapi, add uvicorn yourself.

Keep the app object in main.py as app = FastAPI(), or adjust the module path in the command below.

Create and deploy the site

  1. In the console, open Websites and click Add Website.

  2. Enter your domain and pick Python under Hosting type.

  3. In Start Command, enter:

    uvicorn main:app --host 127.0.0.1 --port 8000 --workers 2
    

    The command runs from /opt/app with the virtual environment's programs, so uvicorn must be in your requirements. Uvicorn's own defaults are 127.0.0.1 and 8000; spelling them out makes the intent clear. Do not add --reload in production.

  4. Click Create Website and add the DNS records shown under DNS — point your domain here. HTTPS is issued once they resolve. Until the first deploy installs Uvicorn, the app service cannot start, which is expected.

  5. In the Deploy from Git card, click Deploy, then enter the Repository URL (https), the Branch, an optional Subdirectory and an Auto-deploy schedule (Manual / webhook only, Every hour or Every day).

  6. Click Deploy Now. The deploy makes a shallow clone of the branch, replaces /opt/app with it except the venv folder, runs pip install -r requirements.txt and restarts the app. Refresh to see the result under Recent deploys; your interactive docs are then at https://example.com/docs.

  7. For deploys on every push, copy the CI Webhook URL into your CI secrets and call it after your tests pass: curl -fsS -X POST "$VELOXAHOST_DEPLOY_HOOK". A call during a running deploy gets a 409 answer.

Environment variables

The console has no environment form yet. In the console (Advanced > Open Console), run systemctl edit veloxa-app, add lines such as Environment=DATABASE_URL=postgresql://... under [Service], then systemctl restart veloxa-app. Pydantic settings and os.environ read them as usual.

HTTPS and client addresses

Uvicorn trusts proxy headers from 127.0.0.1 by default, so request.url uses https and request.client is the visitor's address without extra flags.

Supported versions

Component Version
Python 3.11, from Debian 12's packages
FastAPI Current releases, which need Python 3.10 or newer
Uvicorn Whatever your requirements.txt installs

There is no Python version picker. Python 3.11 gets security fixes until October 2027.

Which plan fits

An API with two Uvicorn workers fits Launch ($6.99/month: 1 vCPU, 1 GB RAM, 3 websites). Pick Grow ($12.99/month: 2 vCPU, 4 GB RAM, 10 websites) for more workers, larger models in memory, or several services. Each site can use up to its plan's RAM and vCPU; disk per site is 5 GB on Launch and Grow and 2 GB on Scale and Business. Yearly billing is ten times the monthly price. Details on pricing.

Limits and when to use a VPS

  • Long-lived connections. WebSocket and streaming responses reach your app, but the platform closes a connection that sends nothing for five minutes. Send a ping more often than that. For a real-time service with many open connections, a VPS gives you full control.
  • Background work. BackgroundTasks run inside the app process and are fine for short jobs. A separate worker (Celery, ARQ, Dramatiq) and its queue, such as Redis, belong on a VPS.
  • No database server on a Python site. Run PostgreSQL on a VPS, or keep a SQLite file outside /opt/app.
  • No build step, five minutes for the install. A failed pip install does not fail the deploy today; check journalctl -u veloxa-app.
  • Public repositories only.

For WSGI apps, see Flask hosting and Django hosting.

FAQ

Can I use the fastapi run command to start the app?

It works if fastapi[standard] is installed, but fastapi run listens on 0.0.0.0 and its options are not covered here. The Uvicorn command above binds only to 127.0.0.1:8000, behind the site's web server, which is what you want.

Can I run Gunicorn with Uvicorn workers?

Yes, if you install both and set the start command accordingly, binding 127.0.0.1:8000. Uvicorn's own --workers option is the simpler choice.

Does a deploy run database migrations?

No. Add a step before start with systemctl edit veloxa-app, for example ExecStartPre=/opt/app/venv/bin/alembic upgrade head under [Service]. It then runs on every restart, including every deploy.

Which Python version will my app get?

Python 3.11. Pin packages that support it; current FastAPI, Uvicorn and Pydantic releases do.

FastAPI sites run on any managed hosting plan, from Launch at $6.99/month. Framework facts were checked on 2026-10-18 against: fastapi.tiangolo.com/deployment/manually, fastapi.tiangolo.com/fastapi-cli, uvicorn.dev/settings, pypi.org/project/fastapi, packages.debian.org/bookworm/python3.

Ready to deploy?

Start a free trial, or compare plans to match your team's scale.