CIRCE / DOCUMENTATION
Deployment overview
The production checklist that applies to every runtime, and how to choose where to run your bot.
On this page
Pick how to run it
| You have | Use | Guide |
|---|---|---|
| A VPS or dedicated server with Node.js | pm2 (or systemd) | Node.js and pm2 |
| A VPS with Bun | systemd or Docker | Bun |
| Deno | Tasks, Docker or Deno Deploy | Deno |
| Containers or Kubernetes | The Docker examples in each guide | Any |
| Serverless | transport: "http" |
Transports |
What every deployment runs
circe start
It loads circe.config.ts, validates the environment, scans and validates modules, logs in, registers commands and routes interactions. On SIGINT or SIGTERM it shuts down gracefully, bounded by shutdownTimeoutMs.
Production checklist
- Validate in CI with
circe build. It needs the environment schema but never connects to Discord. Use--format jsonfor structured output. - Keep secrets out of git. Provide
DISCORD_TOKENand friends through the process environment, a.envfile next to the project (loaded automatically by the CLI), or your platform’s secret store. - Unset
guildIdin production so commands register globally. - Enable health checks:
health: { port }gives/healthfor liveness and/readyfor readiness. - Run exactly one Gateway instance per bot token. Gateway connections are stateful; scaling horizontally is only for
transport: "http". - Let the process exit on crashes. The default
onUnhandledRejection: "exit"is meant to be paired with a supervisor (pm2, systemd, Docker restart policy) that restarts it. - Match the stop timeout. Your supervisor’s kill timeout must be longer than
shutdownTimeoutMs(default 10 s), or it will force-kill the graceful shutdown. - Persist what must survive restarts: cooldowns with
SqliteCooldownStore, pagination sessions with a shared store.
HTTP transport needs HTTPS
Discord only calls an Interactions Endpoint URL over HTTPS. Put Caddy, Nginx or a Cloudflare Tunnel in front of the Circe port and paste the public URL into the Developer Portal.
Troubleshooting
| Symptom | Likely cause |
|---|---|
An invalid token was provided |
The loaded config has no token (see Environment) or the token was reset. |
| Commands do not appear | Missing applications.commands scope when inviting, or global registration still propagating. Set guildId while developing. |
| Restart loop under pm2 | A startup validation error. Run circe doctor and read the first log lines. |
/ready returns 503 |
The gateway is not connected yet, or a named health check is failing. |
