Self-hosting overview
ZAR is a FastAPI application you can run anywhere that gives you a public HTTPS URL for webhooks. The hosted app at app.zarlabs.tech is the zero-setup option; self-hosting gives you full control over data and configuration.Prerequisites
- Python 3.12+ (if running from source).
- A public HTTPS URL for webhooks — Railway, Render, Fly.io, a VM behind nginx/Caddy, or Kubernetes ingress.
- An Anthropic API key (
ANTHROPIC_API_KEY). - GitHub App credentials: App ID, a private key (
.pem), and a webhook secret.
Step 1 — Register a GitHub App
You register your own GitHub App (the hosted ZAR App is separate). The repo ships a manifest to make this one click:- Create a new GitHub App with the permissions and events ZAR needs (the ZAR source ships a
github-app-manifest.ymlyou can register from if you have access to it). - In GitHub: Settings → Developer settings → GitHub Apps → New GitHub App → Register from manifest (or create manually with the same permissions and events).
- Set the Webhook URL to
https://YOUR_DOMAIN/github/webhook. - Generate and download a private key (
.pem). - Note the App ID and set a strong webhook secret.
Step 2 — Configure the environment
At minimum:Step 3 — Run it
From source:Step 4 — Point GitHub at it and verify
- Confirm the GitHub App’s Webhook URL is
https://YOUR_DOMAIN/github/webhook(note the/githubprefix). - Hit
GET /healthz— expect{"ok": true}. - Install the App on a test repo and open a PR, or use the dashboard’s Send test webhook.
Database
- SQLite (the default) is fine for local testing and small loads.
- For production or higher concurrency, use Postgres via
DATABASE_URL=postgresql+asyncpg://…. SQLite can hit “database is locked” under concurrent writes.
Scaling note
ZAR serializes writes per repository with an in-process lock, which prevents duplicate docs PRs on a single instance. If you run multiple replicas, add a shared lock (database advisory lock or Redis) so two replicas don’t process the same repository’s events simultaneously. For most teams a single well-sized instance plus Postgres is plenty.Keeping secrets safe
Never commit.env, the .pem private key, or the SQLite database. See Security.
Next steps
- Railway — managed deploy with Postgres + Redis.
- Docker — container and compose.
- Environment variables — complete configuration.