Frigate auf Proxmox LXC
iGPU & Coral TPU Guide

Dieser Guide führt dich Schritt für Schritt durch die Installation von Frigate in einem Proxmox LXC-Container. Er zeigt, wie du deine Hardware optimal nutzt: eine Intel iGPU für Videodekodierung und einen Google Coral USB-Stick für schnelle Objekterkennung.

📋 Überblick

Die Installation ist in mehrere Abschnitte unterteilt:

  1. Proxmox Host Vorbereitung: LXC-Erstellung und Hardware-Durchreichen.
  2. Installation im LXC-Container: Ausführen des Installationsskripts für Docker, Portainer und Frigate.
  3. Frigate Konfiguration (config.yml): Anpassung der Frigate-Konfigurationsdatei.
  4. Fehlersuche & nützliche Befehle: Tipps zur Problembehebung und wichtige Shell-Befehle.
  5. Sicherheitshinweise: Wichtige Hinweise zum sicheren Betrieb.

💡 Wichtige Hinweise vorab

Getestet auf: **ASUS NUC 14 Essential** mit **Intel N250 Prozessor, 24GB Crucial RAM und 1TB SSD**.

  • LXC-Modus: Wir nutzen einen **privilegierten LXC-Container** mit aktivierter **Nesting**-Funktion. Dies ist entscheidend für Docker und Hardware-Passthrough. Beachte die Sicherheitshinweise.
  • IP-Adressen: Ersetze `IP_DES_LXC`, `192.168.XXX.XXX` und `192.168.YYY.YYY` durch deine tatsächlichen IP-Adressen.

🖥️ Vorbereitung auf dem Proxmox Host

Diese Schritte werden direkt auf deinem Proxmox-Host (NUC) durchgeführt.

1. LXC-Container erstellen

Erstelle einen neuen LXC über die **Proxmox-Weboberfläche**. Wichtige Einstellungen:

  • Template: Debian 12 (bookworm) oder Ubuntu 22.04.
  • Hostname: z.B. `frigate`.
  • Speicher: 10-20 GB.
  • CPU: Mind. 2 Cores.
  • RAM: 4 GB empfohlen.
  • Unprivileged: Deaktivieren (privilegierter Container).
  • Features: Nesting aktivieren.

Wichtig: Container nach der Erstellung noch nicht starten!

2. Hardware-Durchreichung (Intel iGPU & Coral USB)

Wir reichen die iGPU und den Coral USB-Stick an den LXC durch.

  1. Stoppe den Container (ersetze `<CT-ID>`):
    pct stop <CT-ID>
  2. Öffne die Container-Konfigurationsdatei auf dem Proxmox-Host:
    nano /etc/pve/lxc/<CT-ID>.conf
  3. Füge folgende Zeilen am Ende der Datei ein:
    # Erlaubt das Durchreichen der Intel iGPU
    lxc.cgroup2.devices.allow: c 226:* rwm
    lxc.mount.entry: /dev/dri dev/dri none bind,optional,create=dir
    
    # Erlaubt das Durchreichen des gesamten USB-Busses für Coral
    lxc.cgroup2.devices.allow: c 189:* rwm
    lxc.mount.entry: /dev/bus/usb dev/bus/usb none bind,optional,create=dir

    Tipp: Für eine spezifische USB-Gerätebindung (statt des gesamten Busses) ermittle den Pfad mit `lsusb` auf dem Host (z.B. `Bus 004 Device 002`) und nutze:

    # lxc.mount.entry: /dev/bus/usb/004/002 dev/bus/usb/004/002 none bind,optional,create=file
  4. Speichere (Strg+O, Enter) und schließe (Strg+X) die Datei.
  5. Starte den Container wieder:
    pct start <CT-ID>

    iGPU und USB-Bus sollten nun im Container verfügbar sein.


💻 Installation im LXC-Container

Nach der Proxmox-Vorbereitung melden wir uns im LXC-Container an (Konsole oder SSH).

3. Geräte im Container prüfen (Optional)

Überprüfe, ob iGPU und Coral USB im Container sichtbar sind:

ls -l /dev/dri
lsusb
  • Erwartet: `/dev/dri/renderD128` (oder `card0`) und ein `lsusb`-Eintrag für Coral (z.B. `1a6e:089a`).
  • **Falls `lsusb` fehlt:**
    apt update
    apt install -y usbutils

