This document provides detailed instructions for installing LightNVR on various platforms.
- Prerequisites
- Installation Methods
- Platform-Specific Instructions
- Post-Installation Setup
- Upgrading
- Uninstallation
Before installing LightNVR, ensure your system meets the following requirements:
- Processor: Any Linux-compatible processor (ARM, x86, MIPS, etc.)
- Memory: unknown what the minimum is
- Storage: Any storage device accessible by the OS
- Network: Ethernet or WiFi connection
- OS: Linux with kernel 4.4 or newer
Building from source is the recommended method for most installations, as it ensures compatibility with your specific system.
git clone https://github.com/opensensor/lightnvr.git
cd lightnvr
See the Platform-Specific Instructions section for dependency installation commands for your distribution.
# Build in debug mode (default)
./scripts/build.sh
# Or build in release mode (recommended for production)
./scripts/build.sh --release
# Install (requires root privileges)
sudo ./scripts/install.sh
The installation script will:
- Install the binary to
/usr/local/bin/lightnvr
- Install configuration files to
/etc/lightnvr/
- Create data directories in
/var/lib/lightnvr/
- Create a systemd service file
You can customize the installation paths using options:
sudo ./scripts/install.sh --prefix=/opt --config-dir=/etc/custom/lightnvr
See ./scripts/install.sh --help
for all available options.
Docker provides an easy way to run LightNVR without installing dependencies directly on your system.
docker pull lightnvr/lightnvr:latest
mkdir -p /path/to/config
mkdir -p /path/to/recordings
docker run -d \
--name lightnvr \
--restart unless-stopped \
-p 8080:8080 \
-v /path/to/config:/etc/lightnvr \
-v /path/to/recordings:/var/lib/lightnvr/recordings \
lightnvr/lightnvr:latest
# Copy the default configuration
docker cp lightnvr:/etc/lightnvr/lightnvr.conf.default /path/to/config/lightnvr.conf
# Edit the configuration
nano /path/to/config/lightnvr.conf
docker restart lightnvr
Pre-built packages are available for some distributions.
# Add the repository
echo "deb https://packages.lightnvr.org/debian stable main" | sudo tee /etc/apt/sources.list.d/lightnvr.list
wget -qO - https://packages.lightnvr.org/debian/pubkey.gpg | sudo apt-key add -
# Update package lists
sudo apt-get update
# Install LightNVR
sudo apt-get install lightnvr
# Add the repository
sudo dnf config-manager --add-repo https://packages.lightnvr.org/fedora/lightnvr.repo
# Install LightNVR
sudo dnf install lightnvr
LightNVR is available in the AUR:
# Using yay
yay -S lightnvr
# Or using manual AUR installation
git clone https://aur.archlinux.org/lightnvr.git
cd lightnvr
makepkg -si
sudo apt-get update
sudo apt-get install -y \
build-essential \
cmake \
pkg-config \
libsqlite3-dev \
libavcodec-dev \
libavformat-dev \
libavutil-dev \
libswscale-dev \
libmicrohttpd-dev \
libcurl4-openssl-dev \
libssl-dev
sudo dnf install -y \
gcc \
gcc-c++ \
make \
cmake \
pkgconfig \
sqlite-devel \
ffmpeg-devel \
libmicrohttpd-devel \
libcurl-devel \
openssl-devel
sudo pacman -S \
base-devel \
cmake \
sqlite \
ffmpeg \
libmicrohttpd \
curl \
openssl
The Ingenic A1 SoC requires cross-compilation. A detailed guide is provided below.
# Download and extract the toolchain
wget https://github.com/Ingenic-community/mips-linux-toolchain/releases/download/latest/mips-linux-uclibc-toolchain.tar.gz
sudo mkdir -p /opt/mips-linux-toolchain
sudo tar -xzf mips-linux-uclibc-toolchain.tar.gz -C /opt/mips-linux-toolchain
# Install build tools
sudo apt-get update
sudo apt-get install -y build-essential cmake pkg-config
# Clone and build cross-compiled dependencies
git clone https://github.com/lightnvr/ingenic-dependencies.git
cd ingenic-dependencies
./build-all.sh
# Clone the repository
git clone https://github.com/opensensor/lightnvr.git
cd lightnvr
# Build using the cross-compilation script
./scripts/build-ingenic.sh
# Copy the binary and configuration files to the device
scp build/Ingenic/bin/lightnvr root@ingenic-device:/usr/local/bin/
scp config/lightnvr.conf.default root@ingenic-device:/etc/lightnvr/lightnvr.conf
# Create necessary directories on the device
ssh root@ingenic-device "mkdir -p /var/lib/lightnvr/recordings /var/lib/lightnvr/www /var/log/lightnvr"
# Copy web interface files
scp -r web/* root@ingenic-device:/var/lib/lightnvr/www/
Raspberry Pi installation is similar to Debian/Ubuntu, with some optimizations.
sudo apt-get update
sudo apt-get install -y \
build-essential \
cmake \
pkg-config \
libsqlite3-dev \
libavcodec-dev \
libavformat-dev \
libavutil-dev \
libswscale-dev \
libmicrohttpd-dev \
libcurl4-openssl-dev \
libssl-dev
# Clone the repository
git clone https://github.com/opensensor/lightnvr.git
cd lightnvr
# Build with Raspberry Pi optimizations
./scripts/build.sh --release --platform=raspberry-pi
# Install
sudo ./scripts/install.sh
After installing LightNVR, follow these steps to complete the setup:
Edit the configuration file:
sudo nano /etc/lightnvr/lightnvr.conf
At minimum, you should:
- Set a secure password for the web interface
- Configure storage paths
- Set up your camera streams
See CONFIGURATION.md for detailed configuration options.
# Start the service
sudo systemctl start lightnvr
# Enable the service to start at boot
sudo systemctl enable lightnvr
sudo systemctl status lightnvr
Open a web browser and navigate to:
http://your-device-ip:8080
Log in with the username and password configured in the configuration file.
# Navigate to the repository
cd lightnvr
# Pull the latest changes
git pull
# Rebuild
./scripts/build.sh --release
# Stop the service
sudo systemctl stop lightnvr
# Install the new version
sudo ./scripts/install.sh
# Start the service
sudo systemctl start lightnvr
# Pull the latest image
docker pull lightnvr/lightnvr:latest
# Stop and remove the container
docker stop lightnvr
docker rm lightnvr
# Run a new container with the latest image
docker run -d \
--name lightnvr \
--restart unless-stopped \
-p 8080:8080 \
-v /path/to/config:/etc/lightnvr \
-v /path/to/recordings:/var/lib/lightnvr/recordings \
lightnvr/lightnvr:latest
sudo apt-get update
sudo apt-get upgrade lightnvr
sudo dnf upgrade lightnvr
# Using yay
yay -Syu lightnvr
# Or using pacman if installed from AUR
sudo pacman -Syu
# Stop the service
sudo systemctl stop lightnvr
sudo systemctl disable lightnvr
# Remove the service file
sudo rm /etc/systemd/system/lightnvr.service
sudo systemctl daemon-reload
# Remove the binary
sudo rm /usr/local/bin/lightnvr
# Remove configuration and data (optional)
sudo rm -rf /etc/lightnvr
sudo rm -rf /var/lib/lightnvr
sudo rm -rf /var/log/lightnvr
# Stop and remove the container
docker stop lightnvr
docker rm lightnvr
# Remove the image
docker rmi lightnvr/lightnvr:latest
# Remove volumes (optional)
rm -rf /path/to/config
rm -rf /path/to/recordings
sudo apt-get remove --purge lightnvr
sudo dnf remove lightnvr
sudo pacman -Rs lightnvr