Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Docker Deployment Guide

The official Kroki-rs Docker image is the recommended way to deploy the service in production. It packages all native dependencies (Chromium, Node.js, Graphviz, D2) in a highly-optimized, multi-arch container.

1. Quick Start (Production)

To run the latest stable version of Kroki-rs:

docker run -d \
  --name kroki-rs \
  -p 8000:8000 \
  -p 8081:8081 \
  --restart unless-stopped \
  ghcr.io/softmentor/kroki-rs:latest

Port Mapping

PortPurposeDescription
8000Main APIServer for diagram rendering and conversion.
8081Admin PortInternal port for health checks, metrics, and monitoring.

2. Operations & Monitoring

Kroki-rs separates operational traffic (metrics/health) from rendering traffic to ensure monitoring remains responsive even under heavy load.

Health Checks

The /health endpoint on the Admin port (8081) returns a 200 OK status if the server and its internal browser pool are operational.

curl http://localhost:8081/health

Metrics & Observability

The Admin port also provides real-time insights into the service’s health:

3. Configuration & Tuning

Environment Variables

You can tune the service behavior using environment variables passed to the container:

VariableDefaultDescription
RUST_LOGinfoLogging verbosity (error, warn, info, debug, trace).
KROKI_PORT8000The primary API port.
KROKI_ADMIN_PORT8081The administrative monitoring port.

Mounting Configuration

For advanced tuning (like custom fonts or timeout policies), mount a kroki.toml file:

docker run -d \
  -v $(pwd)/kroki.toml:/app/kroki.toml \
  -p 8000:8000 \
  ghcr.io/softmentor/kroki-rs:latest

4. Debugging & Troubleshooting

Container Logs

Inspect logs from both the Rust server and the background browser workers:

docker logs -f kroki-rs

Resource Constraints

Renderings diagrams like Mermaid can be CPU and memory intensive. We recommend the following minimum resources for a production instance:

Common Issues