Docker setup for Kafka

Kamil Zakiev
Dec 20, 2020

Once I wanted to play with Kafka, I couldn’t find a basic Docker setup to run the cluster and view topics, partitions and messages.

I suspect you have the same issue right now, so let me present you a docker-compose file which will run Kafka cluster with one instance of Zookeeper and three brokers. Also we’ll add a special application to view Kafka internals — Kafdrop.

Now you can you docker-compose tool to spin up the components and open http://localhost:9000/ and browse Kafka internals:

To connect the brokers outside the Docker you should use the following URLs: localhost:9092,localhost:9093,localhost:9094

If you want to dive deeper to Kafka concepts and components you may find usefull next articles:

Happy coding!

--

--

Kamil Zakiev

Developer, team lead. Constant step-by-step learner