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.
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:
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…:
Browse to C:\MaryZheng\kafka_2.12_2.6.0 folder. Click OK.
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.
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.