How to Install and Set Up Kafdrop (Kafka Web UI) on Linux

Complete step-by-step guide to install and run Kafdrop, a Kafka Web UI. Learn Java setup, download the Kafdrop JAR, run with Kafka, create a systemd service, secure access, and troubleshoot common issues.

Kafdrop is a lightweight Kafka Web UI for inspecting brokers, topics, partitions, consumer groups, and messages from your browser. If you want quick visibility into Kafka without using CLI commands for everything, Kafdrop is a practical option.

In this guide, you will install and configure Kafdrop on Linux using the JAR distribution, run it with systemd, and verify it against your Kafka cluster.

What You Will Learn

  • Install Java for Kafdrop
  • Download and run Kafdrop JAR
  • Connect Kafdrop to Kafka brokers
  • Expose Kafdrop on a custom port
  • Run Kafdrop as a persistent systemd service
  • Lock down access for production
  • Troubleshoot startup and connectivity issues

Kafdrop 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 parked offsets, combined and per-partition lag
  • Create new topics
  • View ACLs
  • Support for Azure Event Hubs

Requirements

  • Java 17 or newer
  • Kafka (version 0.11.0 or newer) or Azure Event Hubs

Optional integration:

  • Schema Registry

Kafdrop can run via JAR, Docker, or Kubernetes. This tutorial uses the JAR setup on Linux.

Related guide:

1. Install Java

Kafdrop requires Java. Install OpenJDK 17 (recommended):

1
sudo dnf install -y java-17-openjdk

Verify:

1
java -version

2. Download Kafdrop JAR

Kafdrop releases are published on GitHub: https://github.com/obsidiandynamics/kafdrop/releases

Create a directory for Kafdrop and download the latest release (example uses 3.30.0):

1
2
3
4
sudo mkdir -p /opt/kafdrop
cd /opt/kafdrop/
curl -LO https://github.com/obsidiandynamics/kafdrop/releases/download/3.30.0/kafdrop-3.30.0.jar
mv kafdrop-3.30.0.jar kafdrop.jar

3. Run Kafdrop from the JAR

Start Kafdrop and point it to your Kafka broker(s):

1
2
3
java --add-opens=java.base/sun.nio.ch=ALL-UNNAMED \
    -jar /opt/kafdrop/kafdrop.jar \
    --kafka.brokerConnect=localhost:9092

If not set, kafka.brokerConnect defaults to localhost:9092.

Note: As of Kafdrop 3.10.0, a ZooKeeper connection is no longer required. All necessary cluster information is retrieved via the Kafka admin API.

Open the UI:

http://server_ip:9000/

To use a custom port:

1
--server.port=<port> --management.server.port=<port>

Optional runtime flags

Schema Registry:

1
--schemaregistry.connect=http://localhost:8081

Schema Registry basic auth:

1
--schemaregistry.auth=username:password

Default message format:

1
--message.format=AVRO

Valid format values are DEFAULT, AVRO, PROTOBUF. This can also be configured at the topic level via dropdown when viewing messages.

4. Create a systemd Service for Kafdrop

For production use, run Kafdrop in the background with systemd.

Create a dedicated system user:

1
2
sudo useradd --system --no-create-home --shell /usr/sbin/nologin kafdrop
sudo chown -R kafdrop:kafdrop /opt/kafdrop

Create the service file:

1
sudo vim /etc/systemd/system/kafdrop.service

Add:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
[Unit]
Description=Kafdrop Kafka Web UI
Documentation=https://github.com/obsidiandynamics/kafdrop
Requires=network.target remote-fs.target
After=network.target remote-fs.target

[Service]
Type=simple
User=kafdrop
Group=kafdrop
WorkingDirectory=/opt/kafdrop
ExecStart=/bin/java --add-opens=java.base/sun.nio.ch=ALL-UNNAMED \
    -jar /opt/kafdrop/kafdrop.jar \
    --kafka.brokerConnect=localhost:9092
Restart=always
RestartSec=5
SuccessExitStatus=143
LimitNOFILE=65536

[Install]
WantedBy=multi-user.target

Reload systemd:

1
sudo systemctl daemon-reload

5. Start and Enable Kafdrop

Start the service:

1
sudo systemctl start kafdrop

Check status:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
sudo systemctl status kafdrop
 kafdrop.service - Kafdrop server
   Loaded: loaded (/etc/systemd/system/kafdrop.service; disabled; vendor preset: disabled)
   Active: active (running) since Sat 2022-04-16 10:49:28 UTC; 21s ago
     Docs: https://github.com/obsidiandynamics/kafdrop
 Main PID: 78642 (java)
    Tasks: 22 (limit: 23167)
   Memory: 334.7M
   CGroup: /system.slice/kafdrop.service
           └─78642 /bin/java --add-opens=java.base/sun.nio.ch=ALL-UNNAMED -jar /opt/kafdrop/kafdrop.jar --kafka.brokerConnect=localhost:9092

