How to install Apache Kafka on Windows without ZooKeeper (KRaft mode)

Install Kafka in KRaft mode on Windows via WSL2: no ZooKeeper needed. Download Kafka, set up WSL2 and Java, format storage, and run a single-node broker.

By Stéphane Derosiaux · October 20, 2026

Install and run Kafka in KRaft mode on Windows

KRaft mode runs Kafka without ZooKeeper, simplifying deployment and reducing resource requirements. This guide walks you through setting up a single-node KRaft cluster using WSL2.

What you'll learn:

  • How to set up WSL2 on Windows
  • How to generate a cluster ID and format storage
  • How to start Kafka in KRaft mode
  • How to configure your PATH for CLI access

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.

KRaft is the only mode in Kafka 4.0 and later: ZooKeeper support was removed. If you have to run an older ZooKeeper-based setup, see the Windows ZooKeeper installation guide (legacy).

Installation overview

Windows Kafka KRaft install flow: install WSL2, install Java, download Kafka, disable IPv6, generate cluster ID, format storage, start Kafka

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

Kafka 4 brokers require Java 17 or later. This guide uses Java 25, the version Kafka recommends today.

In your WSL2 Ubuntu terminal:

wget -O - https://apt.corretto.aws/corretto.key | sudo gpg --dearmor -o /usr/share/keyrings/corretto-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/corretto-keyring.gpg] https://apt.corretto.aws stable main" | sudo tee /etc/apt/sources.list.d/corretto.list
sudo apt-get update
sudo apt-get install -y java-25-amazon-corretto-jdk

Verify the installation:

java -version

Expected output (your patch version may differ):

openjdk version "25.0.4.1" 2026-08-18 LTS
OpenJDK Runtime Environment Corretto-25.0.4.10.1 (build 25.0.4.1+10-LTS)
OpenJDK 64-Bit Server VM Corretto-25.0.4.10.1 (build 25.0.4.1+10-LTS, mixed mode, sharing)

Step 4: Download and extract Kafka

Download Kafka 4.3.1 (Scala 2.13 binary) into your home directory:

cd ~
wget https://archive.apache.org/dist/kafka/4.3.1/kafka_2.13-4.3.1.tgz
tar -xzf kafka_2.13-4.3.1.tgz

A newer 4.x release from kafka.apache.org/downloads works the same way: replace 4.3.1 with its version in every command below.

Step 5: Generate cluster ID

KRaft clusters require a unique identifier:

~/kafka_2.13-4.3.1/bin/kafka-storage.sh random-uuid

This returns a UUID like 76BLQI7sT_ql1mBfKsOk9Q. Save this value.

Step 6: Format storage

Format the log directory using your cluster ID (replace <uuid> with your generated UUID):

~/kafka_2.13-4.3.1/bin/kafka-storage.sh format --standalone \
  -t <uuid> \
  -c ~/kafka_2.13-4.3.1/config/server.properties

This formats the directory specified in log.dirs (default: /tmp/kraft-combined-logs). The --standalone flag sets up this single node as its own controller.

Step 7: Start Kafka

~/kafka_2.13-4.3.1/bin/kafka-server-start.sh ~/kafka_2.13-4.3.1/config/server.properties

Keep this terminal window open. Kafka is now running at localhost:9092 in KRaft mode.

Step 8: Configure PATH

Add Kafka binaries to your PATH:

echo 'export PATH="$PATH:$HOME/kafka_2.13-4.3.1/bin"' >> ~/.bashrc
source ~/.bashrc

Verify the setup:

kafka-topics.sh --version

See it in practice with Conduktor

Conduktor Console can connect to your WSL2 KRaft cluster at localhost:9092 from Windows for visual topic management.

Next steps