Skip to main content
cara-server is the control-plane process for Caravanserai. It exposes the REST API that cara-agent instances and caractrl communicate with, runs the scheduler that assigns projects to nodes, and continuously drives workloads toward their desired state. It requires a PostgreSQL database for persistence.

Configuration precedence

cara-server merges configuration from four sources. Later sources override earlier ones:
  1. config.yaml — file in the working directory
  2. .env — dotenv file in the working directory
  3. Environment variables
  4. CLI flags
You do not need to use all four sources. A single .env file or a set of environment variables is sufficient for most deployments.

Configuration reference

boolean
default:"false"
Enable debug-level logging. Set to true to emit verbose structured log output. Env var: DEBUG.
string
default:"0.0.0.0"
IP address for the HTTP server to bind to. Use 127.0.0.1 to restrict access to localhost. Env var: HOST.
string
default:"8080"
TCP port for the HTTP server. Env var: PORT.
string
required
PostgreSQL connection string (DSN). Env var: DATABASE_URL.
database_url is required. cara-server will refuse to start if this value is missing or empty.
Accepted formats:
string
OTLP gRPC endpoint for OpenTelemetry trace and metric export. Env var: OTEL_COLLECTOR_URL.
otel_collector_url is optional. When omitted, observability export is disabled and cara-server runs without tracing. Set this to the gRPC address of your OpenTelemetry Collector (for example, otel-collector:4317) to enable distributed tracing.

Configuration examples

config.yaml

Place config.yaml in the same directory as the cara-server binary:
config.yaml

.env file

.env

Environment variables (inline)

Pass configuration directly as environment variables when starting the server:

CLI flags

PostgreSQL connection strings

Local development

Production with TLS

Unix socket

Connection pooler (pgBouncer)

Run PostgreSQL locally with Docker during development: