Quick Start
Get your FastAPI application deployed in minutes with FastAPI Cloud! This guide will walk you through creating and deploying your first app.
Prerequisites
Section titled “Prerequisites”- uv for project scaffolding.
- Or a recent, supported version of Python.
- A FastAPI Cloud account.
1. Create Your Project
Section titled “1. Create Your Project”There are two ways to get started: using fastapi-new for a quick setup, or manually setting up your project if you prefer more control.
Create a new FastAPI project with a single command:
uvx fastapi-new myappcd myappThis will create a new directory with a complete project structure, including a basic sample FastAPI application and project configuration. It will also add fastapi[standard] as a dependency, which includes the FastAPI Cloud CLI needed for deployment.
By default, fastapi-new uses the global Python version you’ve pinned with uv. To specify a different Python version for your project, use the -p/--python option:
uvx fastapi-new myapp --python 3.11cd myappActivate the virtual environment:
source .venv/bin/activate.venv\Scripts\Activate.ps1source .venv/Scripts/activateIf you prefer to set up your project manually, follow these steps:
Step 1: Initialize Your Project
uv init myappcd myappmkdir myappcd myapppython -m venv .venvActivate the virtual environment:
source .venv/bin/activate.venv\Scripts\Activate.ps1source .venv/Scripts/activateStep 2: Install FastAPI
uv add "fastapi[standard]"pip install "fastapi[standard]"The fastapi[standard] dependency group includes the FastAPI Cloud CLI, which provides the fastapi login and fastapi deploy commands.
Step 3: Create Your App
Create a file named main.py with this code:
from fastapi import FastAPI
app = FastAPI()
@app.get("/")def main(): return {"message": "Hello World"}2. Login to FastAPI Cloud
Section titled “2. Login to FastAPI Cloud”Authenticate with your FastAPI Cloud account:
fastapi loginThis will open your browser to complete the authentication process.
3. Deploy Your App
Section titled “3. Deploy Your App”Deploy your application with a single command:
fastapi deployThe CLI will automatically detect your FastAPI app and deploy it to the cloud.
Deploying to FastAPI Cloud...🚀 Preparing for liftoff! Almost there...✅ Deployment successful!🐔 Ready the chicken! Your app is ready at https://myapp.fastapicloud.dev🚀 Your app is now live: https://myapp.fastapicloud.dev
4. Explore Your API
Section titled “4. Explore Your API”FastAPI automatically generates interactive API documentation. Visit your app’s /docs endpoint to explore the API:
https://myapp.fastapicloud.dev/docs5. Monitor Your App
Section titled “5. Monitor Your App”Check your application logs in the FastAPI Cloud dashboard:
- Go to FastAPI Cloud Dashboard.
- Go to Apps in the left sidebar.
- Select your app to view its details.
- Click on the Logs tab to see real-time application logs.
6. And that’s it! 🎉
Section titled “6. And that’s it! 🎉”You’ve successfully deployed your first FastAPI application to the cloud.
You code. We cloud.