Deploy the project to FastAPI Cloud with the included GitHub Actions workflow.
Create an application in FastAPI Cloud and set its Application Directory to backend.
Connect a PostgreSQL database using the Neon or Supabase integration. Both integrations configure a DATABASE_URL secret automatically. You can also configure DATABASE_URL manually for another PostgreSQL provider.
Add these required environment variables to the FastAPI Cloud application:
PROJECT_NAME: The name of the project, used in the API documentation and emails.FIRST_SUPERUSER: The email address of the first superuser.FRONTEND_HOST: The public URL of the application, such as the generatedhttps://your-app.fastapicloud.devURL or a custom domain.
To enable emails, add these optional environment variables with values from your email provider:
SMTP_HOSTSMTP_USEREMAILS_FROM_EMAIL
To enable Sentry, configure SENTRY_DSN.
Add these required values and mark them as secrets:
SECRET_KEY: A secret key used to sign security tokens.FIRST_SUPERUSER_PASSWORD: The password of the first superuser.DATABASE_URL: The PostgreSQL connection URL, configured automatically when using a database integration.
To enable emails with an authenticated provider, add SMTP_PASSWORD as a secret.
You can generate secure values for SECRET_KEY and FIRST_SUPERUSER_PASSWORD with:
python -c "import secrets; print(secrets.token_urlsafe(32))"The included .github/workflows/deploy.yml workflow builds the frontend, prepares the database, and deploys the application whenever changes are pushed to master. You can also run it manually from the Actions tab.
Log in to FastAPI Cloud and configure the deploy token and application ID as GitHub repository secrets:
uv run fastapi login
uv run fastapi cloud setup-ci --secrets-only --app-id <your-app-id>If the GitHub CLI is installed and authenticated, the command configures FASTAPI_CLOUD_TOKEN and FASTAPI_CLOUD_APP_ID automatically. Otherwise, it prints the values so you can add them in your repository under Settings > Secrets and variables > Actions.
The workflow runs database migrations and creates the first superuser before deploying. In the repository's Settings > Secrets and variables > Actions page, add these repository variables:
PROJECT_NAMEFIRST_SUPERUSER
Add these repository secrets:
DATABASE_URLSECRET_KEYFIRST_SUPERUSER_PASSWORD
Use the same values configured in FastAPI Cloud. For DATABASE_URL, use the connection URL from your database provider. The database must be reachable from GitHub-hosted runners so the preparation step can connect to it.
The deployment workflow performs these steps:
- Installs and builds the frontend into
backend/app/frontend. - Runs
backend/scripts/prestart.shto apply database migrations and create the first superuser. - Deploys the project with
uv run fastapi deploy.
Replace your-app.fastapicloud.dev with the URL of your FastAPI Cloud application.
Application (frontend and API): https://your-app.fastapicloud.dev
Interactive API docs: https://your-app.fastapicloud.dev/docs
For deployment to your own server, see the Docker Compose deployment guide.
Install the following GitHub Apps to enable the included repository automation:
- Latest Changes updates
release-notes.mdwhen a pull request is merged. - PR Push lets the pre-commit workflow push automated fixes to pull request branches.
- PR Submit lets the Bump pre-commit hooks and Prepare Release workflows create pull requests.
To publish code coverage with Smokeshow, add SMOKESHOW_AUTH_KEY as a repository secret.