Must read
Windows IssuesKafka is not intended to be run on Windows natively and has several issues that may arise over time.
Kafka with KRaft (without Zookeeper) on Windows
- You must have Windows 10 or above
- Install WSL2
- Install Java JDK version 11
- Download Apache Kafka from https://kafka.apache.org/downloads under Binary Downloads
- Extract the contents on WSL2
-
Generate a cluster ID and format the storage using
kafka-storage.sh
- Start Kafka using the binaries in another process in WSL2
- Setup the $PATH environment variables for easy access to the Kafka binaries
Installing WSL2
WSL2 is Windows Subsystem for Linux 2 and provides a Linux environment for your Windows computer that does not require a virtual machine You can use most Linux commands on WSL2 which makes your Kafka installation experience closer to the guides provided for Linux & Mac.Installing WSL2To install WSL2, make sure you’re on Windows 10 version 2004 and higher (Build 19041 and higher) or Windows 11 To check your Windows version do Windows logo key + R, type winver, select OK

Troubleshooting Kafka on WindowsFor troubleshooting common issues, here is a very helpful article from Microsoft.
Set up your Linux username and password
Once the process of installing your Linux distribution with WSL is complete, open the distribution (Ubuntu by default) using the Start menu. You will be asked to create a User Name and Password for your Linux distribution.
- This User Name and Password is specific to each separate Linux distribution that you install and has no bearing on your Windows user name.
- Once you create a User Name and Password, the account will be your default user for the distribution and automatically sign-in on launch.
-
This account will be considered the Linux administrator, with the ability to run
sudo
(Super User Do) administrative commands.
Disable IPv6 on WSL2
WSL2 currently has a networking issue that prevents outside programs to connect to Kafka running on WSL2 (for example your Java programs, Conduktor, etc…); To fix this, we recommend disabling IPv6 on WSL2. Your Windows password will be prompted on the first command:Installing Java JDK 11
To install Apache Kafka on WSL2 Ubuntu, Java 11 is the only prerequisite.- Navigate to Amazon Corretto 11 Linux install page and follow the steps
- For example on Ubuntu (Debian-based systems)
java -version
:
Install Apache Kafka
1. Download the latest version of Apache Kafka from https://kafka.apache.org/downloads under Binary downloads.
2.13-2.8.1
.
Alternatively you can run a wget command
~/kafka_2.13-2.8.1
.
~/kafka_2.13-2.8.1
directory.
Start Kafka
Open another Shell window The first step is to generate a new ID for your cluster76BLQI7sT_ql1mBfKsOk9Q
Next, format your storage directory (replace <uuid>
by your UUID obtained above)
log.dirs
in the config/kraft/server.properties
file (by default /tmp/kraft-combined-logs
)
Now you can launch the broker itself in daemon mode by running this command.

Setup the $PATH environment variable
In order to easily access the Kafka binaries, you can edit your PATH variable by adding the following line to your system run commands to~/.bashrc
:
PATH="$PATH:~/kafka_2.13-2.8.1/bin"
This ensures that you can now run the kafka commands without prefixing them.
After reloading your shell, the following should work from any directory