How to Install and Use kmon in Linux to Manage and Monitor Kernel Modules

Administering Linux servers often requires inspecting loaded kernel modules, verifying hardware device driver attachments, or diagnosing hardware resource conflicts. Traditionally, system administrators execute separate disjointed commands—such as lsmod to list active modules, modinfo to view module details, dmesg to parse kernel log ring buffers, and modprobe to insert or remove drivers. kmon (Linux Kernel Manager and Activity Monitor) is an open-source terminal user interface (TUI) written in Rust that consolidates these disparate tasks into a single interactive, real-time dashboard.

What Is kmon in Linux?

Developed to bring modern terminal ergonomics to low-level Linux administration, kmon displays an interactive multi-pane dashboard. Users can scroll through loaded kernel modules, view dependency trees, monitor kernel memory allocation, read live kernel ring buffer activities, and load or unload modules interactively without memorising complex command flags.

Because it queries /sys and /proc directly using native Rust system calls, kmon runs with minimal resource overhead, making it ideal for diagnostics on headless servers and embedded Linux installations.

How to Install kmon on Linux

You can install kmon via precompiled binaries, Cargo, or distribution package managers.

Method 1: Installing via Precompiled Binary (Recommended)

To download and install the standalone binary directly:

curl -fsSL https://github.com/orhun/kmon/releases/latest/download/kmon-x86_64-unknown-linux-gnu.tar.gz -o kmon.tar.gz
tar -xf kmon.tar.gz
sudo mv kmon /usr/local/bin/
rm kmon.tar.gz

Method 2: Installing via Cargo

If you maintain a local Rust development environment:

cargo install kmon

Method 3: Installing on Arch Linux

On Arch Linux, install kmon directly from official repositories:

sudo pacman -S kmon

Confirm the installation was successful by running:

kmon --version

Running kmon and Dashboard Overview

Because querying low-level kernel activities and loading or unloading drivers requires elevated privileges, launch kmon with administrative rights:

sudo kmon

The TUI window is divided into four primary interactive widgets:

  • Modules List: Displays all currently loaded kernel modules, their memory footprint in bytes, and reference counts indicating which child modules or hardware devices depend on them.
  • Module Details: Shows detailed metadata for the currently highlighted module, including author, licence, description, firmware requirements, source file path, and kernel parameters.
  • Kernel Activities (dmesg): Streams kernel log ring buffer events in real time, displaying kernel log levels, timestamps, and subsystem messages.
  • Kernel Information: Displays the active Linux kernel release version, system architecture, total memory usage, and hardware device trees.

Interactive Navigation and Keyboard Controls

Navigating through kernel modules in kmon is fast and intuitive using standard keyboard navigation:

  • Up / Down Arrow or j / k: Scroll vertically through the loaded modules list.
  • Tab: Switch focus between the Modules list, Activity monitor, and details panels.
  • / (Forward Slash): Open live search mode. Type any module name (e.g., iwlwifi, btrfs, or nvidia) to filter the list instantly.
  • Enter: Expand module details and view required dependency trees.
  • s: Sort the module list by name, memory size, or reference count.
  • r: Manually refresh the loaded modules list.
  • q or Esc: Exit kmon cleanly and return to your shell prompt.

Loading and Unloading Kernel Modules Interactively

Rather than dropping to a separate terminal prompt to execute modprobe or rmmod, kmon lets you manage module lifecycles directly from the interface:

Unloading a Module

  1. Navigate to the target module in the list.
  2. Press u (or Delete).
  3. A confirmation prompt will appear, displaying active module dependencies to prevent accidental disconnection of essential storage or networking drivers.
  4. Confirm to unload the module from the running kernel.

Loading a New Module

  1. Press l (Load) in the dashboard.
  2. A prompt box will open. Type the name of the kernel module you wish to insert (along with any optional module parameters).
  3. Press Enter. kmon invokes modprobe internally to resolve dependencies and load the module into memory.

Customising the Dashboard Layout and Refresh Rate

You can launch kmon with custom flags to optimize screen real estate on smaller terminal displays:

sudo kmon --tick-rate 500 --color-theme dark

To view kernel activities exclusively in raw streaming mode:

sudo kmon --read-only

Running in read-only mode prevents accidental module unloads, making it safe for Junior sysadmins or automated diagnostic monitoring screens.

Frequently Asked Questions

Can unloading a module in kmon crash my server?

Yes. Unloading vital kernel drivers—such as disk controller drivers, network interface modules, or filesystem handlers—can cause immediate system panics or lockups. Always verify that a module’s reference count is zero before unloading.

Does kmon permanently disable kernel modules across reboots?

No. Loading or unloading modules in kmon applies strictly to the currently running kernel session in memory. To permanently blacklist a module from loading on boot, add an entry to /etc/modprobe.d/blacklist.conf.

Does kmon work inside SSH sessions and tmux?

Yes, kmon functions flawlessly over remote SSH connections and inside terminal multiplexers like tmux and Zellij without graphical display server dependencies.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.