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:
- From a template, in one click.
- From your GitHub repository.
- With your coding agent, such as Claude Code or Codex.
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
- Create an account and connect GitHub: open GitHub in the sidebar and install the Eurobase GitHub App on your repository. Private repositories work.
- In Projects, select New project. The project name becomes your address,
<name>.eurobase.dev. - Choose the repository. In a repository with several apps, choose the root directory of this one.
- Eurobase detects Python and prefills a start command with
uvicornwhen it finds your FastAPI app and you depend on uvicorn. Check it, and the port (3000 unless you change it) and health path (/). - 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/mcpIn Codex:
codex mcp add eurobase --url https://api.eurobase.dev/mcp
codex mcp login eurobaseSigning 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.0and thePORTenvironment variable. The prefilled uvicorn command does this. - Keep a fast route at your health path, such as a
/or/healththat returns 200. - A start command with a
Procfileworks too: a singleweb: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 $PORTNext 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.