Prerequisites
Everything you need before installing, with where to get it. Budget ~30 minutes the first time, most of it in the Discord developer portal.
1. Discord server (guild)
Use your org's existing Discord or create one. You need Manage Server on it. Enable Developer Mode (User Settings → Advanced), then right-click the server icon → Copy Server ID — that's your DISCORD_GUILD_ID.
2. Discord application + bot
At discord.com/developers/applications → New Application. Then:
- Bot tab → Add Bot. Copy the token →
DISCORD_BOT_TOKEN(treat it like a password). Enable Server Members Intent. - OAuth2 tab → copy Client ID →
DISCORD_CLIENT_IDand Client Secret →DISCORD_CLIENT_SECRET. - Under Redirects add your callback:
http://localhost:8080/auth/callback(dev) or yourhttps://domain (prod). It must matchDISCORD_OAUTH_REDIRECT_URIexactly.
bot + applications.commands, and permissions Manage Roles + Manage Channels. Then, crucially, in Server Settings → Roles drag the bot's own role above every role it will manage — Discord forbids a bot from editing roles above its own.3. PostgreSQL 13+
Pick one:
- Docker (easiest) — the bundled compose file runs Postgres for you; nothing to install now.
- Managed Postgres (Neon, Supabase, RDS, a home server) — create a DB + an owning role; grab the connection string for
DATABASE_URL. - Local install — install Postgres, then
createdb orgplatform.
4. Runtime: Docker or Rust
- Docker + Docker Compose (recommended) — the supported deployment path.
- Bare metal — Rust stable (pinned by rust-toolchain.toml) plus sqlx-cli:
cargo install sqlx-cli --no-default-features --features rustls,postgres.
5. Session secret
The web server signs session cookies with SESSION_SECRET — 32+ random bytes, base64 (use ≥ 64 so sessions survive restarts):
openssl rand -base64 48
6. (Production) Domain + TLS
OAuth redirects must be https:// in production. Put the server behind a TLS-terminating reverse proxy (Caddy is the least effort) and point DISCORD_OAUTH_REDIRECT_URI + the reachable host at your domain, then register that exact redirect in the Discord app.
Next: Installation.