Skip to content
Live $100 credit at signup, up to $300 total Offer ends December 31, 2026 Get started →

Apache Kafka

Apache Kafka is an open-source distributed event-streaming platform. It ingests, stores, and processes high-throughput streams of records across topics, powering messaging, log aggregation, and real-time data pipelines. Modern Kafka runs in KRaft mode, so it no longer needs a separate ZooKeeper cluster.

ComponentVersion
Apache Kafka4.3.1
OpenJDK21 (JRE)
Ubuntu24.04 LTS
ssh ubuntu@<your-vm-ip>

On the first boot, a setup script configures advertised.listeners, formats the KRaft storage, and starts Kafka. Track progress:

journalctl -u kafka-first-boot.service -f

The login message (MOTD) confirms when Kafka is ready.

systemctl status kafka

List the available topics to verify the broker:

sudo -u kafka /opt/kafka/bin/kafka-topics.sh \
--bootstrap-server localhost:9092 --list

The bootstrap server listens on:

<your-vm-ip>:9092

You can review the connection guidance written at first boot:

sudo cat /root/.credentials/kafka.txt
# Check service status
systemctl status kafka
# Restart
sudo systemctl restart kafka
# View logs
sudo journalctl -u kafka -f
PathPurpose
/opt/kafka/config/server.propertiesBroker and KRaft configuration
/opt/kafka/data/Kafka data

Port 9092 is accessible on the VM’s network interface. UFW is enabled and allows SSH (port 22) only by default.

To allow broker access from a specific IP:

sudo ufw allow from <trusted-ip> to any port 9092

The advertised listener address is generated from the VM’s local IP on first boot. To connect without opening the firewall, point the advertised listener at localhost on the VM, restart Kafka, then open an SSH tunnel:

# On the VM: advertise localhost instead of the VM's IP, then restart Kafka
sudo sed -i 's|^advertised.listeners=.*|advertised.listeners=PLAINTEXT://localhost:9092|' /opt/kafka/config/server.properties
sudo systemctl restart kafka
# Run this on your local machine
ssh -L 9092:localhost:9092 ubuntu@<your-vm-ip>

Kafka uses plaintext transport and has no authentication in this single-node image. Configure authentication and encrypted listeners before using it for production workloads, and restrict port 9092 to trusted clients.

Last updated: