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. Get the code
Section titled “1. Get the code”git clone https://github.com/Bredrumb/TomoriBot.gitcd TomoriBot2. Required .env values
Section titled “2. 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, so set it yourself
(any 32-character string). Optional tuning values can be copied from
.env.optional.example.
3. Build and run
Section titled “3. 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 /setup in Discord to add your AI
provider key: see the Quickstart for the in-Discord side.
4. Optional sidecars (Compose profiles)
Section titled “4. 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.