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:
docker run -d -p 9000:9000 -v dbcraft_data:/app/data --name dbcraft krishcdbry/dbcraft:v0.8.1-mcpThen open http://localhost:9000 and register. There is no default login: the first account becomes the organization admin.
Step-by-Step Installation
Pull the Docker Image
Download the current release from Docker Hub:
docker pull krishcdbry/dbcraft:v0.8.1-mcpPin 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.
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_dataGenerate Your Keys
Write the JWT secret and encryption key to an env file so they never land in your shell history:
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.envDBCRAFT__SECURITY__ENCRYPTION_KEY. If the key is lost or changed, every stored credential becomes unrecoverable and each data source has to be re-entered.Run the Container
Start DBCraft with the following command:
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-mcpCommand 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, updateDBCRAFT__SERVER__BASE_URLto match-v dbcraft_data:/app/dataMount the data volume for persistence--env-file dbcraft.envLoad the keys and base URL from step 3
Verify Installation
Check that DBCraft is running and reports its version:
docker ps | grep dbcraft
curl -s http://localhost:9000/healthView logs if needed:
docker logs -f dbcraftEnvironment 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.
| Variable | Default | Description |
|---|---|---|
DBCRAFT__SERVER__PORT | 9000 | Server port inside the container |
DBCRAFT__SERVER__BASE_URL | http://localhost:9000 | Public 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.db | SQLite metadata database, the only metadata store. Keep it on the data volume |
DBCRAFT__AUTH__JWT_SECRET | generated, persisted | Signs session tokens. Use 32+ random characters |
DBCRAFT__SECURITY__ENCRYPTION_KEY | generated, persisted | Encrypts stored data source credentials and AI keys (AES-256-GCM). Back it up |
DBCRAFT__AUTH__ALLOW_REGISTRATION | false | Allow self-service sign-up after the first admin exists |
DBCRAFT__QUERY__READ_ONLY_MODE | true | Reject INSERT, UPDATE, DELETE, and DDL against connected databases |
DBCRAFT__QUERY__DEFAULT_LIMIT | 10000 | Rows returned when a query does not set a limit |
DBCRAFT__QUERY__MAX_LIMIT | 100000 | Hard ceiling on rows per query |
DBCRAFT__QUERY__DEFAULT_TIMEOUT_MS | 30000 | Default query deadline in milliseconds |
DBCRAFT__QUERY__MAX_TIMEOUT_MS | 300000 | Longest deadline a query may request |
DBCRAFT__SECURITY__CORS_ALLOWED_ORIGINS | empty (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_LOG | info | Log level (error, warn, info, debug, trace) |
/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
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./app/data. It holds the SQLite metadata database, which is the only metadata store, so back it up like any other database.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.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:
# 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-mcpYour data is preserved in the dbcraft_data volume.
JWT_SECRET or ENCRYPTION_KEY without the prefix, they were never read: switch to the DBCRAFT__ names.