Enterprise Java

How to Download and Install Apache Kafka on Windows

In this example, I will show you how to download and install Apache Kafka on a Windows 10 machine.

1. Introduction

If you develop an application utilizing Apache Kafka on a Windows computer, it’s better to have Apache Kafka installed locally so you can run integration testing at your workstation.

2. Prerequisite

Apache Kafka requires JDK 1.8+. Apache Kafka 2.1.0+ supports JDK 11. Please click here to install JDK in a Windows computer.

3. Kafka Download

Download the latest version from Apache Kafka site. In this step, I will download the compressed zip file: kafka_2.12-2.6.0.tgz.

kafka download
Figure 1: Download Apache Kafka

Note: the file name includes the Scala version 2.12 and Kafka version 2.6.0.

After download, you should see the compressed file: Kafka_2.12_2.6.0.tgz in the Downloads directory. Here is mine:

kafka download
Figure 2 Downloaded Kafka

4. Install

There are several ways to unzip and extract the compressed zip file in Windows. In this step, I will use 7-Zip.

Right click the downloaded file: Kafka_2.12_2.6.0.tgz, select 7-Zip->Extract files…:

kafka download - Unzip files
Figure 3 Unzip files

Browse to C:\MaryZheng\kafka_2.12_2.6.0 folder. Click OK.

kafka download - Extract to location
Figure 4 Extract to location

Right-click the tar file created from the previous step and extract to the desired location. The installation process is completed. Here is the screenshot of my installed Apache Kafka folder structure.

Figure 5 Kafka is Installed

Note: Make sure that Apache Kafka folder name has no blank space.

5. Start Server

Apache Kafka installed files include default configuration, so you can start the server as it is. Please remember that the zookeeper server should be started first as it manages and discovers Kafka brokers.

5.1 Start Zookeeper

Navigate to the installed Apache Kafka folder: C:\Zheng\kafka_2.13_2.6.0 \bin\windows. I will start a Zookeeper server with the following command:

c:\Zheng\kafka_2.13-2.6.0\bin\windows>zookeeper-server-start.bat ..\..\config\zookeeper.properties

5.2 Start Kafka Server

Navigate to the installed Apache Kafka folder: C:\Zheng\kafka_2.13_2.6.0 \bin\windows. I will start an Apache Kafka server with the following command

C:\Zheng\kafka_2.13-2.6.0\bin\windows>kafka-server-start.bat ..\..\config\server.properties

6. Summary

In this example, I demonstrated the following steps to download and install Apache Kafka on a Windows 10 computer:

  • Download the compressed zip file from Apache site.
  • Install it by unzipping via 7-Zip.
  • Start Apache Kafka.

You can now check our article about Apache Kafka Tutorial for Beginners.

Mary Zheng

Mary has graduated from Mechanical Engineering department at ShangHai JiaoTong University. She also holds a Master degree in Computer Science from Webster University. During her studies she has been involved with a large number of projects ranging from programming and software engineering. She works as a senior Software Engineer in the telecommunications sector where she acts as a leader and works with others to design, implement, and monitor the software solution.
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Inline Feedbacks
View all comments
Back to top button