Skip to content

Latest commit

 

History

157 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Frigate Proxmox Script

A fully automated, one-command script for deploying Frigate NVR on Proxmox VE.

This script builds a production-ready Frigate stack from scratch: provisioning the LXC container, installing Docker, and automatically configuring hardware acceleration.

What it does:

Full Stack Provisioning - Creates an Unprivileged LXC container by default (with a fallback to Privileged mode) ✅ GPU Accelerated - Configures Intel iGPU acceleration automatically (VAAPI/QSV)
Alder Lake-N Optimized - Tailored for Intel N95, N100, and N150 processors
Modern Passthrough - Uses Proxmox 8.2+ dev[n] mappings for superior stability ✅ Zero Manual Setup - Handles nesting, keyctl, and AppArmor profiles automatically

Features

Docker-Based - Official Frigate images for reliability and speed
Intel iGPU (Primary) - First-class support for Intel-based hardware acceleration
NVIDIA & AMD (Best-Effort) - Experimental support for non-Intel hardware
Hardware Auto-Detection - Automatically identifies CPU, GPU, and Coral TPU
Easy Updates - Simple Docker pulls to keep your NVR current
Home Assistant Ready - Default ports and paths pre-configured
Samba File Sharing - Out-of-the-box access to config and storage
Proxmox Dashboard - Professional Markdown-based container summary
Add-ons Included - Optional SSH access for easy management

Requirements

  • Proxmox VE 7.0 or later
  • Root access on Proxmox host
  • Intel iGPU (Primary support)
  • NVIDIA/AMD GPU (Experimental / Best-effort only)
  • Google Coral TPU (Optional)

Quick Start

Option 1: One-Command Install (Recommended)

