Install the CLI
FastDeploy is a single binary. No Python dependencies, no package manager required.
curl -sSL https://fastdeploy.app/install.sh | sh
The install script detects your OS and architecture and places the binary in a directory on your PATH. If you prefer, you can download a build manually.
Verify the install:
fastdeploy version
Your first app
Create a project directory and scaffold a starter app. FastDeploy supports FastAPI and FastHTML.
mkdir hello-api && cd hello-api && fastdeploy init
The interactive prompt asks for your framework (default is FastAPI). It creates two files:
app.py— your application entrypoint.fastdeploy.yaml— project metadata and settings
Non-interactive version:
fastdeploy init -f fastapi -n hello-api
Local development
Run your app locally with hot reload:
fastdeploy dev
This starts uvicorn on http://localhost:8000. Requirements:
- uvicorn must be installed in your environment (
pip install uvicorn) - If your code uses MongoDB, Docker must be running. A local MongoDB container is started automatically and cleaned up when you stop.
If Docker is not available, fastdeploy dev warns you and continues without MongoDB. You can also set PLATFORM_MONGO_URI manually to point to your own database.
Deploy to production
Before deploying, authenticate with the platform:
fastdeploy auth login https://platform.fastdeploy.app
This opens a browser for signup or login and stores a JWT token in ~/.fastdeploy/config.toml. If you are self-hosting, replace the URL with your own platform address.
Now deploy:
fastdeploy deploy
The CLI packages your files, sends them to the platform, and polls the deployment status. When ready, it prints your live URL and a link to the auto-generated API docs (/docs for FastAPI).
Block until healthy (useful in CI):
fastdeploy deploy --wait
Apps vs Functions
FastDeploy has two deployment models. Choose the one that fits your workload.
Apps (Full applications)
Use this for FastAPI or FastHTML projects with multiple routes, middleware, and static files.
- Entrypoint is
app.py(or whatever you set in.fastdeploy.yaml) - Must expose
app = FastAPI()orapp, rt = fast_app() - Supports multiple files, static assets, and the full Platform SDK
- Deployed as a long-running Kubernetes pod with auto-generated ingress
Functions (Serverless handlers)
Use this for lightweight HTTP endpoints or scheduled cron jobs.
- Entrypoint is
handler.py - Must expose
def handle(...) - HTTP functions receive POST body fields as keyword arguments
- Cron functions run on a schedule you define at deploy time
Scaffold a function:
mkdir my-fn && cd my-fn && fastdeploy functions init
Deploy as a cron job:
fastdeploy functions deploy --schedule "0 9 * * *"
.fastdeploy.yaml reference
This file lives in your project root and tells FastDeploy how to build and run your code.
name: my-api
entrypoint: app.py
env:
API_KEY: "sk-live-..."
WEBHOOK_URL: "${WEBHOOK_URL}" # resolves from local env at deploy time
database: true
schedule: "*/5 * * * *" # for functions only
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | App or function name. Must be unique to your account. |
entrypoint | string | no | Main file. Default is app.py for apps, handler.py for functions. |
env | map | no | Environment variables. Values wrapped in ${...} are resolved from your local shell at deploy time. |
database | bool | no | Set to true to auto-provision a MongoDB database for this app. |
schedule | string | no | Cron expression for scheduled functions (e.g. */5 * * * *). |
Platform SDK
Every deployed app has the Platform SDK pre-installed. Import modules directly—no pip install needed.
Database
from platform_db import db, Collection
users = Collection("users")
users.create({"name": "Dan", "role": "admin"})
user = users.find_one(name="Dan")
# Or use raw pymongo
db.orders.insert_one({"total": 100})
Authentication
from platform_auth import Auth
auth = Auth(first_user_is_admin=True)
# FastHTML
app, rt = fast_app(before=auth.beforeware(skip=["/login", "/signup"]))
# FastAPI
user = auth.login(username, password)
token = auth.create_session(user["id"])
File Storage
from platform_storage import Storage
storage = Storage()
file_id = storage.put("report.pdf", pdf_bytes, "application/pdf")
info = storage.get(file_id)
storage.serve_route(rt) # registers GET /files/{file_id}
Cache
from platform_cache import Cache
cache = Cache()
cache.set("user:123", {"name": "Alice"}, ttl=300)
user = cache.get("user:123")
@cache.cached(ttl=60)
def get_user(user_id):
return db.users.find_one({"_id": user_id})
Key-Value Store
from platform_kv import KV
kv = KV()
kv.set("feature_flag", True)
kv.get("feature_flag", default=False)
kv.keys(prefix="flag:")
Queue
from platform_queue import Queue
queue = Queue()
@queue.task(max_retries=3)
def send_email(to, subject):
# ... send email ...
return {"sent": True}
# Enqueue from a request handler
send_email.enqueue(to="[email protected]", subject="Hello")
HTTP Client
from platform_http import http, ahttp
# Sync
resp = http.get("https://api.example.com/data")
# Async (FastAPI)
resp = await ahttp.get("https://api.example.com/data", cache_ttl=300)
Run fastdeploy sdk list and fastdeploy sdk docs <module> (requires auth) for full module documentation.
What gets deployed
When you run fastdeploy deploy, the CLI walks your project directory and uploads matching files.
Allowed file types
.py,.css,.js,.svg,.html,.json,.txt
Files with other extensions are silently ignored. If you need a data file, convert it to JSON or include it as a Python module.
Ignored files and directories
- Hidden files and directories (anything starting with
.) __pycache__,.venv,node_modules
Drafts vs deploys
fastdeploy push— uploads code as a draft without creating a new deployment. Use this to save work in progress.fastdeploy deploy— uploads code and triggers a full build and rollout.
Troubleshooting
"uvicorn not found" when running fastdeploy dev
Install uvicorn in your active Python environment:
pip install uvicorn
"Not authenticated" when running deploy or templates
Run fastdeploy auth login <platform-url> first. If you are using the public platform, the URL is https://platform.fastdeploy.app. For self-hosted instances, use your own domain.
Deploy times out or shows "error"
Check recent logs:
fastdeploy logs --no-follow -n 50
Common causes: syntax error in app.py, missing app variable, or using a forbidden import. The platform validates code on deploy and rejects calls to eval, exec, subprocess, os.system, etc.
My static files are not showing up
Check the extension. Only .css, .js, .svg, .html, .json, and .txt are uploaded. Files in hidden directories are also skipped.
How do I update an existing app?
Make your changes and run fastdeploy deploy again. The CLI detects the existing app and updates it. Up to 10 previous versions are kept; you can rollback with fastdeploy rollback if something breaks.
How do I pull code from the platform?
fastdeploy pull my-app
Add -f to overwrite existing local files.