netlens

netlens

Docker app from GeorgeK's Repository

NetLens — a self-hosted dashboard for UniFi networks.

Requirements

A UniFi OS console reachable from this server, and a local API key (UniFi Network > Settings > Control Plane > Integrations > Create API Key).
Overview
NetLens — a self-hosted dashboard for UniFi networks. • Usage per device and app, and the sites each device visited • Live traffic: the internet line, busiest devices and every port • Network map: gateway, switches and APs, each port's traffic and drops • Wi-Fi: signal, roaming, channel suggestions from UniFi's RF scans • Internet: availability, outages, latency, daily totals • Blocked traffic and intrusions, ads apart; daily limits per app and device Keeps 90 days of history (daily totals a year), well beyond UniFi's own. Needs a UniFi OS console and a local API key. Not affiliated with Ubiquiti.

NetLens icon

NetLens

A dashboard for UniFi networks.

Self-hosted, it shows who used how much, of what, and when, how good each device's Wi-Fi is, how your access points, switches and gateway are doing, and what your firewall and intrusion prevention blocked — and it keeps that history, which UniFi itself deletes after a day or a week.

Not affiliated with, endorsed by, or sponsored by Ubiquiti Inc. UniFi is a trademark of Ubiquiti Inc.

Screenshots

Overview — findings and the internet line Day — every device by hour
Overview — findings in plain language, limits on top Activity › Timeline — every device by hour
Usage — apps, categories and top apps Device — traffic, places and events
Activity › Apps — top apps, search by app, category or device Device — in tabs: what stands out, its day by hour, top apps and the latest events
Network — live map with a switch's ports Protection — blocks and intrusions with filters
Network › Map — a card per gateway, switch and access point; a switch selected: each port's traffic, busiest 5 minutes and dropped packets Protection — every block as one incident, with filters; ads and trackers on their own tab
Wi-Fi — radios and channel suggestions Nearby networks — the ones sharing your channels
Network › Wi-Fi — each radio's channel, load and interference; channel suggestions from UniFi's RF scans Network › Wi-Fi › Nearby — of the hundreds of networks around, the loud ones on your channels
Internet — availability, outages, latency and busiest moments Devices — new devices, maker and where they connect
Network › Internet — availability, outages, latency per test target, the busiest moments against your line Devices — what needs you, then every device grouped by where it connects, with its type, signal or speed and today's use
Live — the line, busiest devices and every port Sites — every site each device connected to, by category
Network › Live — the last hour of the line, then live every few seconds; the busiest devices and every port with their own graphs Activity › Sites — every site each device connected to, filtered by category
Alerts — daily limits per app and device Firewall rules — your rules in plain words
Limits — daily limits per app and device Protection › Firewall rules — your UniFi firewall rules in plain words, in order, with how often each blocked something; what the zones do when no rule matches

Screenshots use a made-up demo network, not real data.

Features

  • Overview — what happened today, in plain language: the day's big transfers, devices on weak Wi-Fi or slow wired links, failed Wi-Fi joins, blocked intrusions and firewall hits, new devices, equipment problems, a changed public IP — each linking to the details. Right now: provider, public IP, % up and how much of the line is in use.
  • Activity › Timeline — every device as a row, the day's hours as columns: when each device was busy, when it roamed or reconnected, when something was blocked. Click any hour to see it in 5-minute steps.
  • Network — the internet line, then a card per gateway, switch and access point, from the gateway outward: switch ports as tiles with the devices on each port, Wi-Fi devices by band with their signal, problems counted on each card. Virtual machines and containers fold under the server that runs them; a device the switch lost track of stays at its last known port (↺). Pick any time in the last 90 days to see the network as it was then; History shows internet speed, latency, devices online and every restart or change. Click the internet line for its public-IP history, an access point for its radios, a switch for its ports. Every card shows firmware (UniFi OS for the gateway) and flags an available update or an end-of-life model; the panel adds the model, address, Wi-Fi experience and PoE budget. Switch and gateway ports show what went through them in the last 15 minutes and, in the history, per period with the peak rate: local traffic included (a NAS, a media server), which UniFi's per-app counters never see, how much of its speed each port's busiest 5 minutes used, and how many packets each port dropped (with flow control on or off).
  • Network › Wi-Fi — each access point's radios: channel, width, power, how busy the channel is and how much of that is other networks (on Network 11 also how often frames are sent again and the Wi-Fi experience). Nearby networks, sifted: of the hundreds your access points hear, only the ones loud enough to share a channel you use; the rest stay searchable. Channel suggestions from UniFi's nightly RF scans of every channel, which NetLens keeps over time. A Devices tab: every Wi-Fi device's signal, band, roams and failed joins, and devices stuck on 2.4 GHz that have used 5 or 6 GHz in the last 90 days.
  • Network › Live — the internet line over the last hour, then live every few seconds while the page is open; below it the busiest devices and every port, each with its own graph (click one to draw it over the line). A small live graph on Overview and beside the Network map opens it. UniFi is read for it only while someone is watching.
  • Network › Internet — availability and every outage, latency to UniFi's test targets, the busiest download and upload against your line's speed (each 5 minutes' peak on Network 11), public-address history and UniFi's last speed test.
  • Links near their limit — Overview says when a device's busiest 5 minutes used 80% or more of its link (a TV on a 100 Mbps port playing a 4K film, for example); its page shows the figure.
  • Moves between ports and networks — when a device moves to another port, or its port puts it on another network (VLAN), Overview says so and its page lists every port and network it was on. A port starts over when a different device takes it; a device's own record follows it.
  • Equipment over time — Overview's Network tab lists restarts, times offline and firmware updates in the period; a gateway restart that made the access points look offline is one note.
  • Device — one device in tabs. Summary: today's data, signal or link speed, a short list of what stands out (weak signal, slow link, failed joins, DNS timeouts, being removed from Wi-Fi), its day by hour, top apps and the latest events. Apps and events: every app (and where unidentified traffic went), sessions and events, CSV export. Connection: Wi-Fi joins, Wi-Fi problems, Wi-Fi history (every connect, roam and disconnect, with band, signal and why it left) or every port and network a wired device used, and the server a VM runs on. Online history. Pin it to the sidebar, rename it, set its type, block / unblock.
  • Devices — every device UniFi knows. Tiles on top show what needs you (new devices, failing Wi-Fi joins, weak signal, blocked, no name) and filter the list. Each device shows its type (from UniFi's own fingerprint, or set by you), model (only when UniFi is sure of it) or maker, where it is (access point and signal, or switch port and speed) and what it did today (data and top app). Online devices are grouped by where they connect, by type or by network; offline devices sit at the bottom, most recently seen first; VMs and containers fold under the server they run on. Filter by online, offline, Wi-Fi, wired or pinned, sort by name, data today, last seen or newest. One menu per device: rename (saved in UniFi), set type, pin, check on the network, apps, sites, block / unblock; select several to do it at once. Offline devices are checked on the network every 5 minutes (ping, then common ports, with a MAC check), so a device that is on but not using the internet still shows as there. Failed Wi-Fi joins (couldn't log in, no IP address, DNS failed…) are kept 90 days with the usual cause.
  • Wi-Fi problems from the access points' own log (optional, needs syslog) — why a device left the Wi-Fi (on its own, or removed by the access point and why, with its signal), how often its DNS lookups timed out, the anomalies the access point flags for it, and band steering (how often the access point asked it to move to a better one, and whether it did), kept 90 days. Overview says when a device's lookups keep timing out, when it keeps refusing to move, and when the gateway keeps failing to reach part of itself.
  • Cable link drops from the switch's own log (optional, needs syslog) — each time a wired device's link went down and the speed it came back at, read as going to sleep, waking up, standby or back at full speed; Overview flags a port that keeps dropping for no such reason. UniFi's own traffic-based guesses of what a device is show in its type.
  • Activity › Sites — every site each device connected to over the last 90 days, with a filter per category (social, gaming, school, ads and tracking, AI, adult…), search, and the times of each connection. Taken from UniFi's connection records, not a DNS log (UniFi has none). When a browser's secure DNS hides the name, NetLens names the address if it belongs to a watched site, from its own hourly lookups.
  • Protection › Limits — daily limits on time in use or data for an app or category on a device, e.g. YouTube on the kids' tablet over 2 hours. Flagged on Overview; watch only.
  • Protection — every block as one incident: intrusions (IPS signature, both ends, traffic) and devices stopped by your firewall rules or app blocks, with the rule's name, merged with UniFi's log entry; filters by type, device, site and rule; investigate an outside address; ads and trackers on their own tab.
  • Protection › Firewall rules — UniFi's zone-based firewall rules read hourly and written out in plain words ("Block the Kids network → the apps YouTube, FaceTime", schedules, ports, known DNS services by name), in the order UniFi checks them, with each rule's blocks in the last 7 days; what the zones do when no rule matches; UniFi's built-in rules explained. Also the rest of the Policy Engine: Objects, speed rules (QoS), content filters, local DNS records, port forwards, traffic routes, older traffic rules, NAT and switch ACLs. Threat protection: intrusion prevention, your Content Filtering rules (what each blocks, for which network, safe search) and ad blocking. Read only.
  • Activity › Apps — apps, categories and devices for a day, an hour or up to 90 days; one search box for an app, category or device, and the top apps one click away. Every number on a screen comes from one source and adds up; a built-in audit (npm run audit) checks every day × device × app combination.
  • Local-network traffic (a media server, a NAS) shown separately — UniFi's counters only cover internet traffic.
  • Missing data is marked, never shown as a quiet hour, and filled from UniFi's daily per-device totals where those still exist (on Network 11, from its new statistics engine).
  • Survives UniFi starting over: Network 11 clears UniFi's statistics when it is installed; NetLens keeps its own history and today's traffic carries on from what it had.
  • History export / import, an optional syslog listener for ad-block counts and the access points' Wi-Fi problems.
  • Works on a phone — a bottom bar with every page, and a Back button in the top bar that steps back through what you opened, or up a level when you came straight to a page.
  • API and AI access — an MCP endpoint (/mcp) so Claude or another assistant can ask about your network and make safe changes, and the same operations as a REST API described at /api/openapi.json. See API and AI access.

Why it runs all the time

UniFi keeps fine-grained data only briefly. On the console this was built against:

Data Kept by UniFi
5-minute usage 24 hours
Hourly usage per app 7 days
Connection records (flows) a count cap — 500,000 on a UCG Fiber with storage, ≈ 4 days on a busy network
Daily per-device totals, System Log 90 days
Wi-Fi signal, equipment health only "right now"

NetLens samples the console every 5 minutes and keeps its own copy (usage and connection records 90 days, events and Wi-Fi/equipment samples 90 days, daily totals a year), so history survives.

Requirements

  • A UniFi OS console (UDM, UDM Pro/SE, UCG Ultra/Max/Fiber, UDR, Cloud Key Gen2+). Built and tested on a UCG Fiber running UniFi Network 10.6.
  • A local API key: UniFi Network → Settings → Control Plane → Integrations → Create API Key. It is shown only once — copy it then.
  • Docker (Unraid, Synology, any Linux host). The container must be able to reach the console.

Install

Unraid

Search NetLens in Community Applications, or add the template from unraid/netlens.xml. Start it and open the web UI.

Docker

docker run -d --name netlens --restart unless-stopped \
  -p 3780:3780 \
  -v /path/to/netlens-data:/data \
  gjergjk/netlens:latest

Then open http://<host>:3780. Images: gjergjk/netlens (Docker Hub) and ghcr.io/georgeal78/netlens, for amd64 and arm64.

Docker Compose

See docker-compose.yml.

First start

Open the web UI. A short setup asks for:

  • your UniFi console address and the API key,
  • the site (normally default) and your timezone,
  • a login password — recommended, because the dashboard can block devices (leave both fields empty to run without one).

It checks the connection before finishing. Everything can be changed later in Settings (the icon top right), including the password; Log out is there too. All data lives in /data.

Forgot the password? Start the container once with NETLENS_RESET_PASSWORD=1, set a new password in the browser, then remove the variable.

Backup, restore and moving history

Settings → History: Export history downloads one file with everything saved — usage, connection records, network events, Wi-Fi and equipment samples. Import history… merges such a file into this installation: days it does not have are added, a day it has is replaced only by a fuller copy, and events and samples are added where missing. Use it to move to a new server, to restore a backup, or to bring in history from another installation. Settings, the API key and the password are never in the file. Days older than the 90 days of usage history are skipped.

Optional environment variables

For scripted installs these seed empty settings on the very first start; after that the web UI is in charge: UNIFI_HOST, UNIFI_API_KEY, UNIFI_SITE, UNIFI_SITE_ID, TZ, SIEM_PORT, UI_PASSWORD. UNIFI_PORT (default 3780) is the port inside the container.

Syslog (optional)

Network events come from UniFi's System Log automatically. Syslog adds ad-block hits, the access points' own Wi-Fi problems (why a device left, DNS timeouts, anomalies, band steering), the switches' link drops and the gateway's own errors and device guesses. The container listens on port 5514 (TCP and UDP) by default: publish that port and point UniFi at this server (Settings → CyberSecure → Activity Logging (Syslog) → SIEM Server). For the Wi-Fi problems and link drops, also tick Gateway, Access Points and Switches under Contents › Devices. Clear the port in Settings to turn the listener off. Lines NetLens does not use yet are kept briefly in memory, never saved, at /api/siem/unparsed.

API and AI access

NetLens offers 40 operations (30 that read, 10 that make safe changes) in two forms, built from one list so they always match:

  • MCP at http://<host>:3780/mcp (Streamable HTTP, JSON answers). In Claude, add a custom connector with that address; in Claude Code, claude mcp add --transport http netlens http://<host>:3780/mcp --header "Authorization: Bearer <key>".
  • REST, described at http://<host>:3780/api/openapi.json (OpenAPI 3.1).

Reading covers every page: Overview findings, usage by device and app, sites, devices and presence, the network map now or at any time in the last 90 days, equipment history, Wi-Fi, Protection, alerts and each device's Wi-Fi problems. The safe changes are: rename a device, set its type, pin it to the sidebar, set which device a VM runs on, check a device on the network, add / switch / delete a usage alert, hide or show an Overview finding, and refresh from UniFi. Nothing through this route can block a device, change settings, the password or the key, import or export history, or stop NetLens.

With a login password, every call needs an access key: Settings › API & AI makes one, Read only or Read and safe changes, sent as Authorization: Bearer <key>. Without a password the API is open to anyone on your LAN, like the dashboard.

Security

  • The login password is required on first start: the dashboard can block devices.
  • It is meant for your LAN. Do not expose it to the internet; use a VPN to reach it remotely.
  • Access key (optional): Settings › API & AI makes a key for scripts and assistants, sent as Authorization: Bearer <key>. A read-only key reads the JSON behind every page; a full key also makes the safe changes listed above. Neither can block devices, change settings or export history. Stored as a hash, shown once. /mcp refuses requests from other web pages.
  • The API key never leaves the server: the UI only learns whether one is stored.
  • Passwords are stored as scrypt hashes; sessions are signed cookies; five wrong passwords lock that address out for five minutes. Plain HTTP — fine on a home LAN, not across untrusted networks.

Development

npm install
npm run dev        # API on :3780, UI with hot reload on :5173
npm run build      # production UI into dist/
npm start          # server + built UI on :3780
npm run audit      # every screen must add up (needs a running server)

Node 24+. Data goes to ./database unless UNIFI_DATABASE_DIR is set.

Credits

  • Wi-Fi presence definitions (dwell time, favourite AP, presence pattern) follow unifi-toolkit's Wi-Fi Stalker (MIT); the choice of client and equipment metrics was inspired by Unpoller (MIT). Ideas, not code.
  • Public Suffix List (MPL-2.0).
  • IP address data powered by IPinfo, licensed CC BY-SA 4.0.

See NOTICE.

Changelog

See CHANGELOG.md.

License

GPL-3.0.

Media gallery

1 / 6

Categories

Download Statistics

6,908
Total Downloads

Related apps

Links

Details

Repository
gjergjk/netlens:latest
Last Updated2026-11-05
First Seen2026-10-11

Runtime arguments

Web UI
http://[IP]:[PORT:3780]/
Network
bridge
Privileged
false
Extra Params
--restart=unless-stopped

Template configuration

Web UI portPorttcp

Port for the dashboard in your browser.

Target
3780
Default
3780
Value
3780
DataPathrw

Cache, settings and logs. Keep it on appdata so updates never lose history.

Target
/data
Default
/mnt/user/appdata/netlens
Value
/mnt/user/appdata/netlens
Syslog TCPPorttcp

Optional: for blocked-ad counts. Turn the listener on in the app (Settings, port 5514).

Target
5514
Default
5514
Value
5514
Syslog UDPPortudp

Optional: for blocked-ad counts. Turn the listener on in the app (Settings, port 5514).

Target
5514
Default
5514
Value
5514