Atlantic.Net Blog

How to Install and Use Darkstat Web Based Linux Network Traffic Analyzer

Hitesh Jethva
by Atlantic.Net (273 posts) under Tutorials, VPS Hosting
0 Comments

If you are a system administrator managing a Linux server, you want a simple tool that helps to monitor your server. Darkstat is a network traffic monitoring tool that calculates and reports usage statistics sent over the HTTP server. It is a lightweight, simple, and real-time network statistics tool with an integrated webserver. Darkstat supports IPv6 protocol and asynchronous reverse DNS resolution.

In this post, we will show you how to install and use Darkstat Network Traffic Analyzer in Linux.

Prerequisites

  • An Ubuntu 20.04 or CentOS 8 server on the Atlantic.Net Cloud Platform
  • A root password configured on your server

Step 1 – Create Atlantic.Net Cloud Server

First, log in to your Atlantic.Net Cloud Server. Create a new server, choosing Ubuntu 20.04 or CentOS 8 as the operating system with at least 2GB RAM. Connect to your Cloud Server via SSH and log in using the credentials highlighted at the top of the page.

Once you are logged in to your server, run the following command to update your base system with the latest available packages.

apt-get update -y

Or

dnf update -y

Step 2 – Install Darkstat

By default, Darkstat is included in the default repository of all major Linux operating systems.

For Ubuntu and Debian operating systems, install Darkstat with the following command:

apt-get install darkstat -y

For CentOS and RHEL operating systems, install Darkstat with the following command:

dnf install darkstat -y

Once the Darkstat package is installed, you can proceed to the next step.

Step 3 – Configure Darkstat

Next, you will need to edit the Darkstat main configuration file and define your network interface, port, and listening IP address:

nano /etc/darkstat/init.cfg

Change the following lines:

START_DARKSTAT=yes
INTERFACE="-i eth0"
DIR="/var/lib/darkstat"
PORT="-p 666"
BINDIP="-b 0.0.0.0"
DAYLOG="--daylog darkstat.log"

Save and close the file when you are finished, then restart the Darkstat service to apply the changes:

systemctl restart darkstat

You can now check the status of the Darkstat with the following command:

systemctl status darkstat

You should see the following output:

● darkstat.service - LSB: start darkstat monitoring system at boot time
     Loaded: loaded (/etc/init.d/darkstat; generated)
     Active: active (running) since Sun 2021-08-15 07:40:05 UTC; 6s ago
       Docs: man:systemd-sysv-generator(8)
    Process: 6092 ExecStart=/etc/init.d/darkstat start (code=exited, status=0/SUCCESS)
      Tasks: 2 (limit: 2353)
     Memory: 792.0K
     CGroup: /system.slice/darkstat.service
             ├─6100 /usr/sbin/darkstat -i eth0 -p 666 --chroot /var/lib/darkstat --pidfile /var/run/darkstat.pid -b 0.0.0.0 --daylog darkstat.>
             └─6101 /usr/sbin/darkstat -i eth0 -p 666 --chroot /var/lib/darkstat --pidfile /var/run/darkstat.pid -b 0.0.0.0 --daylog darkstat.>

Aug 15 07:40:05 ubuntu2004 systemd[1]: Starting LSB: start darkstat monitoring system at boot time...
Aug 15 07:40:05 ubuntu2004 darkstat[6092]:  * Starting darkstat network daemon : darkstat
Aug 15 07:40:05 ubuntu2004 darkstat[6092]:  * done
Aug 15 07:40:05 ubuntu2004 darkstat[6092]:    ...done.
Aug 15 07:40:05 ubuntu2004 systemd[1]: Started LSB: start darkstat monitoring system at boot time.

Step 4 – Access Darkstat Web UI

At this point, Darkstat is running and listening on port 666. You can check it with the following command:

ss -antpl | grep 666

You should see the following output:

LISTEN    0         128                0.0.0.0:666              0.0.0.0:*        users:(("darkstat",pid=6100,fd=8))

Now, open your web browser and access the Darkstat web interface using the URL http://your-server-ip:666. You should see the following screen:
Darkstate Dashboard Page
Now, click on the hosts tab. You’ll get a list of all hosts on the network that have attempted to reach the server:
Darkstate Hosts Information Page

Conclusion

In this guide, we explained how to install and use Darkstat in Linux to capture network traffic over the HTTP. Hopefully this tool will help you to make your Linux server admin job easier; try it out on your Atlantic.Net VPS hosting account!

Get A Free To Use Cloud VPS

Free Tier Includes:
G3.2GB Cloud VPS Free to Use for One Year
50 GB of Block Storage Free to Use for One Year
50 GB of Snapshots Free to Use for One Year


Looking for a Hosting Solution?

We Provide Cloud, Dedicated, & Colocation.

  • Seven Global Data Center Locations.
  • Flexible Private, Public, & Hybrid Hosting.
  • 24x7x365 Security, Support, & Monitoring.
Contact Us Now! Med Tech Award FTC
SOC Audit HIPAA Audit HITECH Audit

Recent Posts

Get started with 12 months of free cloud VPS hosting

Free Tier includes:
G3.2GB Cloud VPS Server Free to Use for One Year
50 GB of Block Storage Free to Use for One Year
50 GB of Snapshots Free to Use for One Year


New York, NY

100 Delawanna Ave, Suite 1

Clifton, NJ 07014

United States

San Francisco, CA

2820 Northwestern Pkwy,

Santa Clara, CA 95051

United States

Dallas, TX

2323 Bryan Street,

Dallas, Texas 75201

United States

Ashburn, VA

1807 Michael Faraday Ct,

Reston, VA 20190

United States

Orlando, FL

440 W Kennedy Blvd, Suite 3

Orlando, FL 32810

United States

Toronto, Canada

20 Pullman Ct, Scarborough,

Ontario M1X 1E4

Canada

London, UK

14 Liverpool Road, Slough,

Berkshire SL1 4QZ

United Kingdom

Resources