Skip to content

Docker Compose

Danube provides several Docker Compose setups for different use cases. All setups use embedded Raft consensus for metadata, no external dependencies required.

SetupServicesBest for
Quickstart3 Brokers, CLI, PrometheusQuick testing, learning Danube
With UIQuickstart + Admin Server + Web UIVisual cluster exploration
With Cloud StorageQuickstart + MinIO + MCCloud storage and durability testing
Local DevelopmentAll above (builds from source)Development, testing local changes
  • Docker Engine 20.10+
  • Docker Compose 2.0+
  • At least 2GB RAM (4GB for cloud-storage setup)

Minimal setup with filesystem backend: 3 brokers forming a Raft cluster, a CLI container, and Prometheus for metrics.

  1. Clone the repository

    Terminal window
    git clone https://github.com/danube-messaging/danube.git
    cd danube/docker
  2. Start the cluster

    Terminal window
    cd quickstart/
    docker-compose up -d
  3. Verify all services are running

    Terminal window
    docker-compose ps

    Expected output:

    Expected output
    NAME IMAGE STATUS PORTS
    danube-broker1 ghcr.io/danube-messaging/danube-broker:latest Up (healthy) 6650, 50051, 9040
    danube-broker2 ghcr.io/danube-messaging/danube-broker:latest Up (healthy) 6651, 50052, 9041
    danube-broker3 ghcr.io/danube-messaging/danube-broker:latest Up (healthy) 6652, 50053, 9042
    danube-cli ghcr.io/danube-messaging/danube-cli:latest Up
    danube-prometheus prom/prometheus:latest Up 9090

Brokers form a Raft cluster automatically using --seed-nodes. The broker with the lowest node ID initializes the cluster; the others join.

ServiceEndpointPurpose
Broker 1localhost:6650gRPC messaging
Broker 2localhost:6651gRPC messaging
Broker 3localhost:6652gRPC messaging
Admin API 1localhost:50051Broker administration
Admin API 2localhost:50052Broker administration
Admin API 3localhost:50053Broker administration
Prometheuslocalhost:9090Metrics UI

The compose setup includes a danube-cli container with both danube-cli and danube-admin pre-installed. No local installation required.

Produce messages
docker exec danube-cli danube-cli produce \
--service-addr http://broker1:6650 \
--topic "/default/test" \
--count 100 \
--message "Hello Danube!"
Consume messages
docker exec -it danube-cli danube-cli consume \
--service-addr http://broker1:6650 \
--topic "/default/test" \
--subscription "my-sub"
Produce with JSON Schema
docker exec danube-cli danube-cli produce \
--service-addr http://broker1:6650 \
--topic "/default/json-topic" \
--count 100 \
--schema json \
--json-schema '{"type":"object","properties":{"message":{"type":"string"},"timestamp":{"type":"number"}}}' \
--message '{"message":"Hello JSON","timestamp":1640995200}'
Consume JSON messages
docker exec -it danube-cli danube-cli consume \
--service-addr http://broker1:6650 \
--topic "/default/json-topic" \
--subscription "json-sub"
Admin commands
# List active brokers
docker exec danube-cli danube-admin brokers list
# List namespaces
docker exec danube-cli danube-admin brokers namespaces
# List topics
docker exec danube-cli danube-admin topics list default
# Cluster status (Raft membership)
docker exec danube-cli danube-admin cluster status

Adds a web dashboard and admin server for visual cluster exploration.

Terminal window
cd with-ui/
docker-compose up -d
ServiceURL
Web UIhttp://localhost:8081
Admin APIhttp://localhost:8080

The UI provides real-time cluster status, topic and subscription management, broker load visualization, and a schema registry browser.


Adds MinIO (S3-compatible) for testing reliable / persistent messaging with cloud storage.

Terminal window
cd with-cloud-storage/
docker-compose up -d
ServiceURLCredentials
MinIO Consolehttp://localhost:9001minioadmin / minioadmin123

Buckets danube-messages and danube-wal are created automatically.

Test reliable delivery:

Produce persistent messages
docker exec danube-cli danube-cli produce \
--service-addr http://broker1:6650 \
--topic "/default/persistent" \
--count 1000 \
--message "Persistent message" \
--reliable

Builds all services from source, for contributors working on broker or admin code.

Terminal window
cd local-development/
docker-compose up -d --build

Rebuild after code changes:

Rebuild specific services
docker-compose build broker1 broker2 broker3
docker-compose up -d --no-deps broker1 broker2 broker3

Access metrics
# Broker metrics
curl http://localhost:9040/metrics
# Prometheus UI
open http://localhost:9090
  • Port conflicts: ensure ports 6650-6652, 50051-50053, 9040-9042, 9090 are free
  • Memory issues: increase Docker memory if containers fail to start
  • Logs: docker-compose logs -f broker1
Full reset
docker-compose down -v
docker volume prune -f
docker-compose up -d
  1. Storage: replace MinIO with AWS S3, GCS, or Azure Blob Storage
  2. Security: enable TLS/mTLS in broker configuration
  3. Resources: configure CPU/memory limits
  4. Monitoring: add Grafana dashboards for Prometheus
  5. Backup: back up Raft data directories for state recovery
  6. Orchestration: use Kubernetes with Helm for production scaling