Apr 16 10:49:35 rockysrv.citizix.com java[78642]: 2022-04-16 10:49:35.046  INFO 78642 [           main] k.c.KafkaConfiguration                   : Checking keystore file kafka.keystore.jks
Apr 16 10:49:35 rockysrv.citizix.com java[78642]: 2022-04-16 10:49:35.046  INFO 78642 [           main] k.c.KafkaConfiguration                   : Checking properties file kafka.properties
Apr 16 10:49:35 rockysrv.citizix.com java[78642]: 2022-04-16 10:49:35.128  INFO 78642 [           main] k.s.BuildInfo                            : Kafdrop version: 3.30.0, build time: 2022-04->
Apr 16 10:49:36 rockysrv.citizix.com java[78642]: 2022-04-16 10:49:36.039  INFO 78642 [           main] o.s.b.a.e.w.EndpointLinksResolver        : Exposing 13 endpoint(s) beneath base path '/a>
Apr 16 10:49:37 rockysrv.citizix.com java[78642]: 2022-04-16 10:49:36.996  INFO 78642 [           main] i.u.Undertow                             : starting server: Undertow - 2.2.16.Final
Apr 16 10:49:37 rockysrv.citizix.com java[78642]: 2022-04-16 10:49:37.011  INFO 78642 [           main] o.x.Xnio                                 : XNIO version 3.8.6.Final
Apr 16 10:49:37 rockysrv.citizix.com java[78642]: 2022-04-16 10:49:37.029  INFO 78642 [           main] o.x.n.NioXnio                            : XNIO NIO Implementation Version 3.8.6.Final
Apr 16 10:49:37 rockysrv.citizix.com java[78642]: 2022-04-16 10:49:37.075  INFO 78642 [           main] o.j.t.Version                            : JBoss Threads version 3.1.0.Final
Apr 16 10:49:37 rockysrv.citizix.com java[78642]: 2022-04-16 10:49:37.139  INFO 78642 [           main] o.s.b.w.e.u.UndertowWebServer            : Undertow started on port(s) 9000 (http)
Apr 16 10:49:37 rockysrv.citizix.com java[78642]: 2022-04-16 10:49:37.727  INFO 78642 [           main] o.s.b.StartupInfoLogger                  : Started Kafdrop in 7.411 seconds (JVM runnin

Enable on boot:

1
sudo systemctl enable kafdrop

6. Open Firewall Port (If Needed)

If you want remote browser access and use firewalld:

1
2
sudo firewall-cmd --add-port=9000/tcp --permanent
sudo firewall-cmd --reload

For public environments, expose Kafdrop through a reverse proxy with authentication instead of opening it directly.

7. Secure Kafdrop in Production

Kafdrop is an admin/observability interface. Treat it as sensitive.

  • Restrict network access to trusted IPs/subnets
  • Put Kafdrop behind NGINX or Traefik with authentication
  • Use HTTPS via reverse proxy (TLS certificates)
  • Run with a dedicated low-privilege Linux user (as shown)
  • Avoid exposing Kafdrop directly to the public internet

8. Navigating the Kafdrop UI

Open a browser and navigate to http://server_ip:9000/.

Cluster Overview

The landing page shows brokers, addresses, controller status, and partition ownership distribution.

Topics List

This is where you will spend most of your time. The topic list is searchable and highlights key metrics such as under-replicated partitions. A non-zero value may indicate broker, storage, or network issues.

Click any topic to open Topic Overview.

Topic Overview

The page shows:

  • Topic summary and health
  • Effective topic configuration
  • Partition list and partition-specific drill-down
  • Consumer groups and aggregate lag

Consumer View

Click a consumer group to view committed offsets, earliest/latest offsets, and lag by partition.

Message View

You can view topic messages from:

  1. Click the View Messages button in the Topic Overview screen.
  2. Click the individual partition link in the Topic Overview.

Messages are listed chronologically and include offset, key, timestamp, and headers. If a payload is valid JSON, Kafdrop can pretty-print it for easier debugging.

9. Troubleshooting Common Issues

Kafdrop does not start

  • Check logs: sudo journalctl -u kafdrop -n 100 --no-pager
  • Confirm Java version: java -version
  • Confirm JAR path exists: /opt/kafdrop/kafdrop.jar

Kafdrop starts but shows no topics

  • Verify broker connectivity from the server host
  • Confirm --kafka.brokerConnect points to reachable broker endpoints
  • Check Kafka listener configuration (advertised.listeners)

Browser cannot reach Kafdrop

  • Confirm service is active: sudo systemctl status kafdrop
  • Confirm Kafdrop is listening: sudo ss -lntp | rg 9000
  • Check firewall/security group rules

Final Thoughts

You now have a complete Kafdrop installation and production-friendly service setup on Linux. With Kafdrop in place, you can inspect topics, track consumer lag, and debug Kafka traffic much faster than using CLI-only workflows.

If you run Kafdrop in production, prioritize access control and TLS through a reverse proxy.

comments powered by Disqus
Citizix Ltd
Built with Hugo
Theme Stack designed by Jimmy