Download the latest version of Apache Kafka. Extract the folder and move it to the bin folder. Start ZooKeeper, which is essential to start with the Kafka cluster. ZooKeeper is the coordination service to manage the brokers, leader election for partitions, and alerts when Kafka changes topics (i.e. deletes topic, creates topic, etc.) or brokers (add broker, dead broker, etc.). In this example, I have started only one ZooKeeper instance. In production environments, we should have more ZooKeeper instances to manage fail-over. Without ZooKeeper, the Kafka cluster cannot work.
Create a directory for extracting Kafka
sudo mkdir /opt/kafka
sudo tar -xvzf ~/Downloads/kafka.tgz --directory /opt/kafka --strip-components 1