Self-host Apache Kafka on a VPS

A single broker Apache Kafka in KRaft mode (no ZooKeeper) on the official image, with a persistent volume. It is not published on the host and speaks plaintext, so reach it only from other services in this project at kafka:9092.

levelrail-cli templates deploy kafka --name my-kafka

Specification

Status
Listed
Category
Infrastructure
Services
kafka
Ports
9092
Volumes
1
Memory
about 1 GiB
arm64
unknown
amd64
unknown
Settings to fill in
none
Listing
Community template

About Apache Kafka

A single broker Apache Kafka in KRaft mode (no ZooKeeper) on the official image, with a persistent volume. It is not published on the host and speaks plaintext, so reach it only from other services in this project at kafka:9092.

What it deploys

Apache Kafka runs as one service in a single Compose app, listening on port 9092, with 1 named volume mount.

ServiceImageTagPortsVolumes
kafka apache/kafka 3.8.0 9092 kafka_data -> /var/lib/kafka/data

Before you install

  • CPU architecture. arm64 unknown. The scan could not read a manifest or the tag is chosen at install time. This is not a claim either way.
  • Listed. It is in the catalog. Back up the data volume before changing an image tag.

Settings and environment

You do not have to fill in anything. Values are never shown here.

ServiceVariableValue
kafkaKAFKA_ADVERTISED_LISTENERSPreset by the template
kafkaKAFKA_CONTROLLER_LISTENER_NAMESPreset by the template
kafkaKAFKA_CONTROLLER_QUORUM_VOTERSPreset by the template
kafkaKAFKA_GROUP_INITIAL_REBALANCE_DELAY_MSPreset by the template
kafkaKAFKA_LISTENERSPreset by the template
kafkaKAFKA_LISTENER_SECURITY_PROTOCOL_MAPPreset by the template
kafkaKAFKA_LOG_DIRSPreset by the template
kafkaKAFKA_NODE_IDPreset by the template
kafkaKAFKA_OFFSETS_TOPIC_REPLICATION_FACTORPreset by the template
kafkaKAFKA_PROCESS_ROLESPreset by the template
kafkaKAFKA_TRANSACTION_STATE_LOG_MIN_ISRPreset by the template
kafkaKAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTORPreset by the template

First run

  1. Point producers and consumers in the same project at kafka:9092. Topics are created on first use.

Install Apache Kafka on a VPS

  1. Install Levelrail on a fresh VPS

    Run this as root on a Linux server (amd64 or arm64) with ports 80 and 443 reachable. The installer prints a setup link.

    curl -fsSL https://levelrail.com/install.sh | sudo sh
  2. Sign in

    Open the setup link, choose a password, then log the CLI in. The CLI install command is curl -fsSL https://levelrail.com/install-cli.sh | sh if the machine does not have it. See Getting started.

    levelrail-cli login --device
  3. Read the template

    Shows the entry, including its full compose.yaml.

    levelrail-cli templates get kafka
  4. Deploy it

    This deploys the template compose file as an app. The app name defaults to the template id; --name sets another.

    levelrail-cli templates deploy kafka --name my-kafka

Without a domain the app gets an sslip.io address. You can also deploy it from the dashboard: Apps, New app, Browse templates, then Apache Kafka.

More in Infrastructure

All Infrastructure templates