How to install Kafka on Windows 11
In this tutorial, we will guide you through the steps to download and install Kafka on Windows 11 operating system.
Prerequisites
Before installing Kafka on Windows 11, ensure that the following prerequisites are met:
Java Development Kit (JDK) must be installed on your system. You can download it from Oracle's official website.
Set the JAVA_HOME environment variable pointing to your JDK installation directory.
Check that the JAVA_HOME environment variable is added to the system path:
echo %JAVA_HOME%This should print the directory path where the JDK is installed.
Steps
Download the latest Kafka binary version from https://kafka.apache.org/downloads.
Extract the compressed Kafka file into a directory of your choice (such as
C:\Kafka).To do this, right-click on the downloaded file and select "Extract All".
Edit the
config\server.propertiesfile by changing thelistenersproperty under Networking Settings. By default, it is set tolisteners=PLAINTEXT://:9092. Change it tolisteners=PLAINTEXT://localhost:9092to avoid any issues.Open a command prompt in administrator mode and navigate to the Kafka directory.
cd C:\KafkaStart the ZooKeeper server by running the following command:
.\bin\windows\zookeeper-server-start.bat .\config\zookeeper.propertiesYou should see a message
INFO ...binding to port 0.0.0.0/0.0.0.0:2181indicating that the ZooKeeper server has started.Open a new command prompt in administrator mode and navigate to the Kafka directory.
cd C:\KafkaStart the Kafka server by running the following command:
.\bin\windows\kafka-server-start.bat .\config\server.propertiesYou should see a message
INFO ...started (kafka.server.KafkaServer) [kafkaServerId=0]indicating that the Kafka server has started.Kafka is now installed and running on your Windows 11 system. Congratulations!
Conclusion
In this tutorial, we showed you how to install Kafka on your Windows 11 operating system, starting from the prerequisites and going through the step-by-step installation process. Now you can use Kafka's powerful message queuing system for a variety of use cases, from distributed systems to big data processing.