Deploy Mango Agent
Pick a server setup for the backend and panel, put the widget and website on Cloudflare, and you're live. For internal use it can cost almost nothing.
- Any VM
Full control on a provider you already use
- $6–12 / month (free on GCP e2-micro)
- You run updates and backups
- Needs a key in GOOGLE_CREDENTIALS_JSON (none on GCP)
- Google Cloud
Internal use for almost nothing, with push working out of the box
- $0–4 / month on the free e2-micro
- You run updates; nightly backups go to R2
- Built in: the VM runs as the service account (PUSH_PROVIDER=fcm)
- Railway
The least server work, with deploys on every push
- $5–10 / month (Hobby plan)
- Almost none
- Needs a key in GOOGLE_CREDENTIALS_JSON
What gets deployed where#
Mango Agent has four parts. The backend (FastAPI API, WebSockets and the background worker in one process) and the panel (Next.js inbox and admin) run together on a server. The widget (mango.js) and this website are static files that belong on a CDN such as Cloudflare. The backend needs Postgres with pgvector, Redis and an S3-compatible bucket for screenshots.
The backend has to stay running: it holds WebSocket connections open, and its worker delivers push notifications, unclaimed-handoff fallbacks and weekly reports. The worker is safe on several instances, because jobs are claimed with SKIP LOCKED and the hourly job takes a Redis lock.
Choose a setup#
| Setup | Rough monthly cost | Server work | Good for |
|---|---|---|---|
| Free GCP VM (e2-micro) + Docker Compose | $0–4 | You run updates and backups | Internal use on a budget; push works with no key file |
| Any VM: DigitalOcean, Hetzner, Lightsail… | $6–12 | You run updates and backups | Same, on a provider you already use |
| Railway | $5–10 | Almost none | Least maintenance, deploys on every push |
| Cloud Run (managed GCP) | $45+ | None | Autoscaling for real traffic |
daily_token_budget.Measured footprint of the production stack: backend about 185 MB of RAM, panel 95 MB, Postgres 40 MB, Caddy 60 MB, Redis 4 MB. A 1 GB server is enough for internal use.
Push notifications need a Google identity#
Phone push goes through Firebase Cloud Messaging, which needs a Google service account. On GCP (a VM or Cloud Run), attach the service account to the machine and set PUSH_PROVIDER=fcm: nothing to store, nothing expires. Elsewhere, paste a service-account key into GOOGLE_CREDENTIALS_JSON (base64). If your Google organization forbids key files, that's a reason to prefer GCP.
Widget and website on Cloudflare#
npx wrangler@4 login # once
deploy/cloudflare/deploy-widget.sh # build, check the 40 KB budget, deploypnpm deploy:cloudflare # static export to out/ and wrangler deployBoth are served as static assets from Cloudflare's CDN. The widget files are cached for 5 minutes, so updates reach every site quickly. With a custom domain, the embed tag becomes:
<script src="https://cdn.<domain>/mango.js" data-project="pk_…" data-api="https://api.<domain>" async></script>After the first deploy#
- Load a seed with your email as owner. Sign-in is invite-only, so the first owner comes from a seed file.
- Sign in at
https://app.<domain>with Google, or with First time? Set a password. - Add the team under Members, giving each person project access, and add projects. Copy each project's embed tag from its Embed card.
- Press Send test in the inbox header to check push.