Installing Kafka on Windows

Anil Kumar Kanasani
3 min readMay 5, 2020

--

Step 1:- Donwload Kafka zip file:-

Please go to the website https://kafka.apache.org/downloads ,and click on latest version “Binary download” . At the time of creating this tutorial, the latest version is 2.5.0.

It will relink to apache.org website. Download the mirror site (first link in the website).

Unzip the downloaded file (2 times) and paste the unzipped folder in C:/ drive(preferable). Rename the folder to kafka. (Hint:- There should not be any space in the path).

C:\kafka\bin\windows” contains all files required to start kafka and zookeeper on windows.

C:\kafka\config” contains all configuration files for Kafka, zookeeper and consists of log files. All the configurations are setup by default values, you can change the configurations based on your requirements.

Step : 2 :- Edit configuration files :-

Open the file “C:\kafka\config\server.properties” in any text editor. Search for “log.dirs”. change the default value to

Open the file “C:\kafka\config\zookeeper.properties” in any text editor. Search for “dataDir”. Change the default value to

Step : 3 :- Install Java:-

Go to “https://www.oracle.com/java/technologies/javase-jdk14-downloads.html” and download latest version of JDK Installer

Java Installation is very straight forward. Please install it under “C:\Java\jdf-14.0.1\”. (Hint:- There should not be any space in the path). Add the folder location “C:\Java\jdk-14.0.1\bin” to PATH variable.

Now, check for the Java Installation by running the following command in cmd.

Step 4:- Start zookeeper:-

Open a command prompt in “C:\kafka” and run the following command

Step 5:- Start kafka server :-

Open another command prompt in “C:\kafka” and run the following command

You will end up with following window stating as Kafka server started (with your version number).

Step 6 :- Checking Kafka setup: -

create a Test Topic by using following command (in a new cmd)

Start a kafka producer by using the following command to send messages to TestTopic

After starting the kafka Producer, you can starting sending messages to TestTopic as follows

Now start another cmd and start a consumer with following command

You can see all messages which you send from kafka producer (as follows).

If you see those messages, then your Kafka is installed successfully and running successfully.

--

--

Anil Kumar Kanasani

Passionate Data enthusiastic , a highly self-motivated & self-confident professional