Skip to content
opensensorPublic

About

The fully OSS lightweight network video recorder system witten in C with modern js frontend

Topics

Resources

Security policy

Stars

293 stars

Watchers

5 watching

Forks

Latest commit

 

History

4,123 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LightNVR

License: GPL v3 Container Image Integration Tests Static Analysis Sanitizer Build CodeQL lightnvr-rs

A self-hosted network video recorder that runs on anything from a 256 MB embedded board to a server. LightNVR records your IP cameras, streams them live to the browser over WebRTC or HLS, and finds what matters with detection zones, ONVIF events and licence plate search — all locally, with no cloud account.

Live view

Free to use does not mean free to build. About $10,000 of the maintainer's own money has gone into LightNVR over roughly two years. If it saves you money or supports your customers, please help through the $10K Sustainability Drive or sponsor on GitHub.

What it does

Record

  • Continuous, scheduled, motion- and detection-triggered recording to standard MP4, with a pre-event buffer so clips include what led up to them
  • Retention policies, recording protection and tags, and disk-space management
  • Optional archival to S3, NFS or SAN storage (storage & archive)

Watch

  • Live grid over WebRTC (sub-second) or HLS, with detection overlays — proxied and authenticated through LightNVR, built on go2rtc
  • Recordings browser, a timeline, and an Investigation workspace that reviews up to 16 cameras against one shared clock without hiding gaps in footage
  • Clip and multi-camera export

Detect

  • Polygon detection zones with per-zone object classes and confidence thresholds (zones)
  • External detection through light-object-detect (ONNX/TFLite) or DOODS2, or embedded SOD for small devices (detection engines)
  • ONVIF discovery and camera-side motion events (ONVIF)
  • Licence plate reads with plate search

Run it securely

  • Database-backed users with roles, TOTP multi-factor authentication and API keys
  • A forced password change on first login; go2rtc's API kept on loopback
  • Operational health: OS, container, filesystem and hardware sampling, incidents, and Prometheus metrics (system health)
  • Non-root container image with all capabilities dropped

Integrate

  • REST API with an in-app API reference (API)
  • MQTT events and Home Assistant discovery (MQTT, Home Assistant)

The web UI ships in 19 languages, with light and dark modes and eight colour themes.

Detection zone editor Recordings
Detection zone editor Recordings
Stream configuration System
Per-stream detection settings System health

Quick start

Docker Compose

mkdir lightnvr && cd lightnvr
curl -LO https://raw.githubusercontent.com/opensensor/lightNVR/main/docker-compose.yml
docker compose up -d

Open http://<host>:8080. Images are published to ghcr.io/opensensor/lightnvr for linux/amd64, linux/arm64 and linux/arm/v7 on every release. Volumes, ports, environment variables and upgrades are covered in the Docker guide.

Other ways to install

Home Assistant Add opensensor/lightnvr-hassio-addons under Settings → Add-ons → Add-on Store → ⋮ → Repositories, then install LightNVR. See Home Assistant.
Debian / Ubuntu .deb packages for amd64, arm64 and armhf are attached to each release.
Windows Podman + WSL2
From source Build guide: FFmpeg ≥ 7.1, Node.js 26, CMake. Required for embedded targets.

First login

⚠️ The default login is admin / admin, and the web server listens on all interfaces. Until you change the password, anyone who can reach port 8080 can see your cameras.

LightNVR opens a password-change screen on first login and blocks the rest of the UI until you replace the default. To avoid the default ever being valid, set password in the [web] section of lightnvr.ini before the first start. Locked out? See Authentication issues.

Then add a camera (ONVIF discovery or an RTSP URL), confirm it records, and set a retention policy. The documentation index walks through each step.

Something wrong?

Native C and Rust builds

LightNVR is written in C, and C remains the source of truth: every feature and fix is made there, and the native builds above come from it.

Alongside them, CI translates the C into Rust with C2Rust on every pull request, builds it, and runs the smoke and API contract tests against it. This build, lightnvr-rs, is for organizations whose policies call for software built in a memory-safe language. Starting with 0.47.3, it is published as ghcr.io/opensensor/lightnvr-rs and lightnvr-rs_<version>_sid_amd64.deb.

Today the translation is C-shaped unsafe Rust linking the same native libraries, so its safety properties are essentially those of the C build. It is the foundation for removing unsafe over time, not a finished safe-Rust port. Contributors never edit rust/ by hand. The announcement explains the reasoning.

Requirements

  • Linux on ARM, x86 or MIPS (kernel 4.4+)
  • 256 MB RAM minimum; more for several streams or detection (memory in practice)
  • Cameras that speak RTSP or ONVIF, H.264 or H.265 (camera notes)

Documentation

The documentation index is grouped by task: install, configure, operate, integrate and develop. Common starting points:

Contributing

Pull requests are welcome. Make changes in C under src/ and include/, or in the web UI under web/. CI regenerates the Rust build for you. On your first pull request, the CLA bot will ask you to sign the Contributor License Agreement. Report security issues privately as described in SECURITY.md.

License

LightNVR is licensed under the GNU General Public License v3.0. For proprietary integration or professional support, see commercial licensing.

Star history

Star History Chart

Acknowledgments

LightNVR builds on FFmpeg, go2rtc, SQLite, libuv, llhttp, cJSON, Preact, Tailwind CSS, HLS.js, SOD and light-object-detect — and on everyone who has filed an issue, sent a patch or sponsored the work.

About

The fully OSS lightweight network video recorder system witten in C with modern js frontend

Topics

Resources

Security policy

Stars

293 stars

Watchers

5 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages