Deploy FastAPI in minutes

FastAPI deploys on Darmi Cloud through the Dockerfile preset. Add the Dockerfile below to your repo, pick the Dockerfile preset, and the platform builds the image and runs uvicorn behind automatic HTTPS.

Deploy from GitHub Automatic HTTPS subdomain Live build & runtime logs
Step by step

How to deploy FastAPI

Darmi Cloud doesn't have a dedicated FastAPI preset yet — but the Dockerfile preset gets you deployed just as fast.

  1. 1

    Add a Dockerfile to your repo

    Commit the Dockerfile below to the root of your FastAPI repository. Darmi Cloud will build the image from it.

  2. 2

    Sign in with GitHub

    Open darmicloud.tech and sign in with GitHub (or Google). On first sign-in you grant read access so the deploy worker can clone your repositories.

  3. 3

    Import your repository

    Click New Project, pick your FastAPI repository, and choose the branch to deploy — the default branch is preselected.

  4. 4

    Select the Dockerfile preset

    Choose the Dockerfile preset so Darmi Cloud builds and runs the image from your committed Dockerfile. Set the container port to 8000.

  5. 5

    Add environment variables

    Add any environment variables your app needs (database URLs, API keys, secrets). Mark sensitive values as secrets — they are injected into the container and hidden in the UI afterwards.

  6. 6

    Deploy and watch it go live

    Click Deploy. Watch the live build and runtime logs, and your app goes live on an automatic HTTPS subdomain. Every push to your branch redeploys automatically.

Dockerfile for FastAPI

Copy this into a file named Dockerfile at the root of your repository.

# syntax=docker/dockerfile:1
FROM python:3.12-slim

WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt "uvicorn[standard]"
COPY . .

ENV PORT=8000
EXPOSE 8000
# Replace "main:app" with "<module>:<FastAPI instance>"
CMD ["sh", "-c", "uvicorn main:app --host 0.0.0.0 --port $PORT"]

Tips for FastAPI on Darmi Cloud

  • Change main:app to your module and FastAPI instance name.
  • For higher throughput, run uvicorn with --workers or put it behind gunicorn with the uvicorn worker class.
  • Your interactive docs stay available at /docs on your deployed subdomain.
FAQ

FastAPI deployment FAQ

Does Darmi Cloud have a native FastAPI preset?

Not yet — deploy FastAPI with the Dockerfile preset using the uvicorn-based Dockerfile above. It builds and runs in minutes.

How do I serve FastAPI in production?

Run it with uvicorn (optionally behind gunicorn using uvicorn workers), binding to 0.0.0.0 and reading the port from the environment, as shown in the Dockerfile.

Can I use my own custom domain?

Yes. Connect an existing domain or buy one inside Darmi Cloud. DNS is configured automatically and every domain gets free SSL via Let's Encrypt.

Is there a free plan?

Yes. The Free plan deploys one project on an automatic HTTPS subdomain with auto-deploy on every push. Paid plans add custom domains, PR preview deployments and more projects.

Deploy other frameworks

Ready to deploy your FastAPI app?

Connect GitHub and ship in minutes — on a free HTTPS subdomain, or on your own custom domain.

Deploy FastAPI now