Where do I deploy a Python FastAPI API I built with AI?

Dongee Live doesn't run Python, so you deploy a FastAPI API built with AI on Dongee Cloud or Cloud On Demand, with root SSH, Docker Compose, Nginx in front and HTTPS via certbot.

Deploy FastAPI API projects built with AI on a Dongee Cloud server or on Cloud On Demand. There you get root SSH access and can use Docker and Docker Compose without restrictions. Dongee Live, Dongee's hosting for AI-built apps, doesn't run Python (only static sites and Node), so Live only works if your API is written in Node.

Below is the full recipe, from an empty server to an API running over HTTPS.

Updated November 21, 2026 · Dongee Team

Why can't I deploy FastAPI on Dongee Live?

Dongee Live is designed for apps built with ChatGPT, Lovable, Bolt, v0, Claude Code, Cursor or VS Code. It supports static sites and Node 20, 22 and 24 (Express, Fastify, Koa, Hono, Next.js standalone, TanStack Start). It doesn't support Python, Ruby, PHP or Docker. If the AI generated a FastAPI backend for you, you need a server where you control the environment: that's Dongee Cloud.

Dongee Cloud is self-managed: you administer the server, but you have 24/7 human support in your language (the platform translates on the fly) by chat and WhatsApp if something doesn't add up.

Which Dongee option fits each API?

API typeDongee optionEntry priceWho manages it
FastAPI / Python, steady loadDongee Cloud (Cloud 1 or Cloud 2)17 USD/month (Cloud 1) or 34 USD/month (Cloud 2)You (root, Docker)
FastAPI / Python, custom resources or variable loadCloud On DemandFrom 17 USD/monthYou (root, Docker)
Node / Express, Fastify, HonoDongee Live0 USD (Live Free), 15 USD (Live Pro)Dongee maintains the system, web server and HTTPS

With Cloud On Demand you pick each resource individually: 6 USD per vCPU, 3 USD per GB of RAM and 0.3 USD per GB of SSD storage, with a 17 USD/month minimum. It includes automatic backups and disaster recovery at no extra cost.

How do I deploy my FastAPI API step by step?

  1. Create the server. For a small API, Cloud 1 (1 CPU, 1 GB RAM, 25 GB SSD) is enough. If you'll run a database on the same server, Cloud 2 (1 CPU, 2 GB) is better. Choose the location closest to your users: Atlanta, Miami, New York, Dallas, Mexico, São Paulo, Santiago, Frankfurt, Madrid, London or Amsterdam. Deployment takes under 3 minutes.
  2. Connect over SSH. If you've never done it, follow the guide to connect over SSH to your Cloud server from Windows or Mac.
  3. Install Docker and Docker Compose. On Ubuntu:
sudo apt update
sudo apt install -y docker.io docker-compose-v2 nginx
sudo systemctl enable --now docker
  1. Upload your code with git clone from GitHub or with scp. Make sure there's a requirements.txt with fastapi, uvicorn and gunicorn.
  2. Create a minimal Dockerfile:
FROM python:3.12-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
CMD ["gunicorn", "main:app", "-k", "uvicorn.workers.UvicornWorker", "-w", "2", "-b", "0.0.0.0:8000"]

For a quick test, uvicorn main:app --host 0.0.0.0 --port 8000 works. In production, use several workers, with uvicorn --workers 2 or with gunicorn as above. A practical rule is one worker per CPU, plus one.

  1. Define the docker-compose.yml with the API and, if you need it, the database:
services:
  api:
    build: .
    env_file: .env
    ports:
      - "127.0.0.1:8000:8000"
    restart: unless-stopped
    depends_on:
      - db
  db:
    image: postgres:16
    env_file: .env
    environment:
      - PGDATA=/data/pgdata
    volumes:
      - dbdata:/data
    restart: unless-stopped
volumes:
  dbdata:

Note the 127.0.0.1:8000:8000: the port is published only on the server itself, not to the internet. The pattern is the same as in the guide to installing n8n with Docker Compose on a Cloud server.

  1. Store your variables in a .env file (API keys, DATABASE_URL, passwords) and add it to .gitignore so it never reaches the repository. Then start the containers:
docker compose up -d --build
docker compose logs -f api
  1. Put Nginx in front as a reverse proxy. Create a file named api.conf in Nginx's sites folder with this block:
server {
    listen 80;
    server_name api.yourdomain.com;
    location / {
        proxy_pass http://127.0.0.1:8000;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

Validate and reload with sudo nginx -t && sudo systemctl reload nginx. Before that, point an A record for your domain to the server's dedicated IP.

  1. Enable HTTPS with certbot:
sudo apt install -y certbot python3-certbot-nginx
sudo certbot --nginx -d api.yourdomain.com

Certbot edits the Nginx block and schedules automatic certificate renewal.

  1. Take a snapshot before each update and scale as you grow. All Cloud plans include incremental snapshots and disk backup. If something goes wrong after a git pull and docker compose up -d --build, you roll back. When the API needs more power, you can scale your Cloud server's CPU and RAM without rebooting or migrating.

What mistakes are common when deploying AI-built FastAPI?

  • Binding to 127.0.0.1 inside the container. Many AI-generated examples use --host 127.0.0.1. Inside Docker, that makes the API unreachable, even for Nginx. Inside the container use 0.0.0.0, and limit exposure in the compose file's ports.
  • Open or misconfigured CORS. allow_origins=["*"] together with credentials is a bad idea. Declare only your frontend's domains in CORSMiddleware.
  • Port 8000 open to the internet without a proxy. If you publish "8000:8000", the API is exposed without HTTPS. Keep in mind that Docker can bypass the system firewall rules. Publish on 127.0.0.1 and let Nginx be the only way in.
  • Using --reload in production. It's meant for development: it burns resources watching files and doesn't support multiple workers.
  • Keys in the repository. If the AI wrote your database or model key directly in main.py, move it to .env and rotate the key. Any key that reached GitHub should be considered leaked.
  • No restart after crashes. Without restart: unless-stopped, a failure or a server reboot leaves the API down.

Frequently asked questions

Can I deploy FastAPI on Dongee Live if I turn it into a static site?

No. An API needs a running process, and Live only runs static sites and Node apps. If your frontend is static or Node, you can publish it on Live and have it call the FastAPI API running on Dongee Cloud.

How much does it cost to deploy a FastAPI API on Dongee?

Cloud 1 costs 17 USD/month and Cloud 2, 34 USD/month. Cloud On Demand starts at 17 USD/month and is calculated by vCPU, RAM and disk. You can pay in COP, USD, EUR, MXN, PEN, CLP or BRL.

Do I need to know how to manage servers?

Somewhat, yes: Dongee Cloud is self-managed, and you install and maintain Docker, Nginx and the system. If you get stuck, 24/7 human support helps you review it, and you can also request assisted migration.

Can I use Supabase or another external database instead of a local one?

Yes. Remove the db service from the compose file and put the external connection string in .env. That way the server carries less load and Cloud 1 may be enough.

What do I do if my API grows and needs several servers?

First, scale CPU and RAM without rebooting. If you later need several instances, you can connect them over the private network at no cost and set up your own load balancer with Nginx or HAProxy. Dongee doesn't sell a managed load balancer.

In short: if your API is FastAPI, it goes on Dongee Cloud or Cloud On Demand, with Docker Compose, Nginx in front and HTTPS via certbot. If it's Node, Dongee Live saves you all that server work.

Comenta lo que quieras

Unete a la charla
Solo ingresa tu email