How to Install Darkstat on Ubuntu 22.04 or 20.04

Darkstat is a powerful network traffic analyzer that captures and visualizes data about network usage. It is a free and open-source tool that can be used to monitor network traffic and identify potential issues. Darkstat was originally developed by Emil Mikulic in 2001 and has since been maintained by a community of developers.

Here are some of the key features and benefits of using Darkstat:

  • Easy to install and use: Darkstat is available in the official Ubuntu repositories and can be easily installed using the APT package manager.
  • Real-time traffic monitoring: Darkstat captures and analyzes network traffic in real time, allowing you to see the traffic on your network as it happens.
  • Wide range of network interface support: Darkstat can monitor a variety of network interfaces, including Ethernet, Wi-Fi, and virtual interfaces.
  • Detailed statistics and graphs: Darkstat provides detailed statistics and graphs about network usage, making it easy to identify potential issues and optimize your network performance.
  • Traffic filtering and sorting: Darkstat allows you to filter and sort network traffic based on various criteria, including source and destination IP address, protocol, and port number.
  • Report generation: Darkstat can generate reports in various formats, including HTML, CSV, and XML.
  • Automatic startup: Darkstat can be configured to start automatically at boot time, making it easy to ensure that it is always running on your system.
  • IPv4 and IPv6 support: Darkstat supports both IPv4 and IPv6 networks.

With Darkstat, you can identify potential security threats, detect bandwidth-hogging applications or devices, analyze network usage patterns to optimize your network infrastructure, and troubleshoot network performance issues. This guide will demonstrate how to install Darkstat on Ubuntu 22.04 Jammy Jellyfish or Ubuntu 20.04 Focal Fossa using the APT package manager with Ubuntu’s default repository.

Step 1: Install Darkstat

Darkstat is a network traffic analyzer available in the official Ubuntu repositories. This means that you can install it using the apt package manager.

sudo apt update && sudo apt install darkstat

The apt update command updates the package list on your system, while the apt install command installs the Darkstat package and its dependencies.

After the installation is complete, you can verify that Darkstat is running by checking its status using the following command:

systemctl status darkstat

This command will check the status of the Darkstat service and provide information about whether it is running. If Darkstat is running, you should see a message indicating it is active and running.

Example of Darkstat status on Ubuntu:

Step 2: Configure Darkstat

To configure Darkstat, you must set the network interface it should monitor. The network interface is the physical or virtual device that connects your system to the network. This can be a wired Ethernet interface, a wireless interface, or a virtual interface created by a VPN.

To find the name of the network interface that you want to monitor, open a terminal and run the following command:

ip link

This will display a list of network interfaces on your system. Look for the interface you want to monitor and take note of its name. In the following steps, the guide will assume that the interface’s name is eth0.

Open the configuration file for Darkstat by running the following command:

sudo nano /etc/darkstat/init.cfg

Uncomment the following line to enable Darkstat to start automatically at boot time:


Change it to:


Set the network interface that Darkstat should monitor by editing the following line:


Replace INTERFACE=”” with the name of the network interface that you want to monitor. As explained, the guide will use a generic name, “eth0”.


Changing the PORT variable allows you to set a different port number for the Darkstat web interface. By default, Darkstat uses port 667, which you can change now or later. Save the changes and exit the editor with CTRL+X, then press Y.

Restart Darkstat by running the following command:

sudo systemctl restart darkstat

Example of Darkstat configuration file on Ubuntu using the guide’s machine:

Step 3: Launch Darkstat

After configuring Darkstat, you can use the web interface to monitor network traffic. Open a web browser on your Ubuntu system and enter the IP address of your system, followed by port number 667 in the address bar. For example, if the IP address of your Ubuntu system is, enter the following in the address bar:

You should see the Darkstat web interface, which displays information about the network traffic on your system. Use the various tabs and options in the interface to view and analyze the network traffic.


This guide has introduced Darkstat, a network traffic analyzer that can help you monitor and optimize your network performance. This guide demonstrated how to install Darkstat on Ubuntu 22.04 Jammy Jellyfish or Ubuntu 20.04 Focal Fossa. Following the steps outlined in this guide, you can start using Darkstat to monitor network traffic on your Ubuntu system and gain insights into your network performance.

Additional Resources and Links

To enhance your understanding of Darkstat and assist with its installation on Ubuntu, the following official resources and documentation are provided:

  • Darkstat Official Website: Visit the official website to explore Darkstat’s features, updates, and news directly from the developers.
  • Ubuntu Official Documentation: Gain comprehensive knowledge about Ubuntu, its features, and system administration through the official documentation.
  • Ubuntu Wiki: The Ubuntu Wiki offers a wealth of information on various topics, including troubleshooting, community support, and development.

Share to...