Deploy a FastAPI app

FastAPI is a Python framework for building APIs with type hints. This guide deploys a FastAPI app on Eurobase, on European infrastructure, in one of three ways:

One-click deploy from a template

The template is a minimal FastAPI app that deploys without configuration. Copy it to your GitHub account, then create a Eurobase project from your copy.

Deploy from a GitHub repo

  1. Create an account and connect GitHub: open GitHub in the sidebar and install the Eurobase GitHub App on your repository. Private repositories work.
  2. In Projects, select New project. The project name becomes your address, <name>.eurobase.dev.
  3. Choose the repository. In a repository with several apps, choose the root directory of this one.
  4. Eurobase detects Python and prefills a start command with uvicorn when it finds your FastAPI app and you depend on uvicorn. Check it, and the port (3000 unless you change it) and health path (/).
  5. Select Save and Deploy. Your app goes live once it passes its check.

Deploy with your coding agent

Connect your agent to the Eurobase MCP server once. In Claude Code:

claude mcp add --transport http eurobase https://api.eurobase.dev/mcp

In Codex:

codex mcp add eurobase --url https://api.eurobase.dev/mcp
codex mcp login eurobase

Signing in opens Eurobase in your browser, where you choose the projects the agent may use and what it can do. Cursor, Zed and VS Code are on AI agents.

Then, in your repository, ask:

Deploy this project on Eurobase.

The agent creates the project, starts the first deployment and follows it until your site answers at <name>.eurobase.dev. Secrets never pass through the agent: add them in the project's Secrets.

How Eurobase runs FastAPI

Eurobase builds the app with the standard Paketo Python buildpack and runs it as a container. Containers scale to zero when nobody calls them; the next request starts one again and waits for your app to start.

A deployment goes live only after your health path answers GET with 2xx or 3xx. If it doesn't, the previous deployment keeps serving. Details are on Containers and static sites.

Before you deploy

  • Listen on 0.0.0.0 and the PORT environment variable. The prefilled uvicorn command does this.
  • Keep a fast route at your health path, such as a / or /health that returns 200.
  • A start command with a Procfile works too: a single web: line always wins.
  • Secrets reach your app when it runs, not during the build. A changed secret applies with the next deployment.

Start command

For an app object called app in main.py:

uvicorn main:app --host 0.0.0.0 --port $PORT

Next steps

  • Every push to the project's branch deploys again; roll back from Deployment history. See Getting started.
  • Connect your own domain from Domains in the sidebar.
  • Add a database with Eurobase + Supabase.
  • Read every request in the project's Logs.