- How to install Java 11 (required dependency)
- How to download and configure Kafka
- How to start ZooKeeper and Kafka
- How to set up your PATH for CLI access
Installation overview
Step 1: Install Java JDK 11
Kafka requires Java 11 or later.- Download Amazon Corretto 11 (free OpenJDK distribution)
- Double-click the downloaded
.pkgfile - Follow the installation wizard
Step 2: Download and extract Kafka
- Download Kafka from kafka.apache.org/downloads (choose the latest binary with Scala 2.13)
- Extract the archive to your home directory
Step 3: Start ZooKeeper
ZooKeeper has to be running before Kafka starts. Open a terminal and run:Step 4: Start Kafka
Open a new terminal window and run:localhost:9092.
Step 5: Configure PATH
Add Kafka binaries to your PATH for convenient access. Edit your shell configuration file (~/.zshrc for zsh or ~/.bashrc for bash):
Optional: Change data directories
By default, Kafka stores data in/tmp, which may be cleared on restart.
Change ZooKeeper data directory:
Edit ~/kafka_2.13-3.0.0/config/zookeeper.properties:
~/kafka_2.13-3.0.0/config/server.properties:
See it in practice with ConduktorConduktor Console can connect to your local Kafka cluster at
localhost:9092 for visual topic management.Next steps
- CLI tutorials to create topics and produce messages
- Mac KRaft installation for ZooKeeper-free setup
- Mac Homebrew installation for alternative setup