Kafka 4.0 Windows Setup in 2025: KRaft Mode WITHOUT ZooKeeper!
Setting up Kafka on Windows has traditionally been… painful.
Juggling ZooKeeper, random configuration errors, path issues, and multiple services often turned a simple dev setup into an evening of debugging.
Apache Kafka 4.0 changes that story.
With KRaft mode, Kafka no longer depends on ZooKeeper. That means:
- No extra ZooKeeper service
- Fewer moving parts
- A much cleaner Windows experience
This guide walks you through every step of getting Kafka running in KRaft mode, including fixes for the most common Windows errors.
First, download Kafka from the official downloads page:
https://kafka.apache.org/downloads
Look for Kafka 4.0 or later — such as 4.1.0.
You’ll find entries like:
kafka_2.13-4.1.0.tgz
Extract using:
- 7-Zip
- WinRAR
- Windows 11 built-in extractor
Extract to:
C:\Common\kafkaC:\kafka
Avoid spaces in the path.
Pull the official Kafka Docker image:
docker pull apache/kafka:latest
Run it:
docker run -p 9092:9092 apache/kafka:latest
- Java 11 or newer
Check version:java -version - Kafka 4.x extracted
- Basic command line knowledge
- 7-Zip or equivalent
Older Kafka versions required ZooKeeper, meaning more processes, more config, more errors.
KRaft mode removes ZooKeeper entirely:
- Kafka manages its own metadata
- Fewer moving parts
- Cleaner setup on Windows
Point it to your Kafka folder:
C:\Common\kafka
Add:
%KAFKA_HOME%\bin\windows
Run:
kafka-storage.bat --version
kafka-storage.bat random-uuid
Basic setup:
kafka-storage.bat format -t YOUR_CLUSTER_ID -c config/server.properties
kafka-server-start.bat config/server.properties
Create topic:
kafka-topics.bat --create --topic test-topic --bootstrap-server localhost:9092
Producer:
kafka-console-producer.bat --topic test-topic --bootstrap-server localhost:9092
Consumer:
kafka-console-consumer.bat --topic test-topic --from-beginning --bootstrap-server localhost:9092
Make sure you're in Kafka’s root folder when running commands.
Delete the logs directory:
rmdir /s /q C:\Common\kafka\tmp\kraft-combined-logs
Then format again.
Delete:
rmdir /s /q C:\tmp\kraft-combined-logs
Re-format.
Windows 11 often removes WMIC.
Quick fix: set static heap size by editing kafka-server-start.bat:
set KAFKA_HEAP_OPTS=-Xmx512M -Xms512M
List topics:
kafka-topics.bat --list --bootstrap-server localhost:9092
Describe topic:
kafka-topics.bat --describe --topic test-topic --bootstrap-server localhost:9092
Delete topic:
kafka-topics.bat --delete --topic test-topic --bootstrap-server localhost:9092
You now have a full Kafka 4.x KRaft single-node setup. Next steps:
- Add security
- Tune performance
- Add replication
- Monitor Kafka
Kafka on Windows used to be frustrating — but KRaft mode simplifies everything. Most issues now are Windows-specific (like WMIC), not Kafka-related.
If you hit an issue, the Kafka documentation and community are incredibly helpful.
Happy streaming!