How to install Apache Kafka on Windows
Install Kafka on Windows step by step via WSL2. Download Kafka, set up Java, start ZooKeeper and the broker, then verify the cluster with the CLI tools.
Install and run Kafka on Windows in 20 minutes
This guide walks you through installing Apache Kafka with ZooKeeper on Windows using WSL2 (Windows Subsystem for Linux). By the end, you'll have a working single-node Kafka cluster for development.
What you'll learn:
- How to set up WSL2 on Windows
- How to install Java 11 (required dependency)
- How to download and configure Kafka
- How to start ZooKeeper and Kafka
Native Windows is not recommended
Kafka has known issues when running directly on Windows due to missing POSIX features. Always use WSL2 or Docker for Windows installations.
This guide uses ZooKeeper mode for maximum compatibility. For KRaft mode (without ZooKeeper), see the Windows KRaft installation guide.
Installation overview
Step 1: Install WSL2
WSL2 provides a Linux environment on Windows without a virtual machine.
Open PowerShell as Administrator and run:
wsl --install This installs Ubuntu by default. Restart your computer when prompted.
After restart, open Ubuntu from the Start menu and create a Linux username and password.
For troubleshooting WSL2 issues, see the Microsoft troubleshooting guide.
Step 2: Disable IPv6 on WSL2
WSL2 has a networking issue that prevents external programs from connecting to Kafka. Disable IPv6 to fix this:
sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1 Step 3: Install Java JDK 11
In your WSL2 Ubuntu terminal:
wget -O- https://apt.corretto.aws/corretto.key | sudo apt-key add -
sudo add-apt-repository 'deb https://apt.corretto.aws stable main'
sudo apt-get update
sudo apt-get install -y java-11-amazon-corretto-jdk Verify the installation:
java -version Expected output:
openjdk version "11.0.10" 2021-01-19 LTS
OpenJDK Runtime Environment Corretto-11.0.10.9.1 (build 11.0.10+9-LTS)
OpenJDK 64-Bit Server VM Corretto-11.0.10.9.1 (build 11.0.10+9-LTS, mixed mode) Step 4: Download and extract Kafka
wget https://archive.apache.org/dist/kafka/3.0.0/kafka_2.13-3.0.0.tgz
tar -xzf kafka_2.13-3.0.0.tgz
mv kafka_2.13-3.0.0 ~ Or download manually from kafka.apache.org/downloads.
Step 5: Start ZooKeeper
ZooKeeper has to be running before Kafka starts.
~/kafka_2.13-3.0.0/bin/zookeeper-server-start.sh ~/kafka_2.13-3.0.0/config/zookeeper.properties Add the
-daemonflag to run ZooKeeper in the background.
Keep this terminal window open.
Step 6: Start Kafka
Open a new WSL2 terminal window and run:
~/kafka_2.13-3.0.0/bin/kafka-server-start.sh ~/kafka_2.13-3.0.0/config/server.properties Keep this terminal window open. Kafka is now running at localhost:9092.
Step 7: Configure PATH
Add Kafka binaries to your PATH:
echo 'export PATH="$PATH:$HOME/kafka_2.13-3.0.0/bin"' >> ~/.bashrc
source ~/.bashrc Verify the setup:
kafka-topics.sh --version Frequently asked questions
Can I run Kafka directly on Windows without WSL2?
Technically yes, but you will encounter issues. Kafka lacks support for certain Windows-specific behaviors, leading to problems when deleting topics or during log segment rotation.
Can I use Windows Kafka binaries with WSL2 Kafka?
Yes. You can download Kafka binaries on Windows and use commands like kafka-topics.bat against your cluster running in WSL2.
See it in practice with Conduktor
Conduktor Console can connect to your WSL2 Kafka cluster at
localhost:9092from Windows for visual topic management.
Next steps
- Windows KRaft installation for a ZooKeeper-free setup
- CLI tutorials to create topics and produce messages
- Docker setup for an alternative containerized setup