The darkstat utility is an efficient network traffic analyzer that captures network traffic, calculates usage statistics, and serves reports over an embedded lightweight HTTP web server. On minimal Linux server distributions, container base images, and cloud server instances, darkstat is omitted by default, returning the bash: darkstat: command not found error when executing network inspections.
Install darkstat on Ubuntu, Debian, and Derivatives
On Debian-based systems, darkstat is maintained directly in the universe software repositories:
- Update your local package lists:
sudo apt update - Install the
darkstatpackage:sudo apt install -y darkstat - Confirm successful installation and view the binary path:
which darkstat darkstat --version
Install darkstat on RHEL, AlmaLinux, Rocky Linux, and Arch Linux
On enterprise Linux distributions and rolling releases, darkstat can be installed via EPEL or the Arch User Repository:
- On RHEL or Rocky Linux, enable EPEL and install via DNF:
sudo dnf install -y epel-release && sudo dnf install -y darkstat - On Arch Linux, install from the official extra repositories:
sudo pacman -Syu darkstat
Launch darkstat and Access Embedded Web Reports
Start the traffic monitor bound to a specific network interface and port:
- Launch darkstat listening on interface
eth0and serving reports on port 667:sudo darkstat -i eth0 -p 667 --no-promisc - Open your web browser and navigate to
http://server-ip:667to review real-time host traffic tables, protocols, and bandwidth graphs. - To run darkstat permanently as a background service on Debian/Ubuntu, edit
/etc/darkstat/init.cfg, setSTART_DARKSTAT=yes, and runsudo systemctl restart darkstat.