Skip to main content
A three broker Apache Kafka cluster in KRaft mode (no ZooKeeper) with SASL/SCRAM-SHA-512 sign in, topics replicated three times with two in sync, and an optional TLS switch. Brokers are not published on the host, so reach them from other services in this project at kafka-1:9092, kafka-2:9092 and kafka-3:9092 as user admin with the generated password. With TLS on, trust /tls/ca.crt from the kafka_tls volume. Topics are not created automatically. This page describes the Levelrail template for Apache Kafka cluster (Infrastructure). It deploys the services below as one Docker Compose app on your own server. Project site: https://kafka.apache.org/documentation/. Recommended memory: about 3072 MiB.

Services, ports and volumes

Environment variables

Passwords and keys marked as generated are created for you when the app is deployed and stored as secrets. Values are not shown here.

Security and requirements

Level: Standard. What this template needs:
  • Passwords and keys are generated at deploy time (kafka-1, kafka-2, kafka-3, kafka-certs): ADMIN_PASSWORD, TLS_PASSWORD, TLS_PASSWORD.
  • No health check, so a deploy is judged by the process starting (kafka-certs).
  • Stores data in named volumes (kafka-1, kafka-2, kafka-3, kafka-certs): kafka_1_data, kafka_2_data, kafka_3_data, kafka_tls.
What Levelrail adds around it:
  • Automatic HTTPS and an ingress shield in front of every domain.
  • Secrets are generated, stored encrypted and masked in logs and the UI.
  • Named volumes can be backed up and restored.
  • Deploys are gated on the health check before traffic switches.
  • One-step rollback to the previous revision.
  • Exposure report shows what is reachable from outside.
  • Host firewall rules managed for published ports.

See topics and consumer lag

Open the app’s overview page and the Topics and consumer lag panel shows each topic (partitions, copies, whether every copy is in sync) and each consumer group (members and how many messages it is behind). It is read-only: Levelrail runs kafka-topics.sh --describe and kafka-consumer-groups.sh --describe --all-groups inside a running broker, using the client settings file the broker wrote at start, so the admin password is never read or sent to your browser. From a terminal, levelrail-cli apps kafka <name> prints the same topics and consumer groups (add --json for the raw view). The panel only appears for apps deployed from this template. Reading it needs the read ability on the app. How long each command may run (each of the two commands has its own limit), how much output is read, and how long a result is reused are runtime settings (kafka.view_timeout, kafka.view_max_output_bytes and kafka.view_cache_seconds), changed live in settings. If one command fails or times out, the other part of the view still shows. The output parsers were checked against sample output only, not against every Kafka release or a live consumer workload. If a Kafka upgrade changes the tool output, a column can read as empty or a row can be skipped, and the panel shows what it could parse.

Deploy Apache Kafka cluster with Levelrail

In the dashboard, open Apps, choose New app, then Browse templates, and select Apache Kafka cluster. Review the Compose body and deploy. With the CLI:
See the service template catalog for how templates work, and Getting started if you have not installed Levelrail yet.

More Infrastructure templates

All templates are listed in the self-host gallery.
Last modified on December 3, 2026