Frigate: self-hosted NVR with AI detection in Docker

Frigate records IP cameras and detects people, cars and animals locally, with no cloud. How to start it with Docker Compose.

Frigate is a network video recorder for IP cameras with real-time object detection. It tells a person from a car or a cat on your own hardware, so recordings and alerts depend on what happened in the frame, not on every moving shadow, and no video leaves your network. It integrates closely with Home Assistant.

What you need

  • A server with Docker and the Compose plugin
  • IP cameras that provide an RTSP stream
  • Disk space for recordings
  • Ideally a detector: an Intel or other supported GPU, a Coral or another accelerator. Detection on the CPU alone works for a test but does not scale to several cameras.

Install

Create a folder with two subfolders and a compose file:

mkdir frigate && cd frigate
mkdir storage config

This is the starter file from the Frigate getting-started guide. The documentation notes that it is a starting point for amd64 devices:

services:
  frigate:
    container_name: frigate
    restart: unless-stopped
    stop_grace_period: 30s
    image: ghcr.io/blakeblackshear/frigate:stable
    volumes:
      - ./config:/config
      - ./storage:/media/frigate
      - type: tmpfs # 1GB In-memory filesystem for recording segment storage
        target: /tmp/cache
        tmpfs:
          size: 1000000000
    ports:
      - "8971:8971"
      - "8554:8554" # RTSP feeds

Port 8971 is the web interface with authentication. Port 5000 also exists inside the container and gives unauthenticated access; it is meant for other services in the same Docker network, so it is not published here.

Start it:

docker compose up -d

First run

On the first start Frigate creates an admin user and prints the generated password to the log:

docker logs frigate

Open https://<host>:8971 and log in. The certificate is self-signed, so the browser will warn about it.

With no cameras configured, a setup wizard opens. It lets you set your own admin password, add cameras (it connects to each camera, tests the streams and writes the configuration), pick the detection hardware Frigate found and choose hardware acceleration for video decoding. Every step can be skipped and changed later in Settings.

Backup

The configuration and the database are in ./config, recordings in ./storage.

Updating

docker compose pull && docker compose up -d

Read the release notes before a new minor version: they list breaking changes in the configuration.