### Build Script with Custom Options Source: https://github.com/dciancu/unifi-protect-unvr-docker-arm64/blob/main/README.md Executes the build script with environment variables to customize the build process. This example builds the edge image and tags it with the Protect version. ```bash BUILD_EDGE=1 BUILD_TAG_VERSION=1 bash build.sh ``` -------------------------------- ### Build Unifi Protect Docker Image (Bash) Source: https://context7.com/dciancu/unifi-protect-unvr-docker-arm64/llms.txt Builds the Unifi Protect Docker image. Options like `BUILD_STABLE=1`, `BUILD_EDGE=1`, `DOCKER_NO_CACHE=1`, and `BUILD_PRUNE=1` control the build process, enabling stable or edge versions, disabling Docker cache, and pruning old images respectively. Use `BUILD_STABLE=1` for initial setup and `BUILD_EDGE=1` for updating to the latest versions. ```bash # 1. Build the image BUILD_STABLE=1 bash build.sh ``` ```bash # 2. Rebuild image with latest version BUILD_EDGE=1 bash build.sh ``` ```bash # Force rebuild without Docker cache DOCKER_NO_CACHE=1 BUILD_EDGE=1 bash build.sh ``` ```bash # Remove all old Protect images and prune build cache BUILD_PRUNE=1 BUILD_EDGE=1 bash build.sh ``` -------------------------------- ### Docker Compose Commands (Linux) Source: https://context7.com/dciancu/unifi-protect-unvr-docker-arm64/llms.txt Commands to manage the UniFi Protect Docker container on Linux using Docker Compose, including starting, viewing logs, and stopping the container. ```bash # Start container with override configuration docker compose -f docker-compose.yml -f docker-compose.override.yml up -d # View logs docker compose logs -f # Stop container docker compose down ``` -------------------------------- ### Manage Docker Compose Services (Bash) Source: https://context7.com/dciancu/unifi-protect-unvr-docker-arm64/llms.txt Commands for managing the Unifi Protect Docker container using Docker Compose. Includes starting the container in detached mode (`up -d`), stopping it (`stop`), and viewing logs in real-time (`logs -f`). These are essential for deployment, updates, and monitoring. ```bash # 4. Start container docker compose up -d ``` ```bash # Backup existing data docker compose stop ``` ```bash # 3. Update container docker compose up -d ``` ```bash # 4. Monitor update process docker compose logs -f ``` -------------------------------- ### Docker Compose Override for Configuration Source: https://github.com/dciancu/unifi-protect-unvr-docker-arm64/blob/main/README.md Example Docker Compose override file to configure Unifi Protect service. It allows mounting devices, setting storage disks, and enabling debug modes. ```yaml services: unifi-protect: # If needed to mount device inside container. # devices: # - /dev/sda:/dev/sda environment: - STORAGE_DISK=/dev/sda # Set DEVICE to change the default device (UNVR). # - DEVICE=UNVR_PRO # Set DEBUG mode to enable all debug options below. # - DEBUG=true # Set DEBUG_STORAGE to enable storage disk operations logging. # - DEBUG_STORAGE=true # Set DEBUG_UNIFI_CORE to enable unifi-core debug log level. # - DEBUG_UNIFI_CORE=true ``` -------------------------------- ### Build UniFi Protect Docker Image with Custom Firmware Source: https://context7.com/dciancu/unifi-protect-unvr-docker-arm64/llms.txt Allows building the Docker image with a custom firmware URL or a specific Protect package URL. This provides flexibility in choosing the UniFi Protect version. ```bash # Download specific firmware version FW_URL="https://fw-download.ubnt.com/data/unifi-nvr/5ed4-UNVR-4.4.3-4bb9917e-83bf-44a8-bbb1-1529e539d74b.bin" \ BUILD_STABLE=1 \ bash build.sh # Build with custom Protect package PROTECT_URL="https://example.com/custom-unifi-protect.deb" \ BUILD_EDGE=1 \ bash build.sh ``` -------------------------------- ### Network Interface Configuration for Remote Access (Linux) Source: https://context7.com/dciancu/unifi-protect-unvr-docker-arm64/llms.txt Steps to configure dummy network interfaces on a Linux host for remote access. This involves creating a dummy interface, making it persistent, and renaming the primary interface. ```bash # On host machine, create dummy network interface (Linux only) sudo ip link add enp0s1 type dummy # Make interface persistent - add to /etc/network/interfaces cat <<'EOF' | sudo tee -a /etc/network/interfaces auto enp0s1 iface enp0s1 inet manual pre-up ip link add enp0s1 type dummy post-down ip link del enp0s1 EOF # Rename primary interface to enp0s2 for cloud remote access # Create /etc/systemd/network/98-enp0s2.link with your MAC address cat <<'EOF' | sudo tee /etc/systemd/network/98-enp0s2.link [Match] MACAddress=aa:bb:cc:dd:ee:ff [Link] Name=enp0s2 EOF # Apply changes sudo update-initramfs -u sudo reboot ``` -------------------------------- ### Configure Dummy Network Interface for Debian/Ubuntu Source: https://github.com/dciancu/unifi-protect-unvr-docker-arm64/blob/main/README.md This snippet configures a dummy network interface named 'enp0s1' on Debian-based systems. It's used to mimic the UNVR hardware and ensure network-related functionalities within Protect work correctly. This configuration is made persistent across reboots by adding it to the host's network configuration file. ```shell ip link add enp0s1 type dummy ``` ```text auto enp0s1 iface enp0s1 inet manual pre-up ip link add enp0s1 type dummy post-down ip link del enp0s1 ``` -------------------------------- ### ubnt-tools Device Identification Script Source: https://context7.com/dciancu/unifi-protect-unvr-docker-arm64/llms.txt A bash script demonstrating the use of `ubnt-tools` to emulate different UniFi NVR device identifications. It shows how to set the `DEVICE` environment variable to query different device types. ```bash #!/bin/bash # files/sbin/ubnt-tools # Emulate different UNVR devices DEVICE=UNVR ubnt-tools id # Output: # board.sysid=0xea16 # board.name=UniFi Network Video Recorder # board.shortname=UNVR # board.uuid=550e8400-e29b-41d4-a716-446655440000 # board.serialno=aabbccddeeff DEVICE=UNVR_PRO ubnt-tools id # Output: # board.sysid=0xea20 # board.name=UniFi Network Video Recorder Pro # board.shortname=UNVRPRO DEVICE=ENVR ubnt-tools id # Output: # board.sysid=0xea3f # board.name=UniFi Enterprise Network Video Recorder # board.shortname=ENVR ``` -------------------------------- ### View Unifi Protect Container Logs (Bash) Source: https://context7.com/dciancu/unifi-protect-unvr-docker-arm64/llms.txt Provides commands to view various logs from the Unifi Protect Docker container and its host system. This includes real-time logs from Docker Compose, systemd journal, Protect application, Unifi-core, storage debugging, and PostgreSQL. Essential for diagnosing issues. ```bash # Docker compose logs docker compose logs -f ``` ```bash # Inside container - systemd journal docker exec -it unifi-protect journalctl -f ``` ```bash # Protect application logs docker exec -it unifi-protect tail -f /srv/unifi-protect/logs/protect.log ``` ```bash # Unifi-core logs docker exec -it unifi-protect tail -f /data/unifi-core/logs/unifi-core.log ``` ```bash # Storage debug logs (if DEBUG_STORAGE=true) docker exec -it unifi-protect tail -f /var/log/storage_disk_debug.log ``` ```bash # PostgreSQL logs docker exec -it unifi-protect tail -f /var/log/postgresql/postgresql-14-main.log ``` -------------------------------- ### Build Stable UniFi Protect Docker Image Source: https://context7.com/dciancu/unifi-protect-unvr-docker-arm64/llms.txt Builds the stable version of the UniFi Protect Docker image using packaged firmware. It can be executed via a build script or directly using Docker commands. ```bash # Build stable version using packaged firmware version BUILD_STABLE=1 BUILD_TAG_VERSION=1 bash build.sh # Or using Dockerfile directly docker build -t dciancu/unifi-protect-unvr-docker-arm64:stable --build-arg PROTECT_STABLE=1 . ``` -------------------------------- ### Configure Storage Disk for UniFi Protect Container Source: https://context7.com/dciancu/unifi-protect-unvr-docker-arm64/llms.txt Configuration in `docker-compose.override.yml` to mount and specify a physical disk for UniFi Protect storage. Includes enabling debug logging for storage operations. ```yaml # docker-compose.override.yml services: unifi-protect: devices: - /dev/sdb:/dev/sdb # Mount physical disk environment: - STORAGE_DISK=/dev/sdb # Point to storage device - DEBUG_STORAGE=true # Enable storage debug logging # Start container and check storage initialization docker compose up -d docker compose logs -f | grep storage # Inside container, verify storage docker exec -it unifi-protect bash df -h /srv # Check Protect video storage mount cat /var/log/storage_disk_debug.log # View storage operations ``` -------------------------------- ### Docker Compose Deployment Configuration (Linux) Source: https://context7.com/dciancu/unifi-protect-unvr-docker-arm64/llms.txt Configuration for deploying the UniFi Protect container using Docker Compose on a Linux host. It specifies device mappings, environment variables for storage, and device emulation. ```yaml # docker-compose.override.yml services: unifi-protect: devices: - /dev/sda:/dev/sda environment: - STORAGE_DISK=/dev/sda - DEVICE=UNVR - DEBUG=false - DEBUG_STORAGE=false - DEBUG_UNIFI_CORE=false ``` -------------------------------- ### Build Edge UniFi Protect Docker Image Source: https://context7.com/dciancu/unifi-protect-unvr-docker-arm64/llms.txt Builds the edge version of the UniFi Protect Docker image, incorporating the latest Protect release. This can be achieved using the build script or directly with Docker commands. ```bash # Build edge version with latest Protect release BUILD_EDGE=1 BUILD_TAG_VERSION=1 bash build.sh # Or using Dockerfile directly docker build -t dciancu/unifi-protect-unvr-docker-arm64:edge . ``` -------------------------------- ### Build Unifi Protect Stable Docker Image Source: https://github.com/dciancu/unifi-protect-unvr-docker-arm64/blob/main/README.md Builds a stable Docker image for Unifi Protect using the specified build argument. This command assumes a Dockerfile is present in the current directory. ```bash docker build -t dciancu/unifi-protect-unvr-docker-arm64:stable --build-arg PROTECT_STABLE=1 . ``` -------------------------------- ### Check Latest Unifi Protect Firmware (Bash) Source: https://context7.com/dciancu/unifi-protect-unvr-docker-arm64/llms.txt Executes a script (`./check-latest-firmware.sh`) to determine the latest available firmware version for Unifi Protect. The output typically shows the latest available firmware and the current firmware version stored in `firmware.txt`, useful for tracking updates. ```bash # Run firmware check script ./check-latest-firmware.sh ``` -------------------------------- ### Extract Firmware Packages (Bash) Source: https://context7.com/dciancu/unifi-protect-unvr-docker-arm64/llms.txt A script (`build-firmware.sh`) that extracts all Debian packages from the Unifi Protect firmware. Setting `FW_ALL_DEBS=1` instructs the script to save the extracted packages into the `firmware/all-debs/` directory, enabling detailed package inspection or custom firmware builds. ```bash # Extract all Debian packages from firmware FW_ALL_DEBS=1 bash build-firmware.sh ``` -------------------------------- ### Unifi Protect Log Management Scripts (Bash) Source: https://context7.com/dciancu/unifi-protect-unvr-docker-arm64/llms.txt Shell commands for managing Unifi Protect logs. Includes viewing storage debug logs in real-time (`tail -f /var/log/storage_disk_debug.log`) and disabling debug logging using a provided script (`./unvr_log.sh off`). ```bash # View storage operations in real-time tail -f /var/log/storage_disk_debug.log ``` ```bash # Disable debug logging ./unvr_log.sh off ``` -------------------------------- ### Configure Docker Compose Override (YAML) Source: https://context7.com/dciancu/unifi-protect-unvr-docker-arm64/llms.txt Configures the Docker Compose override file (`docker-compose.override.yml`) to map host storage devices and set environment variables for Unifi Protect. It specifies the storage disk path (e.g., `/dev/sda`) and enables various debug options (`DEBUG`, `DEBUG_STORAGE`, `DEBUG_UNIFI_CORE`) for troubleshooting. ```yaml services: unifi-protect: devices: - /dev/sda:/dev/sda environment: - STORAGE_DISK=/dev/sda ``` ```yaml # docker-compose.override.yml - Enable all debug options services: unifi-protect: environment: - DEBUG=true # Enable all debug options - DEBUG_STORAGE=true # Enable storage operation logging - DEBUG_UNIFI_CORE=true # Enable unifi-core debug level ``` -------------------------------- ### Docker Compose Deployment Configuration (macOS) Source: https://context7.com/dciancu/unifi-protect-unvr-docker-arm64/llms.txt Configuration for deploying the UniFi Protect container using Docker Compose on macOS. It utilizes a macOS-specific compose file that employs port mapping instead of a host network. ```bash # Use macOS-specific compose file (uses port mapping instead of host network) docker compose -f docker-compose.macos.yml -f docker-compose.override.yml up -d # Check container status docker compose -f docker-compose.macos.yml ps ``` -------------------------------- ### Access Unifi Protect RTSP Streams (Bash) Source: https://context7.com/dciancu/unifi-protect-unvr-docker-arm64/llms.txt Instructions on how to access RTSP streams from Unifi Protect cameras. It provides the general URL format (`rtsp://host-ip:7447/{camera-id}`), explains how to find the camera ID within the Protect UI, and demonstrates streaming using VLC and FFmpeg. It also notes how to handle SRTP parameters. ```bash # RTSP streams available at: # rtsp://host-ip:7447/{camera-id} # Example RTSP URL: rtsp://192.168.1.100:7447/FGx8k2L3mNbVp9Qa # Stream with VLC vlc rtsp://192.168.1.100:7447/FGx8k2L3mNbVp9Qa # Stream with FFmpeg ffmpeg -i rtsp://192.168.1.100:7447/FGx8k2L3mNbVp9Qa -c copy output.mp4 # Remove ?enableSrtp parameter from RTSP URL if present # Original: rtsps://host:7441/camera-id?enableSrtp # Use: rtsp://host:7447/camera-id ``` -------------------------------- ### Enable Storage Debug Logging within Container Source: https://context7.com/dciancu/unifi-protect-unvr-docker-arm64/llms.txt Command to enable debug logging for storage operations within the running UniFi Protect container. Logs are redirected to `/var/log/storage_disk_debug.log`. ```bash # Inside running container ./unvr_log.sh on # Logs written to /var/log/storage_disk_debug.log ``` -------------------------------- ### Container Device Type Configuration Source: https://context7.com/dciancu/unifi-protect-unvr-docker-arm64/llms.txt Configuration snippet for `docker-compose.override.yml` to set the device type for the UniFi Protect container. This allows emulation of different UniFi NVR hardware models. ```yaml # docker-compose.override.yml - Set device type services: unifi-protect: environment: - DEVICE=UNVR_PRO # Options: UNVR (default), UNVR_PRO, ENVR, MAC_OS ``` -------------------------------- ### Configure RTSP Stream Access Source: https://github.com/dciancu/unifi-protect-unvr-docker-arm64/blob/main/README.md This shows how to access RTSP streams from Unifi Protect cameras. By modifying the camera's advanced settings, you can construct a direct RTSP URL using the host IP and the camera ID, accessible on port 7447. ```url rtsp://host-ip:7447/camera-id ``` -------------------------------- ### Troubleshoot Systemd Read-Only File System Error Source: https://github.com/dciancu/unifi-protect-unvr-docker-arm64/blob/main/README.md This kernel parameter, 'systemd.unified_cgroup_hierarchy=0', is a workaround for 'Read-only file system' errors when running systemd inside a Docker container. It should be added to the host's bootloader configuration to resolve issues with cgroup initialization. ```bash systemd.unified_cgroup_hierarchy=0 ``` -------------------------------- ### Configure Network Interface Name for Remote Access Source: https://github.com/dciancu/unifi-protect-unvr-docker-arm64/blob/main/README.md This configuration sets the network interface name to 'enp0s2' for a specific MAC address. This is crucial for enabling remote access via the Unifi cloud, as the UNVR expects this interface name. After applying, systemd network settings need to be updated and the host rebooted. ```ini [Match] MACAddress=xx:xx:xx:xx:xx:xx [Link] Name=enp0s2 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.