This page covers the installation of cursus using different methods: building from source or using Docker.
For configuration options after installation, see Configuration. For instructions on running the broker once installed, see Running the Broker.
cursus requires Go 1.25.0 or higher. This is specified in go.mod
The project has minimal external dependencies:
| Dependency | Purpose |
|---|---|
github.com/prometheus/client_golang v1.23.2 |
Metrics exporter |
gopkg.in/yaml.v3 v3.0.1 |
Configuration file parsing |
golang.org/x/exp |
Extended Go libraries |
golang.org/x/sys |
System-level calls (Linux optimizations) |
All dependencies are managed via Go modules and will be automatically downloaded during the build process.
The Makefile provides convenient build targets for all components.
The primary command builds all binaries:
make build
This executes three sub-targets defined in Makefile
make build-api - Builds the broker servermake build-cli - Builds the CLI toolmake build-bench - Builds the benchmarking tool| Target | Output | Command |
|---|---|---|
| API Server | bin/cursus |
make build-api |
| CLI Tool | bin/cursus-cli |
make build-cli |
| Benchmark Tool | bin/cursus-bench |
make build-bench |
All builds use the following flags, as specified in Makefile
CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w"
| Flag | Purpose |
|---|---|
CGO_ENABLED=0 |
Produces static binaries without C dependencies |
GOOS=linux |
Targets Linux platform |
-ldflags="-s -w" |
Strips debug information and symbol tables to reduce binary size |
Alternatively, build directly using go build:
CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o bin/cursus ./cmd/broker/main.go
CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o bin/cursus-cli ./cmd/cli/main.go
CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o bin/cursus-bench ./cmd/bench/main.go
For local development with faster builds (without optimization flags):
make run # Build and run broker
make cli # Build and run CLI
These commands use go run which compiles and executes in one step.
The build process is defined in Dockerfile:
golang:1.25.0go mod downloadCGO_ENABLED=0-ldflags="-s -w" for size optimizationBuilding the Docker Image:
make docker
docker build -t cursus:latest .
Alternatively, build directly with docker:
docker build -t cursus:latest .
The resulting Docker image contains:
| Path | Description |
|---|---|
/root/broker |
Main broker executable |
/root/cli |
CLI tool executable |
/root/entrypoint.sh |
Container startup script |
/root/logs/ |
Default log directory (created at runtime) |
The multi-stage build significantly reduces image size:
This is achieved by copying only the compiled binaries from the builder stage to a minimal Alpine base.
After building from source, the bin/ directory contains:
bin/
├── cursus # Main broker server
├── cursus-cli # Administrative CLI tool
└── cursus-bench # Performance benchmarking tool
| Binary | Entry Point | Purpose |
|---|---|---|
| cursus | cursus |
Starts the broker server with TCP listener, health check endpoint, and metrics exporter |
| cursus-cli | cursus-cli |
Interactive CLI for administrative commands (CREATE, DELETE, LIST, SUBSCRIBE, PUBLISH, CONSUME) |
| cursus-bench | cursus-bench |
Runs performance benchmarks and load testing |
The broker binary performs the following initialization sequence.
The CLI binary initializes similarly but for interactive command processing, as shown in cmd/cli/main.go
config.LoadConfig()After building, verify the binaries exist:
ls -lh bin/
Expected output:
-rwxr-xr-x 1 user group 15M cursus
-rwxr-xr-x 1 user group 12M cursus-cli
-rwxr-xr-x 1 user group 13M cursus-bench
Test that binaries are executable:
./bin/cursus --help
./bin/cursus-cli --help
For Docker installations, verify the image was built:
docker images | grep cursus
Expected output:
cursus latest <image-id> <timestamp> ~50MB
Run a quick test container:
docker run --rm cursus --help
To remove all built binaries and test data:
make clean
This removes:
bin/pkg/topic/pkg/server/As defined in Makefile,the clean target executes:
rm -rf bin/* pkg/topic/test-topic/* pkg/topic/topic1/* pkg/server/testconn/*
After installation, proceed to: