RHEL BasedRocky Linux

How To Install Darkstat on Rocky Linux 9

Install Darkstat on Rocky Linux 9

In this tutorial, we will show you how to install Darkstat on Rocky Linux 9. For those of you who didn’t know, Darkstat is an open-source, web-based network traffic analyzer that captures and analyzes network traffic. Darkstat provides useful insights into network usage, network top talkers, and traffic breakdown by protocol. In addition, Darkstat offers various features for traffic filtering and statistics generation.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you the step-by-step installation of the Darkstat open-source network traffic analyzer on Rocky Linux. 9.


  • A server running one of the following operating systems: Rocky Linux 9.
  • It’s recommended that you use a fresh OS install to prevent any potential issues.
  • SSH access to the server (or just open Terminal if you’re on a desktop).
  • An active internet connection. You’ll need an internet connection to download the necessary packages and dependencies for Darkstat.
  • A non-root sudo user or access to the root user. We recommend acting as a non-root sudo user, however, as you can harm your system if you’re not careful when acting as the root.

Install Darkstat on Rocky Linux 9

Step 1. The first step is to update your system to the latest version of the package list. To do so, run the following commands:

sudo dnf check-update
sudo dnf update

Step 2. Installing Darkstat Linux Network Traffic Analyzer on Rocky Linux 9.

By default, Darkstat is available on the Rocky Linux 9 base repository. Now we install the latest version of Darkstar using dnf the command:

sudo dnf install darkstat

Step 3. Configuring Darkstat.

After installing Darkstat, we need to configure it to start automatically and capture traffic data. By default, Darkstat listens on port 666, and the network interface is set to eth0. We can modify these settings by editing the configuration file:

nano /etc/darkstat/init.cfg

Change the following lines:

INTERFACE="-i eth0"
PORT="-p 666"
DAYLOG="--daylog darkstat.log"

Save and close the file, then restart the Darkstat service to apply the changes:

sudo systemctl restart darkstat

Step 4. Configure Firewall.

If you’re using Firewalld on RHEL-based distros, you can do the following:

sudo firewall-cmd --zone=public --add-port=666/tcp
sudo firewall-cmd --reload

Step 5. Accessing Darkstat Web Interface.

Once successfully installed, open your web browser and access Darkstat using the URL http://your-IP-address:666. You will be redirected to the following page:

Install Darkstat on Rocky Linux 9

Step 6. Managing Darkstat from the Command Line.

Darkstat provides various command-line options to manage and configure the service. Here are some useful Darkstat command-line options:

  • Setting the listening interface.

By default, Darkstat listens on all available network interfaces. However, you can specify a specific interface to listen on by using the -i option. For example, to listen on the eth0 interface, use the following command:

sudo darkstat -i eth0
  • Specifying the listening port.

By default, Darkstat listens on port 667. You can specify a different port by using the -p option. For example, to listen on port 8080, use the following command:

sudo darkstat -p 8080
  • Enabling traffic filtering.

Darkstat provides a feature to filter traffic based on various criteria such as source IP address, destination IP address, port number, and protocol. You can enable traffic filtering by using the -f option followed by the filter criteria. For example, to filter traffic originating from IP address, use the following command:

sudo darkstat -f "src net"

For additional usage options, read through the Darkstat manpage:

man darkstat

Congratulations! You have successfully installed Darkstat. Thanks for using this tutorial for installing Darkstat web analytics on your Rocky Linux 9 system. For additional help or useful information, we recommend you check the official Darkstat website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!


r00t is a seasoned Linux system administrator with a wealth of experience in the field. Known for his contributions to idroot.us, r00t has authored numerous tutorials and guides, helping users navigate the complexities of Linux systems. His expertise spans across various Linux distributions, including Ubuntu, CentOS, and Debian. r00t's work is characterized by his ability to simplify complex concepts, making Linux more accessible to users of all skill levels. His dedication to the Linux community and his commitment to sharing knowledge makes him a respected figure in the field.
Back to top button