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-kafkaSpecification
- Status
- Listed
- Category
- Infrastructure
- Services
- kafka
- Ports
- 9092
- Volumes
- 1
- Memory
- about 1 GiB
- arm64
- unknown
- amd64
- unknown
- Settings to fill in
- none
- License
- Permissive license, Apache-2.0
- 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.
| Service | Image | Tag | Ports | Volumes |
|---|---|---|---|---|
| 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.
| Service | Variable | Value |
|---|---|---|
| kafka | KAFKA_ADVERTISED_LISTENERS | Preset by the template |
| kafka | KAFKA_CONTROLLER_LISTENER_NAMES | Preset by the template |
| kafka | KAFKA_CONTROLLER_QUORUM_VOTERS | Preset by the template |
| kafka | KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS | Preset by the template |
| kafka | KAFKA_LISTENERS | Preset by the template |
| kafka | KAFKA_LISTENER_SECURITY_PROTOCOL_MAP | Preset by the template |
| kafka | KAFKA_LOG_DIRS | Preset by the template |
| kafka | KAFKA_NODE_ID | Preset by the template |
| kafka | KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR | Preset by the template |
| kafka | KAFKA_PROCESS_ROLES | Preset by the template |
| kafka | KAFKA_TRANSACTION_STATE_LOG_MIN_ISR | Preset by the template |
| kafka | KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR | Preset by the template |
First run
- Point producers and consumers in the same project at kafka:9092. Topics are created on first use.
Install Apache Kafka on a VPS
-
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 -
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 | shif the machine does not have it. See Getting started.levelrail-cli login --device -
Read the template
Shows the entry, including its full compose.yaml.
levelrail-cli templates get kafka -
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.
Docs and upstream
More in Infrastructure
- AdGuard HomeNetwork-wide ad and tracker blocking with a DNS server and a friendly admin dashboard.
- ActiveMQ ClassicA message broker with JMS, AMQP and MQTT support and a web console, with a data volume. The console login is admin with the password admin, so change it right after the first sign in.
- CaddyA fast web server with automatic HTTPS and a simple config file, on the official image serving its default page. Mount your own Caddyfile or site files to host real sites.
- ChiselA fast TCP and UDP tunnel over HTTP secured by SSH, for reaching services behind firewalls. MIT licensed. The tunnel password is generated for you.
- Cloudflare DDNSKeeps Cloudflare DNS records pointed at your current public IP address.
- ConsulHashiCorp Consul in single-server mode with the web UI: service discovery, health checks and a key-value store.