- Create a FastAPI app
- main.py
- Test and freeze
- Push, launch, configure
- Flask instead
- Go live on your domain
- Long jobs and bots
1. Create a FastAPI app
mkdir my-api && cd my-api
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install fastapi "uvicorn[standard]" gunicorn2. main.py
from fastapi import FastAPI
app = FastAPI()
@app.get('/')
def home():
return {'message': 'Hello from Cloud Ninza'}3. Test and freeze
uvicorn main:app --reload # http://127.0.0.1:8000/docs
pip freeze > requirements.txt4. Push, launch, configure
Push to GitHub. Launch an app → Python → plan → domain. App settings → Framework FastAPI / Starlette (ASGI) — the start command is gunicorn main:app -k uvicorn.workers.UvicornWorker …, so the file must be main.py and the object app. Add variables, Save all, connect Git deployments and Deploy now.
Flask instead
Name the file app.py with app = Flask(__name__), install flask gunicorn, freeze requirements, and choose the Flask preset (start gunicorn app:app …).
from flask import Flask
app = Flask(__name__)
@app.get('/')
def home():
return 'Hello from Cloud Ninza'Go live on your domain
Point the domain's @ and www A records to the IP shown in Domains, wait for Points here, then Issue free SSL → Always use HTTPS → Save changes.
Long jobs and bots
Requests should finish in seconds. For a Telegram/Discord bot or a script that runs on its own, choose the Python script / bot preset; for scheduled work use Cron jobs.
Stuck? Our engineers answer support tickets around the clock. Contact us, or create an account and open a ticket from the dashboard — the same guides are there too.