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 8080:8080 \
-e DBB_DSN="postgres://user:pass@host:5432/dbbat" \
-e DBB_KEY="your-base64-encoded-key" \
ghcr.io/fclairamb/dbbat

Environment Variables

VariableDescriptionRequired
DBB_DSNPostgreSQL DSN for DBBat storageYes
DBB_KEYBase64-encoded AES-256 encryption keyOne of KEY/KEYFILE
DBB_KEYFILEPath to file containing encryption keyOne of KEY/KEYFILE
DBB_LISTEN_PGProxy listen address (default: :5434)No
DBB_LISTEN_APIREST API listen address (default: :8080)No

Generating an Encryption Key

Generate a secure 32-byte key:

openssl rand -base64 32

Exposed Ports

  • 5434: PostgreSQL proxy port
  • 8080: REST API port

Volumes

For persistent key storage, mount a volume:

docker run -d \
--name dbbat \
-p 5434:5434 \
-p 8080:8080 \
-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

Health Check

DBBat exposes a health endpoint:

curl http://localhost:8080/api/health

Next Steps