bash <(curl -s https://raw.githubusercontent.com/saihgupr/frigate-proxmox-script/main/install.sh)

Tip

Stuck on an old version? GitHub's raw content cache can sometimes lag. If you don't see the latest version, try appending a timestamp: bash <(curl -s "https://raw.githubusercontent.com/saihgupr/frigate-proxmox-script/main/install.sh?$(date +%s)")

Option 2: Download and Run

wget https://raw.githubusercontent.com/saihgupr/frigate-proxmox-script/main/install.sh
bash install.sh

Installation takes ~3 minutes

Usage

./install.sh [OPTIONS]

OPTIONS:
    -d, --dry-run          Run in simulation mode (no actual changes)
    -v, --verbose          Enable verbose output
    -h, --help             Show help message

Advanced Options

These options allow for automated or specialized network configurations:

Flag Description
-b, --bridge NAME Specify the network bridge (default: vmbr0)
--vlan TAG Specify a VLAN tag for the container network (1-4094)
--mtu MTU Specify an MTU for the container network (576-9000)
--firewall Enable Proxmox firewall on the container (opens ports 5000, 1984, and 8971)

Configuration Options

The script will prompt you for:

  • Container ID - Choose between 100-999 (or auto-select)
  • Security Level - Choose between Unprivileged (Higher security, default) or Privileged (Legacy hardware fallback)
  • Root Password - Set a password for the root user (required for console login)
  • SSH - Enable SSH access (uses Root Password automatically with root user)
  • CPU Cores - Default: 4
  • RAM - Default: 2048 MB (2GB recommended for Docker)
  • Disk Size - Default: 10 GB (for recordings)
  • Network - DHCP or static IP
  • Intel iGPU - Enable hardware acceleration (recommended)
  • Samba - Enable file sharing for easy access to config and recordings
  • Web Port - Default: 5000 (Home Assistant compatible)
  • SHM Size - Default: 512mb (Configurable for high-resolution streams, e.g., 1gb, 2gb)
  • Docker Image - stable, beta, or custom version tag

Post-Installation

Updating Existing Installations

If you have an existing installation from an older version of the script and need the go2rtc API (1984) or Frigate Auth (8971) ports, you will need to add them manually to your compose.yml (new installations automatically map these ports):

  1. Edit the file: pct exec <CT_ID> -- nano /opt/frigate/compose.yml
  2. Add the ports under the ports: section:
          - "1984:1984"  # go2rtc API
          - "8971:8971"  # Frigate Auth port (Requires HTTPS)
  3. Recreate the container:
    pct exec <CT_ID> -- docker compose -f /opt/frigate/compose.yml up -d

Adding Your Cameras

Method 1: Edit Config File via SSH

# Access Proxmox host, then edit the config
pct exec <CT_ID> -- nano /opt/frigate/config/config.yml

Method 2: Copy Config from Your Local Machine

# From your Mac/PC, copy your config.yml to Proxmox
scp config.yml root@<PROXMOX_IP>:/tmp/

# On Proxmox host, copy to container
pct push <CT_ID> /tmp/config.yml /opt/frigate/config/config.yml

# Restart Frigate to apply changes
pct exec <CT_ID> -- docker compose -f /opt/frigate/compose.yml restart

Method 3: Use Frigate Web UI (Recommended)

Starting in Frigate 0.14+, you can edit the configuration directly in the web interface:

  1. Go to http://<CONTAINER_IP>:5000/config
  2. Click the Edit button
  3. Make your changes
  4. Click Save (Frigate will automatically restart)

Method 4: Use Samba (Easiest)

If you enabled Samba during installation:

  1. Open your File Explorer (Windows) or Finder (Mac)
  2. Connect to smb://<CONTAINER_IP>
  3. Authenticate with user frigate and your chosen password
  4. Edit config.yml directly in the Config share using any text editor

File Locations

/opt/frigate/
├── compose.yml             # Docker Compose configuration
├── config/
│   └── config.yml         # Frigate configuration
└── storage/               # Recordings and snapshots

Hardware Acceleration & Detection

How Smart Detection Works

The script performs a "pre-flight" scan of your Proxmox host to determine the best possible configuration for your specific hardware:

  1. CPU Identification: Detects your processor model to optimize OpenVINO performance.
  2. GPU Passthrough:
    • Intel/AMD: Automatically detects /dev/dri/ and configures VAAPI.
    • NVIDIA: Detects the presence of NVIDIA drivers and configures the NVIDIA Container Runtime in LXC.
  3. Detector Optimization:
    • If a Google Coral (USB or PCIe) is found, it's set as the primary detector.
    • If no Coral is found, it utilizes OpenVINO (favoring the iGPU if available, otherwise falling back to CPU).

Intel Alder Lake-N (N95/N100/N150)

For newer Intel Alder Lake-N processors, ensure your Proxmox host is running Kernel 6.5 or later (standard in Proxmox 8.1+).

If the script fails to detect your iGPU on these chips:

  1. Ensure the intel-media-va-driver-non-free is available (the script attempts to install this).
  2. You may need to add i915.force_probe=* to your GRUB/systemd-boot entries on the Proxmox host if using an older kernel.

SR-IOV (Virtual GPUs)

This script supports SR-IOV. If you have enabled SR-IOV on your Proxmox host to split your iGPU into multiple Virtual Functions (VFs):

  1. The script will detect multiple render nodes (e.g., /dev/dri/renderD128, /dev/dri/renderD129, etc.).
  2. You will be prompted to select which specific render node Frigate should use.
  3. The script will automatically map only that specific node to the Docker container.
  4. Note: Ensure you have the intel-i915-dkms drivers installed on your host for SR-IOV support on 12th Gen+ Intel hardware.

Verify Hardware Acceleration

# Check if device is accessible in container
pct exec <CT_ID> -- ls -l /dev/dri/renderD128

# View Frigate logs for hardware acceleration status
pct exec <CT_ID> -- docker logs frigate 2>&1 | grep -i vaapi

# View GPU usage (run on the Proxmox HOST, not inside the container)
sudo intel_gpu_top

Note: Because this script uses an unprivileged LXC container, GPU statistics are not accessible from inside the container. Hardware acceleration (VAAPI/QSV/OpenVINO) still works correctly — you can verify it via Frigate logs. Run intel_gpu_top on the Proxmox host instead.

Example Config with Hardware Acceleration

ffmpeg:
  hwaccel_args: preset-intel-qsv-h264

detectors:
  ov:
    type: openvino
    device: GPU
    model_path: /openvino-model/ssdlite_mobilenet_v2.xml

model:
  width: 300
  height: 300
  input_tensor: nhwc
  input_pixel_format: bgr
  labelmap_path: /openvino-model/coco_91cl_bkgr.txt

detect:
  enabled: true

Troubleshooting

Container won't start

# Check LXC status
pct status <CT_ID>

# View container logs
pct exec <CT_ID> -- journalctl -xe

Frigate not accessible

# Check if Docker container is running
pct exec <CT_ID> -- docker ps

# Check Frigate logs
pct exec <CT_ID> -- docker logs frigate

# Verify port in compose.yml
pct exec <CT_ID> -- cat /opt/frigate/compose.yml | grep -A2 ports

Hardware acceleration not working

# Check if iGPU device exists
pct exec <CT_ID> -- ls -l /dev/dri/

# Test VAAPI
pct exec <CT_ID> -- docker exec frigate vainfo

Intel QSV "Can't allocate a surface" or "Cannot allocate memory"

If you see errors like [Parsed_vpp_qsv_0] Can't allocate a surface or Error while filtering: Cannot allocate memory in your logs:

  1. Switch to VAAPI: For 12th/13th/14th Gen Intel CPUs (including N100), the QSV preset can suffer from FFmpeg surface allocation bugs. Change your hwaccel_args in your camera config from preset-intel-qsv-h264 (or other QSV presets) to preset-vaapi.
  2. Disable HW Accel on sub-streams: If you are using go2rtc loopbacks, set hwaccel_args: [] specifically under the detect role for the camera to prevent surface pool exhaustion.
  3. Camera Stream Settings: For brands like Reolink, use HTTP/FLV streams in go2rtc instead of RTSP, as RTSP streams are prone to packet drops that crash the hardware decoder.

NVIDIA GPU Errors

If you see Error running prestart hook #0 or libnvidia-ml.so.1: cannot open shared object file:

  1. Check Host Drivers: Run nvidia-smi on your Proxmox host. If it fails, your host-level drivers are broken.
  2. Fix Missing Libraries: On the Proxmox host, run:
    sudo ln -s /usr/lib/x86_64-linux-gnu/libnvidia-ml.so.1 /usr/lib/libnvidia-ml.so.1
  3. Host Toolkit: Ensure nvidia-container-toolkit is installed on the Proxmox host itself, not just inside the LXC.

Configuration errors

# Validate YAML syntax
pct exec <CT_ID> -- docker exec frigate python3 -c "import yaml; yaml.safe_load(open('/config/config.yml'))"

# Check Frigate logs for config errors
pct exec <CT_ID> -- docker logs frigate 2>&1 | grep -i error

Updating Frigate

Option 1: The Easy Way (Script)

Choose the update method that best fits your needs. You can run the script interactively, or skip the prompts entirely by passing your container ID and version.

Interactive

bash <(wget -qO- https://raw.githubusercontent.com/saihgupr/frigate-proxmox-script/main/update.sh)

Command Line Flags

The script supports several flags to automate the update process and ensure safety:

Flag Short Description
--id -i The Proxmox Container ID (e.g., 100)
--version -v Version tag (e.g., 0.17.0-rc2, latest, beta)
--snapshot -s Take a snapshot before updating. Optionally provide a name.
--prune -p Prune unused Docker images and layers before updating.

Examples

Interactive Update

bash <(wget -qO- https://raw.githubusercontent.com/saihgupr/frigate-proxmox-script/main/update.sh)

Update to Latest Stable (with snapshot)

bash <(wget -qO- https://raw.githubusercontent.com/saihgupr/frigate-proxmox-script/main/update.sh) \
  -i <CT_ID> \
  -v latest \
  -s

Update to Specific Version (with custom snapshot)

bash <(wget -qO- https://raw.githubusercontent.com/saihgupr/frigate-proxmox-script/main/update.sh) \
  -i <CT_ID> \
  -v 0.17.0-rc2 \
  -s "Pre-Upgrade"

Prune Docker Space Only

bash <(wget -qO- https://raw.githubusercontent.com/saihgupr/frigate-proxmox-script/main/update.sh) -i <CT_ID> -p

[!TIP] Use -i for Container ID, -v for Version, and -s for Snapshot. If no flags are provided, the script will guide you through the settings and ask if you'd like a snapshot before starting.

Option 2: The Manual Way
  1. Edit your compose file. Replace <CT_ID> with your container ID (e.g., 100).

    pct exec <CT_ID> -- nano /opt/frigate/compose.yml
  2. Change the image line to the desired version, e.g.: image: ghcr.io/blakeblackshear/frigate:0.17.0-rc1

  3. Pull the new image and recreate the container:

    pct exec <CT_ID> -- docker compose -f /opt/frigate/compose.yml pull
    pct exec <CT_ID> -- docker compose -f /opt/frigate/compose.yml up -d
  4. Verify: Check http://<YOUR_FRIGATE_IP>:5000/api/version to confirm the update.

Uninstallation

# Stop and destroy the container
pct stop <CT_ID>
pct destroy <CT_ID>

Based On

Scope of Support

This project is a personal automation script designed primarily for Intel iGPU-based mini PCs (e.g., Beelink N95/N100).

  • Primary Support: Hardware detection and setup issues for Intel iGPU configurations.
  • Experimental Support: NVIDIA and AMD GPU configurations. These are included as a convenience but often require host-level driver troubleshooting that falls outside the scope of this project.
  • Out of Scope: Individual network troubleshooting, remote storage (NFS) mounting issues, or complex Docker network configurations.

If you are using non-Intel hardware, please ensure your host-side drivers are fully functional before reporting an issue.

Support & Feedback

If you encounter any issues or have feature requests, please open an issue on GitHub.

If you find it useful, consider giving it a star ⭐ or making a donation to support development.

About

An automated, Docker-based installation script for deploying Frigate NVR on Proxmox VE using an LXC container.

Topics

Resources

Stars

164 stars

Watchers

10 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages