Skip to content

saihgupr/frigate-proxmox-script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

102 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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 a privileged LXC container with Docker and Compose pre-installed
GPU Accelerated - Configures Intel iGPU acceleration by default (VAAPI/QSV)
Alder Lake-N Optimized - Tailored for Intel N95, N100, and N150 processors
Zero Manual Setup - Handles all the complex nesting, keyctl, and driver passthrough settings

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
Add-ons Included - Optional SSH & Samba for easy file 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)

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:
    --dry-run       Run in simulation mode (no actual changes)
    --verbose       Enable verbose output
    --help          Show help message

Configuration Options

The script will prompt you for:

  • Container ID - Choose between 100-999 (or auto-select)
  • 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)
  • 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 and need the go2rtc API (1984) or Frigate Auth (8971) ports, you will need to add them manually to your docker-compose.yml:

  1. Edit the file: pct exec <CT_ID> -- nano /opt/frigate/docker-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/docker-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/docker-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)

Samba Network File Sharing

If you enabled Samba during installation, you can access and edit Frigate files directly from your computer using network file shares.

Available Shares:

  1. \\<CONTAINER_IP>\Frigate - Full Frigate installation directory (/opt/frigate)
  2. \\<CONTAINER_IP>\Config - Configuration files only (/opt/frigate/config)
  3. \\<CONTAINER_IP>\Media - Recordings and snapshots (/opt/frigate/storage)

How to Connect:

Windows:

  1. Open File Explorer
  2. Type in the address bar: \\<CONTAINER_IP>\Config
  3. Press Enter
  4. Navigate to config.yml and edit with your favorite text editor

macOS:

  1. Open Finder
  2. Press Cmd + K (or Go → Connect to Server)
  3. Enter: smb://<CONTAINER_IP>/Config
  4. Click Connect
  5. Edit config.yml in any text editor

Linux:

# Mount the share
sudo mount -t cifs //<CONTAINER_IP>/Config /mnt/frigate -o guest

# Edit config
nano /mnt/frigate/config.yml

Share Details:

  • Authentication: Guest access enabled (no password required by default)
  • Password: If you configured Samba during installation, you can also authenticate with:
    • Username: root
    • Password: The root password you set during installation
  • Permissions: Full read/write access
  • User: All files created as root user automatically

File Locations

/opt/frigate/
├── docker-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
sudo intel_gpu_top

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 docker-compose.yml
pct exec <CT_ID> -- cat /opt/frigate/docker-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

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/docker-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/docker-compose.yml pull
    pct exec <CT_ID> -- docker compose -f /opt/frigate/docker-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/SMB) 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

License

Stars

Watchers

Forks

Sponsor this project

Packages

 
 
 

Contributors

Languages