Install Kyanos Network Analysis Tool on Ubuntu 24.04

Install Kyanos Network Analysis Tool on Ubuntu 24.04

Kyanos is a command line tool designed for real-time network traffic analysis using eBPF (Extended Berkeley Packet Filter) technology. It provides deep visibility into application-layer protocols such as HTTP, Redis, and MySQL, facilitating efficient troubleshooting and performance monitoring. This tutorial explains how to install Kyanos network analysis tool on Ubuntu 24.04.

Install Kyanos

Get the latest Kyanos release tag from GitHub and save it in a variable:

KYANOS_VERSION=$(curl -s "https://api.github.com/repos/hengyoush/kyanos/releases/latest" | grep -Po '"tag_name": "v\K[0-9.]+')

Download tar.gz file from releases page:

wget -qO kyanos.tar.gz https://github.com/hengyoush/kyanos/releases/latest/download/kyanos_${KYANOS_VERSION}_linux_amd64.tar.gz

Unpack the executable to the /usr/local/bin directory:

sudo tar xf kyanos.tar.gz -C /usr/local/bin kyanos

Once installed, we can check the Kyanos version like this:

kyanos version

We can delete the unused tar.gz file:

rm -rf kyanos.tar.gz

Testing Kyanos

Before testing, make sure you have installed HTTP server such as Nginx or Apache.

To use Kyanos, run it with sudo privileges, since it needs elevated permissions to access network data. For example, the command:

sudo kyanos watch http

This command starts real-time monitoring of HTTP traffic on the system. Open URL in the browser and check captured requests by Kyanos in the terminal.

Captured HTTP requests by Kyanos on Ubuntu

When you're done, you can exit Kyanos by pressing CTRL+C.

Uninstall Kyanos

To remove Kyanos, delete the associated file:

sudo rm -rf /usr/local/bin/kyanos

Leave a Comment

Cancel reply

Your email address will not be published.