How to Download and Install Apache Kafka on Ubuntu 24/Linux | Step-by-Step Guide

Опубликовано: 17 Август 2026
на канале: The Data Engineering Hub
478
2

In this video, you'll learn how to download and install Apache Kafka on Ubuntu 24 or the latest Linux distribution. Follow along with this easy-to-understand, step-by-step guide, and set up Apache Kafka on your system in no time. Whether you're new to Kafka or just need a refresher, this tutorial will help you get started with one of the most powerful distributed streaming platforms.
Useful Linnks:
Download Apache Kafka :https://kafka.apache.org/downloads
Commands used in this video:
1. Check Java Version
Run the following command to check your Java version. It should be 11 or above.
java --version

2. Install Java (if needed)
If the Java version is below 11, install Java 11 or above with the following command (for Ubuntu).
sudo apt update
sudo apt install openjdk-11-jdk

3. Start Zookeeper
Run the following command to start Zookeeper on Linux.
bin/zookeeper-server-start.sh config/zookeeper.properties

4. Start Kafka
Run the following command to start Kafka on Linux.
bin/kafka-server-start.sh config/server.properties

5. Create a Test Topic
Run the following command to create a test topic in Kafka.
bin/kafka-topics.sh --create --topic test --bootstrap-server localhost:9092 --partitions 1 --replication-factor 1

6. List Topics
Run the following command to list all topics in Kafka.
bin/kafka-topics.sh --list --bootstrap-server localhost:9092

7. Start Kafka Producer
Run the following command to start a Kafka producer for the test topic.
bin/kafka-console-producer.sh --topic test --bootstrap-server localhost:9092

8. Start Kafka Consumer
Run the following command to start a Kafka consumer to consume messages from the test topic.
bin/kafka-console-consumer.sh --topic test --from-beginning --bootstrap-server localhost:9092