Moonfire NVR: Free and Open-Source – Install and Run a Powerful CCTV System in Minutes with Docker (Setup Guide)

Moonfire NVR: Free and Open-Source – Install and Run a Powerful CCTV System in Minutes with Docker (Setup Guide)

Moonfire NVR, originally developed by Scott Lamb, is an open-source network video recorder designed to capture H.264-over-RTSP streams from IP cameras efficiently. It saves video frames to disk while storing metadata in a SQLite3 database, keeping CPU usage low by skipping video decoding or re-encoding.

A Raspberry Pi 2 can handle six 1080p/30fps streams with less than 10% CPU load.

The web interface offers basic functionality, such as a filterable video list and trimming tools, with an experimental live view. However, it lacks motion detection, HTTPS support, and an intuitive web-based configuration UI.

Moonfire NVR is still in early development (pre-1.0), so expect evolving formats and configurations.

It is important to note that Moonfire NVR app lacks native HTTPS/ TLS support, requiring a proxy server for secure connections.

Features

  • RTSP support: Captures H.264-over-RTSP streams from IP cameras, ensuring compatibility with a wide range of devices.
  • Stores video frames on spinning disks for efficient storage.
  • Saves metadata in a SQLite3 database on flash storage for fast access.
  • Generates .mp4 files for any selected time range in real-time without delays.
  • Skips video decoding, analysis, and re-encoding to minimize resource consumption.
  • Runs six 1080p/30fps streams on a Raspberry Pi 2 using less than 10% CPU.
  • Provides a filterable list of video segments and trimming tools for easy management.
  • Offers an experimental live view UI.
  • Runs on minimal hardware like Raspberry Pi, making it a cost-effective solution.
  • Future updates aim to include video analytics and advanced functionalities.
  • Pre-1.0 version with evolving storage and configuration formats.
  • Console-based configuration UI, with web-based setup planned for the future.

Install Moonfire NVR with Docker

In the following is the docker-compose.yml file.

version: 3
services:
  moonfire-nvr:
    # The `vX.Y.Z` images will work on any architecture (x86-64, arm, or
    # aarch64); just pick the correct version.
    image: ghcr.io/scottlamb/moonfire-nvr:v0.7.11
    command: run

    volumes:
      # Pass through `/var/lib/moonfire-nvr` from the host.
      - "/var/lib/moonfire-nvr:/var/lib/moonfire-nvr"

      # Pass through `/etc/moonfire-nvr.toml` from the host.
      # Be sure to create `/etc/moonfire-nvr.toml` first (see below).
      # Docker will "helpfully" create a directory by this name otherwise.
      - "/etc/moonfire-nvr.toml:/etc/moonfire-nvr.toml:ro"

      # Pass through `/var/tmp` from the host.
      # SQLite expects to be able to create temporary files in this dir, which
      # is not created in Moonfire's minimal Docker image.
      # See: <https://www.sqlite.org/tempfiles.html>
      - "/var/tmp:/var/tmp"

      # Add additional mount lines here for each sample file directory
      # outside of /var/lib/moonfire-nvr, e.g.:
      # - "/media/nvr:/media/nvr"

      # The Docker image doesn't include the time zone database; you must mount
      # it from the host for Moonfire to support local time.
      - "/usr/share/zoneinfo:/usr/share/zoneinfo:ro"

    # Edit this to match your `moonfire-nvr` user.
    # Note that Docker will not honor names from the host here, even if
    # `/etc/passwd` is passed through.
    # - Be sure to run the `useradd` command below first.
    # - Then run `echo $(id -u moonfire-nvr):$(id -g moonfire-nvr)` to see
    #   what should be filled in here.
    user: UID:GID

    # Uncomment this if Moonfire fails with `clock_gettime failed` (likely on
    # older 32-bit hosts). <https://github.com/moby/moby/issues/40734>
    # security_opt:
    # - seccomp:unconfined

    environment:
      # Edit zone below to taste. The `:` is functional.
      TZ: ":America/Los_Angeles"
      RUST_BACKTRACE: 1

    # docker's default log driver won't rotate logs properly, and will throw
    # away logs when you destroy and recreate the container. Using journald
    # solves these problems.
    # <https://docs.docker.com/config/containers/logging/configure/>
    logging:
      driver: journald
      options:
        tag: moonfire-nvr

    restart: unless-stopped

    ports:
    - "8080:8080/tcp"

License

GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007

Resources & Downloads

GitHub - scottlamb/moonfire-nvr: Moonfire NVR, a security camera network video recorder
Moonfire NVR, a security camera network video recorder - scottlamb/moonfire-nvr

More open-source CCTV solutions

16 Free CCTV Pentesting Tools To Test Your CCTV Cameras and Feeds Security
While there are many commercial and open-source CCTV systems available for home and business security, many people are unaware that these systems also require security testing. This is crucial to ensure that no unauthorized users have logged in or are accessing unsecured CCTV camera feeds. Best 20 Free Open-source CCTV,
Shinobi: Build Your Own Free Surveillance CCTV NVR System in Minutes with Easy Docker Installation
Shinobi is the Open Source CCTV Solution written in Node.JS. Designed with multiple account system, Streams by WebSocket, and Direct saving to MP4. Shinobi can record IP Cameras and Local Cameras.
Motion and MotionPlus is Your to Go Free CCTV and NVR System
Motion and MotionPlus are highly configurable software programs designed to monitor video signals from various types of cameras and perform specified actions upon detecting movement. Motion, the original software, has been in use since 2000, offering a robust solution for video monitoring needs. MotionPlus is a newly developed application built
DeepCamera: Advanced AI-Powered Video Analytics for Your CCTV and NVR Systems
Open-Source AI Camera. Empower any camera/CCTV with state-of-the-art AI, including facial recognition, person recognition(RE-ID) car detection, fall detection and more
Viseron: Set Up Your Own Free Local CCTV NVR Using Docker (Step-by-Step Tutorial)
Viseron is an open-source self-hosted CCTV and local-first NVR solution with AI-powered computer vision support. It comes with amazing powerful features as Object detection, motion detection, face recognition, image classification, and supports hardware acceleration. Key features * Object Detection: YOLOv3/v4/v7 (OpenCV), Tensorflow (Google Coral EdgeTPU), CodeProject.AI * Motion Detection
SmartCCTV: Build Your Own Free AI-Powered Raspberry Pi CCTV System
Build your own home Raspberry Pi-powered surveillance IoT camera with Face recognition, access your live feed from any device
Top 8 Free CCTV Solutions For Home Security and Small Businesses
What is an open-source CCTV? An open-source CCTV system is a type of security camera system that is developed using open-source software. This means that the source code for the software is freely available to the public, allowing developers to modify and improve upon the system as needed. Open-source CCTV
16 Open-source Projects to Build a CCTV System With Raspberry Pi
Raspberry Pi is still the most popular affordable SBC (Single Board Computer). It is used as the core in many of projects for education, healthcare, security, and IoT. In this post, we list the best Raspberry Pi project that will give good alternatives for anyone who want to build their







Open-source Apps

9,500+

Medical Apps

500+

Lists

450+

Dev. Resources

900+

Read more