How to Install Darkstat on Ubuntu 26.04, 24.04 and 22.04

Install Darkstat on Ubuntu 26.04, 24.04 and 22.04 to monitor network traffic. Configure interfaces and verify service status.

Last updatedAuthorJoshua JamesRead time5 minGuide typeUbuntu

When you need a lightweight way to see which hosts and services are consuming bandwidth, install Darkstat on Ubuntu and expose a small web dashboard without deploying a heavier monitoring stack. It works well on home labs, routers, and headless Ubuntu systems where you want quick visibility into traffic on one interface.

Darkstat is packaged in Ubuntu’s Universe repository on 26.04, 24.04, and 22.04, so the same APT workflow handles installation, configuration, dashboard access, updates, and removal. Debian users should check Debian package availability separately, because this page documents the Ubuntu package workflow. For upstream source, release history, and issue context, use the darkstat GitHub repository.

Update Ubuntu Before Installing Darkstat

Refresh your package lists first so APT sees the current package metadata from your configured Ubuntu repositories.

sudo apt update && sudo apt upgrade

These commands use sudo for package management tasks. If your account does not have sudo access yet, follow the guide on add a new user to sudoers on Ubuntu first.

Install Darkstat on Ubuntu Using APT

Darkstat lives in Ubuntu’s Universe repository. Standard desktop installs usually have Universe enabled already, but some server or minimal images may need it turned on before the package appears.

If APT returns Unable to locate package darkstat, enable Universe first with the guide on enable Universe and Multiverse in Ubuntu, then rerun the install command.

sudo apt install -y darkstat

The -y flag tells APT to accept the confirmation prompt automatically, which keeps the install flow copy-and-paste friendly.

Verify the package state with apt-cache policy so you can confirm both the installed revision and the Ubuntu repository that provided it.

apt-cache policy darkstat
darkstat:
    Installed: 3.0.722-1
    Candidate: 3.0.722-1
    Version table:
 *** 3.0.722-1 500
                500 http://au.archive.ubuntu.com/ubuntu resolute/universe amd64 Packages
                100 /var/lib/dpkg/status

Ubuntu 24.04 reports 3.0.719-1.1build2, and Ubuntu 22.04 reports 3.0.719-1build1, but the install flow stays the same across all three supported Ubuntu LTS releases.

Configure Darkstat on Ubuntu

Darkstat only becomes useful after you point it at a real network interface and restart the service with settings that match your Ubuntu system.

Show Network Interfaces for Darkstat on Ubuntu

List the available interfaces first so INTERFACE matches the device Ubuntu is actually using.

ip -brief link
lo               UNKNOWN        00:00:00:00:00:00 <LOOPBACK,UP,LOWER_UP>
enp0s3           UP             08:00:27:52:d9:70 <BROADCAST,MULTICAST,UP,LOWER_UP>

Use the name from the first column. On many Ubuntu systems that will be something like enp0s3, ens33, or wlp2s0 instead of the older eth0 pattern.

Edit Darkstat Configuration on Ubuntu

Open the packaged config file and replace the placeholder values with settings that match your system.

sudo nano /etc/darkstat/init.cfg

Set or uncomment these lines inside /etc/darkstat/init.cfg:

START_DARKSTAT=yes
INTERFACE="-i enp0s3"
PORT="-p 667"

Replace enp0s3 with your actual interface name. Ubuntu 24.04 and 22.04 need START_DARKSTAT=yes because systemd runs the packaged SysV script. Ubuntu 26.04 ignores that switch, but its native systemd unit still reads INTERFACE and PORT from the same file, so keeping the line set is harmless across the supported releases.

The explicit PORT="-p 667" line keeps the dashboard URL consistent across supported Ubuntu releases. Some older package samples comment a different port, so set the value directly instead of relying on the sample comment. If you want the dashboard reachable only from the local machine, add BINDIP="-b 127.0.0.1" as well.

Start Darkstat on Ubuntu

Enable the service for future boots, then restart it so Darkstat reloads the edited configuration right away.

sudo systemctl enable darkstat
sudo systemctl restart darkstat

Verify that the service is running and enabled before you move on to the dashboard URL.

systemctl is-active darkstat
systemctl is-enabled darkstat
active
enabled

On Ubuntu 24.04 and 22.04, the service description can come from a generated SysV unit, but the configured success state is still active and enabled. If systemctl status darkstat shows active (exited) before traffic flow starts, jump to Troubleshoot Darkstat on Ubuntu below.

Access the Darkstat Dashboard on Ubuntu

This configuration serves the Darkstat dashboard on TCP port 667. Open http://server-ip:667/ in a browser on the same network, replacing server-ip with the Ubuntu system’s address, for example http://192.168.1.100:667/.

From the Ubuntu host itself, use the curl command in Linux to confirm that Darkstat is answering locally before you test remote browser access.

Some minimal or customized Ubuntu installs do not include curl. If the local check reports curl: command not found, install it first.

sudo apt install -y curl
curl --silent --show-error --head --max-time 5 --retry 3 --retry-connrefused --retry-delay 1 http://127.0.0.1:667/
HTTP/1.1 200 OK
Server: darkstat/3.0.722

Ubuntu 24.04 and 22.04 report Server: darkstat/3.0.719, but the key success state stays the same: HTTP/1.1 200 OK.

Darkstat’s web UI is plain HTTP and does not add authentication on its own. Keep it on a trusted network, bind it to localhost, or place it behind another access-controlled layer before exposing it more widely.

If UFW is enabled and you want to reach the dashboard from another machine, follow the guide on configure UFW on Ubuntu and allow TCP port 667. If the dashboard should stay local to the host, keep the firewall closed and use BINDIP="-b 127.0.0.1" instead.

Darkstat is web-based, so it is a good fit for headless Ubuntu systems. You can configure it over SSH using the steps above and then open the dashboard from another host on the same network.

Update or Remove Darkstat on Ubuntu

Darkstat comes from Ubuntu’s standard repositories, so the maintenance workflow stays simple.

Update Darkstat on Ubuntu

Use APT’s single-package upgrade path when you want the newest Darkstat package available for your Ubuntu release without upgrading unrelated software at the same time. The --only-upgrade flag tells APT to refresh Darkstat only if the package is already installed.

sudo apt update && sudo apt install --only-upgrade -y darkstat

Remove Darkstat on Ubuntu

Remove the package if you no longer want Darkstat on the system.

sudo apt remove -y darkstat

If APT reports no-longer-needed dependencies, review them separately before removing anything else. This avoids clearing unrelated packages that were already marked as autoremovable before you installed Darkstat.

sudo apt autoremove --dry-run

Only continue if the preview lists packages you actually want to remove.

sudo apt autoremove

Verify the removal with an installed-state check. This is more reliable than which, command -v, or source/candidate checks in the same shell session.

dpkg-query -W -f='${db:Status-Abbrev} ${binary:Package}\n' darkstat 2>/dev/null | grep '^ii' || echo "Darkstat is not installed"
Darkstat is not installed

After apt remove, Darkstat may remain in rc state while package-owned configuration files remain. The check above looks only for an installed ii state, so it still reports success before the optional purge step below.

Package removal leaves /etc/darkstat/init.cfg and any saved traffic database such as /var/lib/darkstat/darkstat.db behind. Darkstat does not create a standard per-user config tree in a basic Ubuntu install, so the leftover cleanup lives in /etc and /var/lib.

Only run the next commands if you want to delete the saved traffic history and the remaining system files. Skip them if you plan to reinstall Darkstat and keep the same configuration later.

sudo apt purge -y darkstat
sudo rm -rf /var/lib/darkstat

The purge step removes /etc/darkstat, and the manual removal clears /var/lib/darkstat when a saved darkstat.db file kept that directory from disappearing automatically.

Verify that both the config directory and saved database directory are gone after the cleanup step.

if sudo test ! -e /etc/darkstat && sudo test ! -e /var/lib/darkstat; then
    echo "Darkstat config and database removed"
else
    sudo ls -ld /etc/darkstat /var/lib/darkstat 2>/dev/null
fi
Darkstat config and database removed

Troubleshoot Darkstat on Ubuntu

Why does Darkstat show active (exited)?

On Ubuntu 24.04 and 22.04, active (exited) can appear before traffic capture is active. Ensure START_DARKSTAT=yes is set and INTERFACE is a real interface name in /etc/darkstat/init.cfg, then restart and re-check status.

sudo systemctl restart darkstat
systemctl status darkstat --no-pager | sed -n '1,4p'

Which port does Darkstat use?

This article sets PORT="-p 667", so you should use http://server-ip:667/ to open the dashboard. If you do not set that value explicitly, older sample comments in some package versions can default to a different line.

Can Darkstat run on a headless Ubuntu server?

Yes. Configure and start Darkstat from SSH, then open the web dashboard from another host. Keep the bind and firewall settings local or restricted when you do not need remote access.

Does Darkstat have a terminal-only view?

No. Darkstat’s user interface is browser based. For terminal-only live metrics, install Bmon on Ubuntu for interface-focused stats or install Nmon on Ubuntu for broader system monitoring.

Conclusion

Darkstat is installed and configured on Ubuntu with a browser-accessible traffic dashboard on port 667, which gives you quick visibility into bandwidth use without deploying a full monitoring stack. If you also want terminal views, install Bmon on Ubuntu for live interface stats or install Nmon on Ubuntu for broader performance monitoring.

Share this guide

Help another Linux user troubleshoot faster

Share this guide with someone troubleshooting Linux systems or saving it for later.

Follow LinuxCapable

Want more LinuxCapable guides in Google?

Add LinuxCapable as a preferred source so Google can show more of our fresh Linux tutorials in Top Stories and From your sources when relevant.

Add LinuxCapable as a preferred source on Google
Search LinuxCapable

Need another guide?

Search LinuxCapable for package installs, commands, troubleshooting, and follow-up guides related to what you just read.

Found this guide useful?

Support LinuxCapable to keep tutorials free and up to date.

Buy me a coffeeBuy me a coffee
Before commenting, please review our Comments Policy.
Formatting tips for your comment

You can use basic HTML to format your comment. Useful tags currently allowed in published comments:

You type Result
<code>command</code> command
<strong>bold</strong> bold
<em>italic</em> italic
<blockquote>quote</blockquote> quote block

Got a Question or Feedback?

We read and reply to every comment - let us know how we can help or improve this guide.

Verify before posting: