Kafdrop is a lightweight web UI for viewing Apache Kafka topics, consumer groups, and messages. It shows brokers, partitions, replication status, and lets you browse or create topics without using the Kafka CLI.
Apache Kafka is an open-source event streaming platform (originally developed at LinkedIn, now an Apache project) that can handle over a million messages per second. It does not ship with a built-in UI, so inspecting topics and consumer lag usually means using command-line tools. Kafdrop fills that gap with a simple, browser-based interface you can run in Docker or Docker Compose alongside your Kafka cluster.
Features
- View Kafka brokers - topic and partition assignments, and controller status
- View topics - partition count, replication status, and custom configuration
- Browse messages - JSON, plain text, Avro and Protobuf encoding
- View consumer groups – per-partition committed offsets and lag
- Create new topics
- View ACLs
- Support for Azure Event Hubs
Related posts:
- How to install and set up Kafdrop – Kafka Web UI
- How to run Apache Kafka in Docker and Docker Compose
- How to install Apache Kafka on Rocky/Alma Linux 9
- How to install Apache Kafka on Rocky Linux or AlmaLinux 8
Prerequisites
- Docker installed and running. See How to install and configure Docker in Rocky Linux/Alma Linux 9 or How to install and use Docker in Ubuntu 22.04.
- Docker Compose (v2 plugin:
docker compose) or the standalonedocker-compose. Install from Docker Compose releases if needed. - A running Kafka cluster (e.g. Apache Kafka in Docker) that Kafdrop can reach.
Running Kafdrop with Docker
Run Kafdrop as a container that connects to Kafka on 127.0.0.1:9092. Map the container port 9000 to host port 9080 so you can open the UI in your browser.
| |
Verify the container is running:
| |
Open the Kafdrop UI at http://localhost:9080 or http://<server_ip>:9080. If you access it from another machine, allow port 9080 through your firewall (e.g. sudo ufw allow 9080/tcp && sudo ufw reload).
Running with Protobuf descriptors
If your messages use Protobuf encoding, mount the descriptor files and enable the Protobuf format:
| |
Running Kafdrop with Docker Compose
Use Docker Compose to run Kafdrop and Kafka (with Zookeeper) together. Create a docker-compose.yaml file:
| |
Start the stack with Docker Compose v2 (docker compose) or v1 (docker-compose):
| |
Or:
| |
Check that both services are up:
| |
Navigating the UI
Open a browser and go to http://localhost:9080 or http://<server_ip>:9080.
Cluster Overview
The landing page is the Cluster Overview. You see the layout of the cluster, each broker’s address, whether it is the controller, and how many partitions it owns. As the cluster and number of topics grow, aim for a roughly even distribution of partitions across brokers.
Topics list
The Topics list is searchable and shows each topic’s partition count, replication, and config. Watch the under-replicated column: it should be zero. Non-zero values mean some partition replicas have fallen behind and may indicate a broker or network issue.
Click a topic to open the Topic Overview.
Topic overview
The Topic Overview has four areas:
- Top-left: Topic stats (similar to the cluster overview).
- Top-right: Custom topic configuration (if any overrides are set).
- Bottom-left: Partitions; each partition index is a link that opens the first 100 messages for that partition.
- Bottom-right: Consumers – consumer group names and aggregate lag (sum of partition lags).
Click a consumer group to open the Consumer View, which shows committed offsets and lag per partition per topic.
Message view
The Message View lists messages (records) for a chosen partition in order. You can open it by:
- Clicking View Messages in the Topic Overview, or
- Clicking a partition link in the Topic Overview.
Each message shows offset, key (if set), timestamp, and headers. If the payload is valid JSON, Kafdrop can format it when you expand the message (green arrow on the left).
Verifying the setup
- Docker:
docker psshould show the Kafdrop container listening on 9080. - Compose:
docker compose ps(ordocker-compose ps) should showkafdropandkafka(and Zookeeper if applicable) as running. - UI: Opening
http://localhost:9080should show the Cluster Overview; if Kafka is unreachable, you may see connection errors until the broker is up and reachable.
Summary
You can run Kafdrop either as a standalone Docker container (pointing KAFKA_BROKERCONNECT at your existing Kafka) or with Docker Compose alongside Kafka and Zookeeper. Use the UI to inspect brokers, topics, consumer groups, and messages, and to create or delete topics as needed.