Kafka + Admin UI (Kafdrop) for Local Development with Docker Compose

Today I was looking for a quick and dirty Apache Kafka setup for local development. After Kafka was up and running, I wanted a simple admin interface to manage Kafka. So I thought I’d share it with everyone who needs to setup Kafka quickly to test something out and don’t want to spend a lot of time on setting everything up.

Talk is easy, show me the code!

Before we get started, check if your machine meets the following requirements:

So, where is it? I’m in a hurry!!

Here you are!

docker-compose.yml with Zookeeper, Kafka and Kafdrop

But, but, how do I use it?

Worry not my fellow developer, its very simple! Just follow the steps below:

  1. Download the file (docker-compose.yml) to a folder in your computer.

It’s running, but how do I access it?

After running docker-compose up in the same folder where you downloaded the file above, three things will happen:

  1. Zookeeper will start and bind to the port 2181

So if everything went right, you can see the Kafdrop UI running on http://localhost:9100. You should see something like this:

After this it’s up to you to discover the features of Kafka and play with it. If you need to connect your application with the cluster, the host/port combination will be: localhost:9092.

Customization & final thoughts

I just want to make it clear that this is just a starting point for new Kafka developers. I’m by no means a Kafka/Docker expert, but this is what worked for me.

If you need (you probably will) more fined grained control over the settings of any of the applications on the compose file, I strongly recommend you to look in their respective DockerHub/Github pages. I will leave the pages of the repos used below.

I hope this small snipped could help you start your next application using this amazing tool, Apache Kafka!

Many thanks to the creators of both of these awesome docker images!

Java Developer during the day, JavaScript enthusiast during the night.