DevLearn
Kafka Installation

Install Apache Kafka

Step-by-step installation guide for Windows, Linux, and macOS

33%

Step 3 of 6

Prerequisites
Download Kafka
3Extract & Configure
4Start ZooKeeper
5Start Kafka Broker
6Verify Installation
Step 1

Prerequisites

Install Java JDK before installing Kafka

Java 21 LTS
Recommended

Recommended for Kafka 3.6+

Java 17 LTS
Stable

Recommended for Kafka 3.6+

Java 11 LTS
Legacy

Recommended for Kafka 3.6+

Verify Java Installation

Open Command Prompt and run:

bash
java -version
Step 2

Download Apache Kafka

Download the latest Kafka release

Or visit kafka.apache.org/downloads

Important

Download the binary version (scala 2.13) for Windows. Extract to a folder without spaces (e.g., C:\kafka).

Step 4

Start ZooKeeper

Start the ZooKeeper service (KRaft mode is optional)

Open a Command Prompt in the Kafka directory and run:

bash
cd C:\kafka
bin\windows\zookeeper-server-start.bat config\zookeeper.properties

ZooKeeper will start on port 2181 by default. Keep this terminal open.

Step 5

Start Kafka Broker

Start the Kafka server

Open a new Command Prompt and run:

bash
cd C:\kafka
bin\windows\kafka-server-start.bat config\server.properties

Kafka will start on port 9092 by default. Keep this terminal open.

Step 6

Verify Installation

Create a test topic and verify everything works

Create a test topic:

bash
bin\windows\kafka-topics.bat --create --topic test-topic \
--bootstrap-server localhost:9092 --partitions 1 --replication-factor 1

List topics to verify:

bash
bin\windows\kafka-topics.bat --list --bootstrap-server localhost:9092

Success!

If you see "test-topic" in the output, Kafka is installed correctly!

Next Steps

Create Topics

Learn about topic creation and configuration

Build Producer

Create your first Kafka producer in Java

Build Consumer

Create your first Kafka consumer in Java