4. Interaktives Installationsskript ausführen

Dieses Skript automatisiert die Installation von Paketen, Docker, Portainer und Frigate.

  1. Lade das Skript herunter:
    wget https://raw.githubusercontent.com/BastiZ0/Frigate-under-Proxmox-XLC-on-ASUS-NUC-14/main/frigate-install.sh
  2. Mache es ausführbar:
    chmod +x frigate-install.sh
  3. Starte das Skript und folge den Anweisungen. Es fragt nach einem Frigate-Passwort und wartet an jedem Schritt auf deine Bestätigung:
    ./frigate-install.sh

Das Skript erledigt automatisch:

  • System-Updates und Paketinstallation (Coral Runtime, VAAPI-Treiber).
  • Docker, Docker Compose und Portainer-Installation.
  • Erstellung der Frigate-Verzeichnisse und der `docker-compose.yml`.
  • Start des Frigate-Containers.

Nach erfolgreichem Durchlauf sollte Frigate im Hintergrund laufen.


⚙️ Frigate-Konfiguration (config.yml)

Nach dem Start von Frigate konfigurierst du deine Kameras und Dienste in der config.yml.

Die Datei findest du unter /opt/frigate/config/. Bearbeite sie entweder über die Frigate-Weboberfläche (http://<IP_DES_LXC>:5000) oder manuell per SSH mit nano /opt/frigate/config/config.yml.

Wichtig: Nach jeder Änderung an der config.yml den Frigate-Container neu starten:

cd /opt/frigate
docker compose restart

Beispiel config.yml

Passe die Platzhalter (MQTT, Kameranames, RTSP-URLs) an deine Umgebung an.

mqtt:
  enabled: true
  host: core-mosquitto # Deine MQTT-Broker IP (z.B. Home Assistant)
  port: 1883
  topic_prefix: frigate
  client_id: frigate
  user: dein_mqtt_user
  password: dein_mqtt_passwort

ffmpeg:
  hwaccel_args: preset-vaapi # Hardware-Beschleunigung Intel iGPU (VA-API)

detectors:
  coral:
    type: edgetpu
    device: usb # Coral USB-Stick

detect:
  width: 640
  height: 360
  fps: 5 # Detektions-Frameraten

go2rtc:
  # Kamera-Streams konfigurieren (Main- und Sub-Streams nutzen)
  streams:
    Camera_1_main: rtsp://benutzer:passwort@192.168.XXX.XXX:554/ch0
    Camera_1_sub: rtsp://benutzer:passwort@192.168.XXX.XXX:554/ch1

cameras:
  Camera_1:
    enabled: true
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/Camera_1_main # Go2rtc Main-Stream
          roles:
            - record # Für Aufnahme
        - path: rtsp://127.0.0.1:8554/Camera_1_sub # Go2rtc Sub-Stream
          roles:
            - detect # Für Detektion (ressourcenschonend)

# Weitere Einstellungen (objects, record, snapshots) können ergänzt werden.
# Siehe offizielle Frigate-Dokumentation: https://docs.frigate.video/configuration/reference

🛠️ Fehlersuche & nützliche Befehle

Bei Problemen helfen diese Befehle, die Ursache zu finden:

Auf dem Proxmox-Host (NUC):

  • iGPU-Geräte prüfen:
    ls -l /dev/dri

    Erwartet: renderD128 (oder card0) sichtbar.

  • Kernel-Meldungen zur iGPU:
    dmesg | grep -i i915
  • USB-Geräte prüfen:
    lsusb

    Coral-Stick sichtbar (z.B. 1a6e:xxxx).

Im LXC-Container:

  • iGPU-Geräte im Container prüfen:
    ls -l /dev/dri

    Erwartet: renderD128 (oder card0) sichtbar.

  • USB-Geräte im Container prüfen:
    lsusb | grep -i 1a6e || lsusb | grep -i coral || lsusb | grep -i google

    Coral-Stick sichtbar.

  • VAAPI-Treiber-Status:
    vainfo || LIBVA_DRIVER_NAME=iHD vainfo

    Erwartet: Liste von H264/HEVC-Einträgen. "can't connect to X server!" kann ignoriert werden.

  • Docker-Container-Status:
    docker ps

    frigate und portainer als Up angezeigt.

  • Frigate-Logs einsehen:
    docker compose logs -f frigate

    Achte auf Initialized VAAPI device und Attempting to load TPU as usb.


⚠️ Sicherheitshinweise & Allgemeine Hinweise

  • Privilegierter LXC: Die Nutzung eines privilegierten LXC-Containers mit Bindmounts birgt Sicherheitsrisiken. Nur in deinem vertrauenswürdigen Heimnetzwerk einsetzen.
  • Speicherplatz: Frigate-Logs und Aufnahmen benötigen viel Platz. Externe USB-SSD oder NFS für `/media/frigate` ist sinnvoll.
  • Backups: Regelmäßige Backups deiner LXCs via Proxmox GUI.
  • Problemlösung: Bei Problemen immer zuerst die genannten Befehle prüfen. Offizielle Frigate-Dokumentation hilft zusätzlich.

Frigate Installation on Proxmox LXC
Intel iGPU & Coral TPU Guide

This guide walks you through the installation of Frigate in a Proxmox LXC container. It shows you how to optimize hardware usage: an Intel iGPU for video decoding and a Google Coral USB stick for fast object detection.

📋 Overview

The installation is divided into several sections for clarity:

  1. Proxmox Host Preparation: LXC creation and hardware passthrough.
  2. LXC Container Installation: Running the installation script for Docker, Portainer, and Frigate.
  3. Frigate Configuration (config.yml): Customizing the Frigate configuration file.
  4. Troubleshooting & Useful Commands: Tips for problem-solving and important shell commands.
  5. Security Notes: Important information for secure operation.

💡 Important Notes Before You Start

Tested on: **ASUS NUC 14 Essential** with **Intel N250 processor, 24GB Crucial RAM, and a 1TB SSD**.

  • LXC Mode: We use a **privileged LXC container** with **Nesting** enabled. This is crucial for Docker and hardware passthrough. Refer to [Security Notes](#security-notes-en).
  • IP Addresses: Replace `IP_DES_LXC`, `192.168.XXX.XXX`, and `192.168.YYY.YYY` with your actual IP addresses.

🖥️ Proxmox Host Preparation

These steps are performed directly on your Proxmox host (your NUC device).

1. Create the LXC Container

Create a new LXC via the **Proxmox web interface**. Key settings:

  • Template: Debian 12 (bookworm) or Ubuntu 22.04.
  • Hostname: e.g., `frigate`.
  • Storage: 10-20 GB.
  • CPU: Min. 2 Cores.
  • RAM: 4 GB recommended.
  • Unprivileged: Disable (privileged container).
  • Features: Enable Nesting.

Important: Do not start the container immediately after creation!

2. Hardware Passthrough (Intel iGPU & Coral USB)

We will pass through the iGPU and Coral USB stick to the LXC.

  1. Stop the container (replace `<CT-ID>`):
    pct stop <CT-ID>
  2. Open the container's configuration file on the Proxmox host:
    nano /etc/pve/lxc/<CT-ID>.conf
  3. Add the following lines to the end of the file:
    # Allows passthrough of the Intel iGPU
    lxc.cgroup2.devices.allow: c 226:* rwm
    lxc.mount.entry: /dev/dri dev/dri none bind,optional,create=dir
    
    # Allows passthrough of the entire USB bus for Coral
    lxc.cgroup2.devices.allow: c 189:* rwm
    lxc.mount.entry: /dev/bus/usb dev/bus/usb none bind,optional,create=dir

    Tip: For specific USB device binding (instead of the entire bus), determine the path with `lsusb` on the host (e.g., `Bus 004 Device 002`) and use:

    # lxc.mount.entry: /dev/bus/usb/004/002 dev/bus/usb/004/002 none bind,optional,create=file
  4. Save (Ctrl+O, Enter) and exit (Ctrl+X) the file.
  5. Start the container again:
    pct start <CT-ID>

    iGPU and USB bus should now be available in the container.


💻 Installation within the LXC Container

After Proxmox preparation, log into the LXC container (console or SSH).

3. Verify Devices in Container (Optional)

Check if iGPU and Coral USB are visible in the container:

ls -l /dev/dri
lsusb
  • Expected: `/dev/dri/renderD128` (or `card0`) and an `lsusb` entry for Coral (e.g., `1a6e:089a`).
  • **If `lsusb` is missing:**
    apt update
    apt install -y usbutils

4. Run the Interactive Installation Script

This script automates package, Docker, Portainer, and Frigate installation.

  1. Download the script:
    wget https://raw.githubusercontent.com/BastiZ0/Frigate-under-Proxmox-XLC-on-ASUS-NUC-14/main/frigate-install.sh
  2. Make it executable:
    chmod +x frigate-install.sh
  3. Start the script and follow prompts. It asks for a Frigate password and waits for your confirmation at each step:
    ./frigate-install.sh

The script automates:

  • System updates and package installation (Coral Runtime, VAAPI drivers).
  • Docker, Docker Compose, and Portainer installation.
  • Creation of Frigate directories and `docker-compose.yml`.
  • Starting the Frigate container.

After successful execution, Frigate should be running in the background.


⚙️ Frigate Configuration (config.yml)

Once Frigate is running, configure your cameras and services in `config.yml`.

Find the file at /opt/frigate/config/. Edit via Frigate web UI (http://<LXC_IP>:5000) or manually with nano /opt/frigate/config/config.yml.

Important: Restart the Frigate container after every `config.yml` change:

cd /opt/frigate
docker compose restart

Example config.yml

Adjust placeholders (MQTT, camera names, RTSP URLs) to your environment.

mqtt:
  enabled: true
  host: core-mosquitto # Your MQTT broker IP (e.g., Home Assistant)
  port: 1883
  topic_prefix: frigate
  client_id: frigate
  user: your_mqtt_user
  password: your_mqtt_password

ffmpeg:
  hwaccel_args: preset-vaapi # Intel iGPU hardware acceleration (VA-API)

detectors:
  coral:
    type: edgetpu
    device: usb # Coral USB stick

detect:
  width: 640
  height: 360
  fps: 5 # Detection framerates

go2rtc:
  # Configure camera streams (use main and sub streams)
  streams:
    Camera_1_main: rtsp://user:password@192.168.XXX.XXX:554/ch0
    Camera_1_sub: rtsp://user:password@192.168.XXX.XXX:554/ch1

cameras:
  Camera_1:
    enabled: true
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/Camera_1_main # Go2rtc main stream
          roles:
            - record # For recording
        - path: rtsp://127.0.0.1:8554/Camera_1_sub # Go2rtc sub stream
          roles:
            - detect # For detection (resource-efficient)

# Further settings (objects, record, snapshots) can be added.
# See official Frigate documentation: https://docs.frigate.video/configuration/reference

🛠️ Troubleshooting & Useful Commands

If you encounter issues, these commands help identify the cause:

On the Proxmox Host (Your NUC):

  • Check iGPU devices:
    ls -l /dev/dri

    Expected: renderD128 (or card0) visible.

  • Kernel messages for iGPU:
    dmesg | grep -i i915
  • Check USB devices:
    lsusb

    Coral stick visible (e.g., 1a6e:xxxx).

In the LXC Container:

  • Check iGPU devices in container:
    ls -l /dev/dri

    Expected: renderD128 (or card0) visible.

  • Check USB devices in container:
    lsusb | grep -i 1a6e || lsusb | grep -i coral || lsusb | grep -i google

    Coral stick visible.

  • VAAPI driver status:
    vainfo || LIBVA_DRIVER_NAME=iHD vainfo

    Expected: List of H264/HEVC entries. "can't connect to X server!" can be ignored.

  • Docker container status:
    docker ps

    frigate and portainer displayed as Up.

  • View Frigate logs:
    docker compose logs -f frigate

    Look for Initialized VAAPI device and Attempting to load TPU as usb.


⚠️ Security Notes & General Advice

  • Privileged LXC: Using a privileged LXC container with bindmounts poses a higher security risk. Only use within your trusted home network.
  • Storage Space: Frigate logs and recordings require significant space. External USB SSD or NFS for `/media/frigate` is recommended.
  • Backups: Perform regular backups of your LXCs via Proxmox GUI.
  • Problem Solving: Always check the output of the commands above first. Official Frigate documentation is also valuable.