Docker Installation

The fastest way to deploy DBCraft. One container serves the web app, the REST API, and the MCP endpoint on port 9000.

Quick Start

Get DBCraft running with a single command:

Terminal
docker run -d -p 9000:9000 -v dbcraft_data:/app/data --name dbcraft krishcdbry/dbcraft:v0.8.1-mcp

Then open http://localhost:9000 and register. There is no default login: the first account becomes the organization admin.

Step-by-Step Installation

1

Pull the Docker Image

Download the current release from Docker Hub:

docker pull krishcdbry/dbcraft:v0.8.1-mcp

Pin a version tag rather than latest so you upgrade on purpose. Some upgrades, such as v0.8.0, cannot be rolled back without a backup of your data volume.

2

Create a Data Volume

Create a Docker volume for the metadata database (dashboards, queries, users, settings) and the server's keys:

docker volume create dbcraft_data
3

Generate Your Keys

Write the JWT secret and encryption key to an env file so they never land in your shell history:

Terminal
cat > dbcraft.env <<EOF
DBCRAFT__AUTH__JWT_SECRET=$(openssl rand -base64 48)
DBCRAFT__SECURITY__ENCRYPTION_KEY=$(openssl rand -base64 48)
DBCRAFT__SERVER__BASE_URL=http://localhost:9000
EOF
chmod 600 dbcraft.env
Back up the encryption key
Data source credentials are encrypted with DBCRAFT__SECURITY__ENCRYPTION_KEY. If the key is lost or changed, every stored credential becomes unrecoverable and each data source has to be re-entered.
4

Run the Container

Start DBCraft with the following command:

Terminal
docker run -d \
  --name dbcraft \
  --restart unless-stopped \
  -p 9000:9000 \
  -v dbcraft_data:/app/data \
  --env-file dbcraft.env \
  krishcdbry/dbcraft:v0.8.1-mcp

Command breakdown:

  • -dRun in detached mode (background)
  • --name dbcraftGive the container a friendly name
  • --restart unless-stoppedAuto-restart on failure or system reboot
  • -p 9000:9000Map host port 9000 to container port 9000. If you map a different host port, update DBCRAFT__SERVER__BASE_URL to match
  • -v dbcraft_data:/app/dataMount the data volume for persistence
  • --env-file dbcraft.envLoad the keys and base URL from step 3
5

Verify Installation

Check that DBCraft is running and reports its version:

docker ps | grep dbcraft
curl -s http://localhost:9000/health

View logs if needed:

docker logs -f dbcraft

Environment Variables

Every setting uses the DBCRAFT__ prefix, with a double underscore between section and key. Unprefixed names such as JWT_SECRET, PORT, or DATABASE_URL are ignored.

VariableDefaultDescription
DBCRAFT__SERVER__PORT9000Server port inside the container
DBCRAFT__SERVER__BASE_URLhttp://localhost:9000Public URL. Drives OAuth and MCP discovery, links, and the Secure cookie flag. Set it to your https URL in production
DBCRAFT__DATABASE__PATH/app/data/dbcraft.dbSQLite metadata database, the only metadata store. Keep it on the data volume
DBCRAFT__AUTH__JWT_SECRETgenerated, persistedSigns session tokens. Use 32+ random characters
DBCRAFT__SECURITY__ENCRYPTION_KEYgenerated, persistedEncrypts stored data source credentials and AI keys (AES-256-GCM). Back it up
DBCRAFT__AUTH__ALLOW_REGISTRATIONfalseAllow self-service sign-up after the first admin exists
DBCRAFT__QUERY__READ_ONLY_MODEtrueReject INSERT, UPDATE, DELETE, and DDL against connected databases
DBCRAFT__QUERY__DEFAULT_LIMIT10000Rows returned when a query does not set a limit
DBCRAFT__QUERY__MAX_LIMIT100000Hard ceiling on rows per query
DBCRAFT__QUERY__DEFAULT_TIMEOUT_MS30000Default query deadline in milliseconds
DBCRAFT__QUERY__MAX_TIMEOUT_MS300000Longest deadline a query may request
DBCRAFT__SECURITY__CORS_ALLOWED_ORIGINSempty (same-origin)Comma-separated extra origins allowed to call the API
DBCRAFT__SECURITY__FRAME_ANCESTORS'self'CSP frame-ancestors value. Widen it to embed dashboards in another site
RUST_LOGinfoLog level (error, warn, info, debug, trace)
What happens if the keys are unset
DBCraft generates both keys on first boot and saves them to /app/data/.dbcraft_secrets.json (mode 0600), then reuses them on every restart. That only works while /app/data is a persistent volume. Without one, every restart signs everyone out and strands your stored credentials.

Production Recommendations

Security
Set DBCRAFT__AUTH__JWT_SECRET and DBCRAFT__SECURITY__ENCRYPTION_KEY explicitly from a secret manager, at least 32 random characters each, and keep a backup of the encryption key.
Persistence
Use a named volume or bind mount for /app/data. It holds the SQLite metadata database, which is the only metadata store, so back it up like any other database.
HTTPS
Put DBCraft behind a reverse proxy like Nginx, Caddy, or Traefik and set DBCRAFT__SERVER__BASE_URL to the https URL. Secure cookies, HSTS, and MCP/OAuth discovery all follow it. See the Kubernetes guide for a hardened production example.
Users
Self-registration is closed after the first admin. Invite teammates from the Organization page, or set DBCRAFT__AUTH__ALLOW_REGISTRATION=true only if anyone who can reach the URL should be able to join your organization.

Upgrading

Back up the volume, then replace the container with the new tag:

Terminal
# Back up the data volume
docker run --rm -v dbcraft_data:/data -v "$PWD":/backup busybox \
  tar czf /backup/dbcraft-data-backup.tgz -C /data .

# Stop and remove the old container
docker stop dbcraft
docker rm dbcraft

# Pull the new image
docker pull krishcdbry/dbcraft:v0.8.1-mcp

# Start with the same volume and env file
docker run -d \
  --name dbcraft \
  --restart unless-stopped \
  -p 9000:9000 \
  -v dbcraft_data:/app/data \
  --env-file dbcraft.env \
  krishcdbry/dbcraft:v0.8.1-mcp

Your data is preserved in the dbcraft_data volume.

Upgrading from a version before 0.8.0
On first boot, 0.8.x re-encrypts stored data source credentials with AES-256-GCM. Older images cannot read them, so rolling back below 0.8.0 means restoring the backup. If you previously set JWT_SECRET or ENCRYPTION_KEY without the prefix, they were never read: switch to the DBCRAFT__ names.

Next Steps