Docker Compose
Docker Compose builds and runs TomoriBot plus PostgreSQL as containers. It’s the third install path alongside the setup wizard and manual setup — pick it when you’d rather run everything in Docker than install Bun and PostgreSQL on the host. It does not use the setup wizard; the database connection is auto-configured for you.
1. Required .env values
Section titled “1. Required .env values”Start from the example file:
cp .env.example .envThen set at minimum:
| Variable | Value |
|---|---|
DISCORD_TOKEN |
Your Discord bot token (enable the GuildMembers, MessageContent, and GuildPresences privileged intents). |
CRYPTO_SECRET |
A 32-character encryption key used to encrypt stored API keys. |
POSTGRES_PASSWORD |
The database password. Every other POSTGRES_* value is auto-configured. |
Unlike the setup wizard, Compose won’t generate CRYPTO_SECRET for you — set it yourself
(any 32-character string). Optional tuning values can be copied from
.env.optional.example.
2. Build and run
Section titled “2. Build and run”docker compose build # first time, or after code/dependency changesdocker compose up # bot + databaseFor later starts, docker compose up alone is enough unless you changed code or
dependencies. When the bot is online, run /config setup in Discord to add your AI
provider key — see the Quickstart for the in-Discord side.
3. Optional sidecars (Compose profiles)
Section titled “3. Optional sidecars (Compose profiles)”Sidecars are opt-in via Compose profiles, so you only run what you need:
# SearXNG (private web search) + Crawl4AI (browser-rendered fetch)docker compose --profile searxng --profile fetch-crawl4ai upSee SearXNG, Crawl4AI, and Local Monitoring for per-sidecar details.
Maintenance, updating & backups
Section titled “Maintenance, updating & backups”Use bun run update --docker for the backup-first update procedure on a Compose
deployment. Backing up and restoring the Compose database (including running host scripts
against it) is covered on the Maintenance & Backups page. Before pulling a
new version, start with Safe Migration.