FastAPI

Host a FastAPI app

FastAPI runs under uvicorn in a container, with your interactive /docs page live at a public HTTPS address. Add Postgres beside it when the app outgrows a file.

Paste this into your coding agent

Run curl -s https://vibecodedhost.com/deploy.md and follow its instructions to deploy this project.

Works in Claude Code, Codex, Cursor and anything else that can run a shell command.

The files

What your agent writes.

You do not have to write any of this. It is here so you can see how little there is, and check your agent's work if a deploy goes wrong.

With this manifest the app would be live at https://my-fastapi-app.vibecodedhost.app. The name is yours to choose, as long as no other app has it.

Every field of vibe.json, explained →

vibe.json
{
  "version": 1,
  "name": "my-fastapi-app",
  "containers": [
    {
      "name": "web",
      "build": {
        "context": ".",
        "dockerfile": "Dockerfile"
      },
      "port": 8000,
      "public": true,
      "env": {
        "DATABASE_PATH": "/data/app.db"
      },
      "volume": "/data",
      "healthPath": "/docs"
    }
  ]
}
Dockerfile
FROM python:3.12-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
EXPOSE 8000
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]

Worth knowing

FastAPI on Vibe Hosting

Pass --host 0.0.0.0

uvicorn listens on 127.0.0.1 unless told otherwise, and a container has to listen on all interfaces to be reachable.

Pin your requirements

The image is built from your source on our side, so everything the app imports has to be in requirements.txt or pyproject.toml.

Long requests are fine

The app is a long-lived process, so background tasks and streaming responses run as they do locally.

Questions

Before you deploy.

Can I use Postgres with FastAPI here?

Yes. Add a second container from the postgres image and connect to db:5432. Its data lives on its own volume and survives redeploys.

How much memory does the app get?

An app has 1 GB shared between its containers. Alone, the FastAPI container gets all of it; with a database beside it, your agent sets how the two share it.

Built something else? Next.js, Node.js and Express, Flask, Django, React and Vite, Apps with Postgres, Apps with SQLite, Docker Compose projects.

Your app could be online in a few minutes.

Copy the sentence, paste it into your agent, and read the address it gives you back. No account, no card, nothing to pay.

Paste this into your coding agent

Run curl -s https://vibecodedhost.com/deploy.md and follow its instructions to deploy this project.

Works in Claude Code, Codex, Cursor and anything else that can run a shell command.

Would you rather hold the key yourself?

Questions first, or stuck? Contact support and a person replies as soon as possible.