On this page
- What does ntopng give you?
- What do you need before installing?
- How do you install ntopng?
- How do you configure the interface and web port?
- How do you open the dashboard safely?
- Which screens should you look at first?
- How do you check that it captures traffic?
- How do you keep ntopng updated and lean?
- Questions
What does ntopng give you?
ntopng is a network traffic probe with a web interface. It reads packets from an interface, groups them into flows and hosts, and identifies application protocols with its nDPI library, so instead of raw packets you see "this address downloaded 2 GB over TLS from that host in the last hour". It fills the gap between live command line tools such as iftop and nethogs and plain monthly counters such as vnstat from the usage monitoring tutorial.
On a single VPS the most useful views are top talkers (which remote hosts move the most data), the protocol breakdown, active flows with their duration and bytes, and per host history. That is enough to spot scraping bots, a misbehaving sync job, or unexpected outgoing connections.
What do you need before installing?
Use Ubuntu 24.04, Ubuntu 22.04, Debian 12 or Debian 13 with a sudo user and SSH key login as described in the SSH hardening tutorial. ntopng keeps its host and flow tables in memory and uses Redis for settings, so give it some headroom: a plan with 2 GB of RAM is comfortable for one busy interface, and more helps if the server also runs your application. Find the interface name first:
ip route show defaultThe examples use eth0. Also pick a free local port for the web interface. The default is 3000, which other tools such as Grafana also like to use; check with sudo ss -tlnp | grep 3000 and choose 3001 or similar if it is taken.
How do you install ntopng?
The distribution archive is the simplest source. See which version your release offers, then install:
sudo apt update
apt policy ntopng
sudo apt install -y ntopng
ntopng --version
systemctl status ntopng redis-server --no-pagerThe package pulls in Redis and starts both services. If you want a newer release than your distribution ships, the ntop project runs its own apt repository: download the small repository package for your release from its install page, install it with sudo apt install ./apt-ntop-stable.deb, then sudo apt update and sudo apt install ntopng. Builds from that repository can unlock paid editions with a licence and run as the free Community edition without one. Use one source or the other, not both.
How do you configure the interface and web port?
ntopng reads its options from a configuration file with one option per line. Ask systemd which file your package uses, then edit it:
systemctl cat ntopng
sudo nano /etc/ntopng/ntopng.confA small, safe configuration for a single server:
-i=eth0
-w=127.0.0.1:3000
-m=198.51.100.24/32,2001:db8:4f2a::/64
-d=/var/lib/ntopng-i picks the capture interface (repeat it for wg0 or a Docker bridge). -w binds the web server to localhost only, so it is not reachable from the internet at all. -m marks your own addresses as local, which makes the host lists and charts much clearer. -d is the data directory for charts and state. Apply the change and confirm the listener:
sudo systemctl restart ntopng
sudo ss -tlnp | grep ntopng
journalctl -u ntopng -n 30 --no-pagerThe ss line should show 127.0.0.1:3000, not 0.0.0.0 or *.
How do you open the dashboard safely?
Use an SSH tunnel from your own computer. It forwards a local port through the encrypted SSH connection to the localhost listener on the server:
ssh -N -L 3000:127.0.0.1:3000 deploy@198.51.100.24Leave that running and open http://127.0.0.1:3000 in your browser. The first sign in uses the user admin with the password admin, and ntopng asks you to set a new password right away. Do that before anything else.
This approach needs no new firewall rule: SSH stays the only open management port. If several people need the dashboard, put it behind a reverse proxy with HTTPS and a password instead, as shown in the nginx reverse proxy guide, and keep ntopng itself on localhost.
Which screens should you look at first?
Start on the dashboard for the interface: it shows current throughput, the top local and remote hosts and the top application protocols. Then:
- Hosts lists every address seen, with bytes sent and received, first and last seen times, and country where geolocation data is configured.
- Flows lists active connections with protocol, duration, client and server, and live throughput. Sort by bytes to find the heavy ones.
- Interface charts show traffic over time and per protocol, which helps you match a spike with an event such as a nightly backup.
- Alerts collect events that ntopng considers unusual, such as scans or blacklisted hosts. Review them, but confirm with your own logs before acting.
Clicking any host opens its own page with traffic history, contacted peers and the protocols it used.
How do you check that it captures traffic?
Generate some traffic you can recognise and look for it. From the server, download a file while the dashboard is open:
curl -s -o /dev/null https://example.net/The flow should appear in the Flows list with your server as client and the TLS protocol. If the interface shows no traffic at all, check the name in -i, look at journalctl -u ntopng for permission or interface errors, and make sure Redis is running with systemctl status redis-server, since ntopng cannot start properly without it.
How do you keep ntopng updated and lean?
Updates arrive through sudo apt upgrade from whichever source you installed. The data directory grows with the number of hosts seen, because ntopng keeps charts for them; check it from time to time with sudo du -sh /var/lib/ntopng. On a public server the number of remote hosts can be large, so keep -m accurate and consider limiting per host charts in the preferences if the directory grows quickly. If memory use climbs on a small plan, watch it with the tools in the btop and htop guide; when the server needs more room, move to a larger plan as in the migration tutorial.
Plans that fit this guide
Base city prices. Every plan includes a dedicated IPv4 address, IPv6, full root and all 18 images.
Questions about Traffic analysis with ntopng
Is ntopng free?
The Community edition is free and open source. The vendor also sells editions with extra features, which this guide does not need.
Why does the web interface not load in my browser?
With -w=127.0.0.1:3000 it only listens on the server itself. Start the SSH tunnel first and open http://127.0.0.1:3000 on your own computer.
Can ntopng see traffic inside my WireGuard tunnel?
Yes, if you add -i=wg0. On eth0 the tunnel appears only as encrypted UDP to the peer.
Does it store full packet contents?
No. ntopng stores flow and host statistics, not payloads. For full packets use tcpdump with a file.
Can I run ntopng on Rocky Linux or AlmaLinux?
The ntop project provides packages for those systems too, but this guide covers only the Ubuntu and Debian route.
More in Networking and diagnostics
- FreeRADIUS with PostgreSQL
- IPv6 on your server
- The ip command
- DNS lookups with dig
- Listening ports with ss and netstat
- Test ports and transfer data with netcat
- Trace network paths with mtr
- Capture packets with tcpdump
- Live bandwidth with iftop and nethogs
- HTTP requests with curl
- Dynamic DNS updates from a server
- Latency graphs with SmokePing
- Check which ports are reachable