To install Apache Kafka on Ubuntu, Java is the only prerequisite. First we shall look into the installation steps of Java and then we shall setup Apache Kafka and run it on the Ubuntu.

Install Apache Kafka on Ubuntu - Setup Apache Kafka on Ubuntu - Apache Kafka Tutorial -

Install Apache Kafka in Ubuntu

Install Java

Open a terminal and run the following command :

kafkauser@tutorialkart:~$sudo apt-get install default-jdk

To verify the installation of java, run the following command in the terminal :

kafkauser@tutorialkart:~$java -version

The output should show the version of java installed, similar to below verbose :

Setup Apache Kafka – Install Apache Kafka on Ubuntu

Download the latest Apache Kafka from [] under Binary downloads.

Extract the .tgz file.

Navigate to root of Apache Kafka folder and open a Terminal. Or Open a Terminal and navigate to the root directory of Apache Kafka.

Start Zookeeper

Apache Kafka depends on Zookeeper for cluster management. Hence, prior to starting Kafka, Zookeeper has to be started. There is no need to explicitly install Zookeeper, as it comes included with Apache Kafka.

From the root of Apache Kafka, run the following command to start Zookeeper :

~$bin/ config/

The zookeeper should be started with a similar following trace in the output.

Start Apache Kafka Server

Open another Terminal and run the following command from the root of Apache Kafka to start Apache Kafka.

~$bin/ config/

Following should be the end of trace stating that Kafka server is started.

Conclusion :

In this Apache Kafka Tutorial, we have successfully learnt to install Apache Kafka on Ubuntu and start Kafka along with Zookeeper.