Skip to content

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.

Start from the example file:

Terminal window
cp .env.example .env

Then 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.

Terminal window
docker compose build # first time, or after code/dependency changes
docker compose up # bot + database

For 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.

Sidecars are opt-in via Compose profiles, so you only run what you need:

Terminal window
# SearXNG (private web search) + Crawl4AI (browser-rendered fetch)
docker compose --profile searxng --profile fetch-crawl4ai up

See SearXNG, Crawl4AI, and Local Monitoring for per-sidecar details.

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.