How to Set Up Apache Kafka on Windows Using KRaft Mode (No ZooKeeper)
Apache Kafka is the industry standard for event streaming. While older versions relied on ZooKeeper, the modern approach is to use KRaft (Kafka Raft Metadata) mode.
In this guide, I will walk you through installing Apache Kafka 3.x on Windows without ZooKeeper. This reduces complexity and makes your local setup much lighter.
java -version in your terminal to check before proceeding.
Step 1: Download and Extract
1. Go to the official Apache Kafka download page.
2. Download the Binary downloads (Scala 2.13 is recommended).
3. Extract the folder to a short path like D:\kafka. (Avoid long paths with spaces like "Program Files" to prevent errors).
Step 2: Navigate to Windows Binaries
Open your Command Prompt (CMD) and navigate to the bin\windows directory inside your Kafka folder. This is where the execution scripts live.
cd D:\kafka-apache\kafka3\bin\windows
Step 3: Generate a Cluster UUID
In KRaft mode, the cluster needs a unique ID. Run this command and copy the output code (the UUID).
kafka-storage.bat random-uuid
Example Output: 7W3_8G9mQ-yZ1... (Copy this!)
Step 4: Format Storage Directories
This is the most critical step. You must format the log directories using the UUID you just generated.
Replace <your-uuid> with the code you copied in Step 3.
kafka-storage.bat format -t <your-uuid> -c D:\kafka-apache\kafka3\config\kraft\server.properties
Note: We are pointing to config\kraft\server.properties because we are using KRaft mode, not the old Zookeeper config.
Step 5: Start the Kafka Broker
Now that the storage is formatted, you can start the server.
kafka-server-start.bat D:\kafka-apache\kafka3\config\kraft\server.properties
If successful, you will see logs scrolling on the screen. Do not close this window!
🎥 Watch the Complete Installation
If you get stuck, I have recorded the entire process on a Windows machine so you can follow along click-by-click.
Conclusion & Next Steps
You now have a fully functional Apache Kafka broker running without ZooKeeper. Your next step is to Create a Topic so you can start sending messages.
Check out my next guide on How to Create Kafka Topics via CLI to continue.
Comments
Post a Comment