Quickstart: Deploy a FastAPI App
This guide will walk you through deploying a basic FastAPI application on Seenode using Uvicorn as the ASGI server.
Deploy a FastAPI Template
Section titled “Deploy a FastAPI Template”Get started in seconds by deploying our pre-configured FastAPI template.
FastAPI Template
Deploy a minimal FastAPI application designed for zero-configuration deployment on Seenode.Deploying an Existing FastAPI Project
Section titled “Deploying an Existing FastAPI Project”Follow these steps to deploy your existing FastAPI application from a Git repository.
-
Prepare Your FastAPI App
Ensure your project has the necessary files for Seenode to run it.
Project Structure
Your project should have a
main.py
file and arequirements.txt
.Directorymy-fastapi-app/
- main.py
- requirements.txt
Example
main.py
Seenode will look for an
app
instance in yourmain.py
file.main.py from fastapi import FastAPIapp = FastAPI()@app.get("/")def read_root():return {"message": "Hello from FastAPI"}requirements.txt
Your
requirements.txt
should includefastapi
and an ASGI server likeuvicorn
for production.requirements.txt fastapiuvicorn[standard] -
Deploy on Seenode
Follow these steps to deploy your FastAPI application:
- From the Seenode Dashboard, create a new Web Service and connect the Git repository for your FastAPI application.
- Seenode automatically detects a Python project. Configure the build and start commands. A common setup is:
- Build Command:
pip install -r requirements.txt
- Start Command:
uvicorn main:app --host 0.0.0.0 --port 8000
- Build Command:
- Choose your preferred instance size and click Create Web Service.
- Watch your deployment progress in real-time through the Logs tab.
- Once complete, your API will be live and accessible at your service’s public URL.
Next Steps
Section titled “Next Steps”Now that your API is live, here are some recommended next steps:
Set up a Custom Domain (Coming Soon)
Configure a custom domain to point to your new web service.Connect to a Database
Instantly scaffold and connect PostgreSQL and MySQL databases