MongoDB
MongoDB is IntelliAsk's primary datastore (users, conversations, messages). Its MONGO_* keys in config/.env, the auth bootstrap, storage, backup basics, and links to the official MongoDB docs.
MongoDB is IntelliAsk's primary datastore — users, conversations, messages,
agents, and prompts all live here. The main app connects with MONGO_URI, and the
Prometheus Exporter reads the same database
to produce usage metrics.
Overview
| Compose file | config/mongodb.compose.yml |
| Service name | mongodb |
| Image variable | MONGO_IMAGE (e.g. mongo:8.0.17) |
| Exposed | internal only — never publish Mongo |
| Data | bind-mounted at ${STORAGE_ROOT}/mongodb → /data/db |
Environment variables
MongoDB's settings use the MONGO_ prefix in config/.env:
| Variable | Default | What it does |
|---|---|---|
MONGO_IMAGE | mongo:8.0.17 | Image + tag to run. |
MONGO_CPUS | 1.0 | CPU ceiling. |
MONGO_MEMORY | 512m | Memory ceiling. |
MONGO_ROOT_USERNAME | intelliask | Root user, bootstrapped on first start. |
MONGO_ROOT_PASSWORD | (secret) | Root password — generated on first provision. |
MONGO_URI | mongodb://…@mongodb:27017/IntelliAsk?authSource=admin | Connection string the app uses. |
Auth bootstrap happens once
MONGO_ROOT_USERNAME / MONGO_ROOT_PASSWORD are applied only on the first start
with an empty data volume (MONGO_INITDB_ROOT_*). Changing them later does not
re-create the user — you'd have to rotate it inside Mongo or wipe the volume. Never
expose Mongo outside the Compose network.
After editing any MONGO_* value, apply with:
Storage & backup
Data is bind-mounted on the host at ${STORAGE_ROOT}/mongodb, so it survives
container recreation. The simplest way to back up is the stack-wide command, which
dumps MongoDB (and Postgres) plus the config in one step:
See Backup & restore for rotation
and scheduling. To dump MongoDB on its own, use mongodump against the container:
Restore with the matching mongorestore --archive=…. For point-in-time or scheduled
backups, see the official guide below.
Resource limits
The defaults (MONGO_CPUS=1.0, MONGO_MEMORY=512m) suit a small instance. Mongo's
WiredTiger cache grows with available RAM — raise MONGO_MEMORY on busy or large
deployments and keep an eye on docker stats.
Updating MongoDB
Mind major-version upgrades
Stay on a supported upgrade path — don't jump multiple major versions at once. Review the upstream release notes and back up first. The on-disk format is forward-compatible within a major series but not across big jumps.
Official documentation
Last updated on