Skip to content

Quickstart: Deploy a FastAPI App

This guide will walk you through deploying a basic FastAPI application on Seenode using Uvicorn as the ASGI server.

Get started in seconds by deploying our pre-configured FastAPI template.

Follow these steps to deploy your existing FastAPI application from a Git repository.

  1. 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 a requirements.txt.

    • Directorymy-fastapi-app/
      • main.py
      • requirements.txt

    Example main.py

    Seenode will look for an app instance in your main.py file.

    main.py
    from fastapi import FastAPI
    app = FastAPI()
    @app.get("/")
    def read_root():
    return {"message": "Hello from FastAPI"}

    requirements.txt

    Your requirements.txt should include fastapi and an ASGI server like uvicorn for production.

    requirements.txt
    fastapi
    uvicorn[standard]
  2. Deploy on Seenode

    Follow these steps to deploy your FastAPI application:

    1. From the Seenode Dashboard, create a new Web Service and connect the Git repository for your FastAPI application.
    2. 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
    3. Choose your preferred instance size and click Create Web Service.
    4. Watch your deployment progress in real-time through the Logs tab.
    5. Once complete, your API will be live and accessible at your service’s public URL.

Now that your API is live, here are some recommended next steps: