Setting up Apache Kafka server on Windows system

Apache Kafka is an open-source stream-processing software platform. We can use Apache Kafka with microservice architecture as a message bus for communication between microservices. We can Apache Kafka zip file on the Windows system and start the server to test it locally.

In this article, we will learn how to set up Apache Kafka on the Windows system.

Table of Contents

Install Java

We need to install Java to set up the Apache Kafka server. If Java is not yet installed in your machine, install it before moving further.

We can check the installed Java version as shown below.

installed java version

Download Apache Kafka

We can download the latest Apache Kafka zip file from here.

Once the file is downloaded, we can extract the file using 7-zip to any location required. I have extracted the archived file into the C:\Kafka directory of my Windows system.

kafka archive

Also, I am using the current latest available version of Apache Kafka, which is version:2.3.1

Setup the Zookeeper server

We need the Zookeeper to set up the Apache Kafka server. Zookeeper is a software tool that keeps track of the status of the Kafka cluster nodes and it also keeps track of Kafka topics, partitions, etc.

Apache Kafka archive file contains Zookeeper packaged with it. We are also going to use the same.

Let us set up the Zookeeper now.

Open the command prompt. Navigate to the unzipped Kafka directory and navigate inside the kafka\bin\windows folder.

Execute the command: zookeeper-server-start.bat ..\..\config\ Here, we are starting the Zookeeper server with the default property provided under kafka\config\ directory.

Apache zookeeper start cmd.

Once the Zookeeper fires up, we will be able to see the following message on the command prompt.

Apache zookeeper started

Congratulations!! 🙂 Zookeeper server is up and running on port 2181.

Set up the Kafka server

The next step is to start the Kafka server.

Open a new command prompt window, navigate to the kafka\bin\windows directory.

Execute the command: kafka-server-start.bat ..\..\config\, as shown below.

apache kafka server start

We should be able to get the screen with content similar to the below image.

apache kafka on windows

Apache Kafka server starts on 9092 port by default.

Congratulations!! 🙂 Apache Kafka server is up and running on our windows system successfully.

Create a Kafka topic

We can create a simple Kafka topic to verify if our Kafka setup is configured properly.

Open the command prompt in a new window, and execute the following command.

kafka-topics.bat --delete --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1 --topic test-topic
apache kafka on windows

We have created a Kafka topic called test-topic.

List the topics

We can also list the created Kafka topics with the below command. --list --bootstrap-server localhost:9092

The below image shows the list of Kafka topics created in the Kafka server.

apache kafka on windows


In this article, we learned how to set up an Apache Kafka server on the Windows system.

In the next article, we will also learn how to create a spring boot application and configure producer/ consumer configurations for Kafka topics.