jamals86/kalamdb

By jamals86

โ€ขUpdated 5 days ago

Embedded SQL database built for AI agents with realtime change feeds.

Image
Message queues
Developer tools
Databases & storage
2

10K+

jamals86/kalamdb repository overview

โ ๐Ÿš€ KalamDB on Docker Hub

KalamDB is a SQL-first realtime backend for agent-native apps. Give AI agents one SQL tool to your app data, while your frontend subscribes to live rows from the same backend.

It combines in one runtime:

  • โšก One SQL API for reads and writes
  • ๐Ÿ”„ Live subscriptions over WebSocket
  • ๐Ÿ“ก Pub/sub streams
  • ๐Ÿ” Built-in auth with JWT support
  • ๐Ÿงฑ Per-user isolation with policy-scoped access
  • ๐Ÿ’พ Hot storage on RocksDB
  • ๐Ÿ“ฆ Cold storage on Parquet
  • ๐Ÿ› ๏ธ Included CLI tools in the image

The Docker image includes:

  • kalamdb-server
  • kalam
  • kalam-cli

โ โœจ Quick Start

โ ๐Ÿณ Pull and run
docker pull jamals86/kalamdb:latest

docker run -d \
  --name kalamdb \
  -p 2900:2900 \
  -e KALAMDB_SERVER_HOST=0.0.0.0 \
  -e KALAMDB_ROOT_PASSWORD=kalamdb123 \
  -e KALAMDB_JWT_SECRET=replace-with-a-32-char-secret \
  -v kalamdb_data:/data \
  jamals86/kalamdb:latest
โ โœ… Check health
curl http://localhost:2900/health
curl http://localhost:2900/v1/api/healthcheck
โ ๐Ÿ”‘ Login
curl -X POST http://localhost:2900/v1/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{"username":"root","password":"kalamdb123"}'
โ ๐Ÿงช Run your first SQL query
curl -X POST http://localhost:2900/v1/api/sql \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"sql":"SELECT 1 AS ok"}'

โ ๐Ÿงฉ Docker Compose

โ ๐Ÿ“„ Single-node compose file
โ ๐Ÿงฑ 3-node cluster compose file
โ โšก Start single node with compose
cd docker/run/single
export KALAMDB_JWT_SECRET=replace-with-a-32-char-secret
docker compose up -d

By default, the single-node compose file publishes KalamDB on http://localhost:8088.

โ โšก Start 3-node cluster with compose
cd docker/run/cluster
export KALAMDB_JWT_SECRET=replace-with-a-32-char-secret
docker compose up -d

Cluster endpoints:

  • Node 1: http://localhost:2901
  • Node 2: http://localhost:2902
  • Node 3: http://localhost:2903
โ ๐ŸŒ One-line startup from the repo

Single node:

KALAMDB_JWT_SECRET=replace-with-a-32-char-secret \
curl -sSL https://raw.githubusercontent.com/kalamdb/KalamDB/main/docker/run/single/docker-compose.yml | docker compose -f - up -d

3-node cluster:

KALAMDB_JWT_SECRET=replace-with-a-32-char-secret \
curl -sSL https://raw.githubusercontent.com/kalamdb/KalamDB/main/docker/run/cluster/docker-compose.yml | docker compose -f - up -d

โ ๐Ÿ–ฅ๏ธ Open the UI

If the Admin UI is enabled in your image and config, open:

  • Single container run: http://localhost:2900
  • Single-node compose: http://localhost:8088
  • Cluster node 1: http://localhost:2901

Useful API endpoints:

  • Health: GET /health
  • Extended health: GET /v1/api/healthcheck
  • Login: POST /v1/api/auth/login
  • SQL API: POST /v1/api/sql

โ ๐Ÿ› ๏ธ CLI Commands

The image includes both kalam and kalam-cli.

โ ๐Ÿ“Œ Basic CLI usage
docker exec -it kalamdb kalam --version
docker exec -it kalamdb kalam-cli --version
โ ๐Ÿš Open a shell inside the container

