Skip to main content

Docker Installation

The easiest way to run DBBat is with Docker.

Quick Start

docker run -d \
--name dbbat \
-p 5434:5434 \
-p 1522:1522 \
-p 3307:3307 \
-p 27018:27018 \
-p 4200:4200 \
-e DBB_DSN="postgres://user:pass@host:5432/dbbat" \
-e DBB_KEY="your-base64-encoded-key" \
ghcr.io/fclairamb/dbbat

The same container exposes all five listeners — PostgreSQL, Oracle, MySQL/MariaDB, MongoDB, and the REST API + web UI. Drop the -p mapping for any proxy you don't need, and disable that listener with the matching DBB_LISTEN_*="" env var.

Environment Variables

Core

VariableDescriptionRequired
DBB_DSNPostgreSQL DSN for DBBat storageYes
DBB_KEYBase64-encoded AES-256 encryption keyOne of KEY/KEYFILE (auto-generated if neither)
DBB_KEYFILEPath to file containing encryption keyOne of KEY/KEYFILE

Listeners

VariableDescriptionDefault
DBB_LISTEN_PGPostgreSQL proxy listen address:5434
DBB_LISTEN_ORAOracle proxy listen address (empty = disabled):1522
DBB_LISTEN_MYSQLMySQL/MariaDB proxy listen address (empty = disabled):3307
DBB_LISTEN_MONGOMongoDB proxy listen address (empty = disabled):27018
DBB_LISTEN_APIREST API + web UI listen address:4200

For the full list (rate limiting, dump capture, MySQL TLS, hashing, Slack OAuth), see Configuration.

Generating an Encryption Key

Generate a secure 32-byte key:

openssl rand -base64 32

If you don't provide one via DBB_KEY or DBB_KEYFILE, DBBat creates one at ~/.dbbat/key (inside the container) on first start. Mount that path as a volume to keep it across restarts.

Exposed Ports

PortPurpose
5434PostgreSQL proxy
1522Oracle proxy
3307MySQL / MariaDB proxy
27018MongoDB proxy
4200REST API + web UI

Volumes

For persistent key storage, mount a volume:

docker run -d \
--name dbbat \
-p 5434:5434 -p 1522:1522 -p 3307:3307 -p 27018:27018 -p 4200:4200 \
-e DBB_DSN="postgres://user:pass@host:5432/dbbat" \
-e DBB_KEYFILE="/keys/dbbat.key" \
-v /path/to/keys:/keys:ro \
ghcr.io/fclairamb/dbbat

To enable session packet dumps:

docker run -d \
--name dbbat \
-p 5434:5434 -p 1522:1522 -p 3307:3307 -p 27018:27018 -p 4200:4200 \
-e DBB_DSN="postgres://user:pass@host:5432/dbbat" \
-e DBB_DUMP_DIR="/var/dbbat/dumps" \
-e DBB_DUMP_RETENTION="72h" \
-v dbbat-dumps:/var/dbbat/dumps \
ghcr.io/fclairamb/dbbat

Health Check

DBBat exposes a health endpoint:

curl http://localhost:4200/api/v1/health

Next Steps