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

*Install and run Kafka in KRaft mode on macOS in 10 minutes*

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

**What you'll learn:**
- How to install Java 11 (required dependency)
- How to generate a cluster ID and format storage
- How to start Kafka in KRaft mode
- How to configure your PATH for CLI access

> **KRaft vs ZooKeeper**
> KRaft mode became production-ready in Kafka 3.3. For maximum compatibility with older tutorials and tools, see the [Mac ZooKeeper installation guide](https://www.conduktor.io/kafka/how-to-install-apache-kafka-on-mac).

## Installation overview

![Mac Kafka KRaft install flow: install Java 11, download Kafka, generate cluster ID, format storage, start Kafka](https://www.conduktor.io/assets/kafka/diagrams/how-to-install-apache-kafka-on-mac-without-zookeeper-kraft-mode.svg)

```mermaid
flowchart LR
    A[Install Java 11] --> B[Download Kafka]
    B --> C[Generate cluster ID]
    C --> D[Format storage]
    D --> E[Start Kafka]
```

## Step 1: Install Java JDK 11

Kafka requires Java 11 or later.

1. Download [Amazon Corretto 11](https://corretto.aws/downloads/latest/amazon-corretto-11-x64-macos-jdk.pkg) (free OpenJDK distribution)
2. Double-click the downloaded `.pkg` file
3. Follow the installation wizard

Verify the installation:

```bash
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 2: Download and extract Kafka

Download from [kafka.apache.org/downloads](https://kafka.apache.org/downloads) (choose the latest binary with Scala 2.13) and extract:

```bash
cd ~/Downloads
tar -xzf kafka_2.13-3.0.0.tgz
mv kafka_2.13-3.0.0 ~/
```

## Step 3: Generate cluster ID

KRaft clusters require a unique identifier:

```bash
~/kafka_2.13-3.0.0/bin/kafka-storage.sh random-uuid
```

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

## Step 4: Format storage

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

```bash
~/kafka_2.13-3.0.0/bin/kafka-storage.sh format \
  -t <uuid> \
  -c ~/kafka_2.13-3.0.0/config/kraft/server.properties
```

This formats the directory specified in `log.dirs` (default: `/tmp/kraft-combined-logs`).

## Step 5: Start Kafka

```bash
~/kafka_2.13-3.0.0/bin/kafka-server-start.sh ~/kafka_2.13-3.0.0/config/kraft/server.properties
```

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

## Step 6: Configure PATH

Add Kafka binaries to your PATH for convenient access.

Edit your shell configuration file (`~/.zshrc` for zsh or `~/.bashrc` for bash):

```bash
export PATH="$PATH:$HOME/kafka_2.13-3.0.0/bin"
```

Reload your shell:

```bash
source ~/.zshrc
```

Verify the setup:

```bash
kafka-topics.sh --version
```

> **See it in practice with Conduktor**
> [Conduktor Console](https://docs.conduktor.io/guide/conduktor-in-production/admin/configure-clusters) can connect to your KRaft cluster at `localhost:9092` for visual topic management.

## Next steps

- [CLI tutorials](https://www.conduktor.io/kafka/kafka-cli-tutorial) to create topics and produce messages
- [KRaft mode concepts](https://www.conduktor.io/kafka/kafka-kraft-mode) for deeper understanding
- [Mac ZooKeeper installation](https://www.conduktor.io/kafka/how-to-install-apache-kafka-on-mac) for traditional setup