The image includes bash for direct shell access:

docker exec -it kalamdb bash
โ โ–ถ๏ธ Useful commands to run inside the container
docker exec -it kalamdb kalam --help
docker exec -it kalamdb kalam-cli --help
docker exec -it kalamdb /usr/local/bin/kalamdb-server --help
โ ๐Ÿ“‹ Common Docker commands
# View logs
docker logs -f kalamdb

# Stop container
docker stop kalamdb

# Start container
docker start kalamdb

# Remove container
docker rm -f kalamdb

# List volumes
docker volume ls

# Inspect persisted data volume
docker volume inspect kalamdb_data

โ ๐ŸŒฑ Environment Variables

These are the most useful environment variables for setup and day-to-day use.

VariablePurposeExample
KALAMDB_SERVER_HOSTBind address inside the container0.0.0.0
KALAMDB_ROOT_PASSWORDRoot user password for initial loginkalamdb123
KALAMDB_JWT_SECRETJWT signing secret, should be at least 32 charssuper-secret-value
KALAMDB_LOG_LEVELLogging levelinfo
KALAMDB_PORTHost port override in single-node compose2900
KALAMDB_ALLOW_REMOTE_SETUPAllow initial remote setup in Docker-based development flowstrue
KALAMDB_CLUSTER_IDCluster identifier for multi-node deploymentsdocker-cluster
KALAMDB_NODE_IDNode id in cluster setups1
KALAMDB_CLUSTER_RPC_ADDRRaft RPC address for a nodekalamdb-node1:2910
KALAMDB_CLUSTER_API_ADDRPublic API address for a nodehttp://kalamdb-node1:2900
KALAMDB_CLUSTER_PEERSCluster peer list for Docker cluster compose2@node2:2910@http://node2:2900;3@node3:2910@http://node3:2900
โ ๐Ÿ” Security note

For anything beyond local testing:

  • change KALAMDB_ROOT_PASSWORD
  • use a strong KALAMDB_JWT_SECRET
  • persist /data with a Docker volume or bind mount

โ ๐Ÿ’พ Persistence

KalamDB stores database state under /data inside the container.

Run with a named volume:

docker run -d \
  --name kalamdb \
  -p 2900:2900 \
  -e KALAMDB_SERVER_HOST=0.0.0.0 \
  -e KALAMDB_ROOT_PASSWORD=kalamdb123 \
  -e KALAMDB_JWT_SECRET=replace-with-a-32-char-secret \
  -v kalamdb_data:/data \
  jamals86/kalamdb:latest

Backup example:

docker run --rm \
  -v kalamdb_data:/data \
  -v "$PWD":/backup \
  alpine \
  tar czf /backup/kalamdb-data.tar.gz /data

โ ๐Ÿ” Troubleshooting

โ Container is up but you cannot connect
docker logs kalamdb

Make sure:

  • port 2900 is published
  • KALAMDB_SERVER_HOST=0.0.0.0
  • your JWT secret is set when binding beyond localhost
โ Login is failing

Make sure the password you use matches KALAMDB_ROOT_PASSWORD from container startup.

โ You see Permission denied (os error 13) on startup

The image runs as a non-root user.

The bundled CLI uses /data/.kalam as its default local state directory inside the container.

Check these first:

  • if you mounted a custom server.toml, make sure the file is readable inside the container
  • if your custom config changes logs_path or data_path, make sure those paths are writable
  • if you bind-mount a host directory to /data or /config, make sure Docker grants the container write access
  • for the simplest persistent setup, prefer a named Docker volume for /data
โ You want a clean reset
docker rm -f kalamdb
docker volume rm kalamdb_data

Tag summary

Content type

Image

Digest

sha256:1530fea3fโ€ฆ

Size

58.4 MB

Last updated

5 days ago

docker pull jamals86/kalamdb