← Projects
raspberry-pi advanced Jul 15, 2026 ◑ 1 views ◯ 5 min read

Build a Local AI Security Camera System with Frigate NVR on a Raspberry Pi

Build time: Weekend
Tools needed: None required
Parts List
frigatenvrsecurity cameraraspberry picoralobject detectionhome assistantrtspdocker

Frigate is a local, open-source NVR (network video recorder) that does real-time AI object detection — people, cars, animals — entirely on your own hardware, with no cloud subscription, no monthly fee, and no footage leaving your network. Paired with a Raspberry Pi and a Coral USB accelerator for the AI inference, it's a genuinely capable security camera system you fully own.

Why Local Detection Over Cloud Cameras

Hardware You'll Need

ComponentRecommendation Raspberry PiPi 4 or Pi 5 (4GB+ RAM) — Frigate's detection itself is offloaded to the Coral, but the Pi still handles stream decoding, recording, and the web UI Google Coral USB AcceleratorStrongly recommended, not strictly required — without it, object detection falls back to CPU inference, which is dramatically slower and struggles with more than one camera in real time StorageA USB SSD, not a microSD card — continuous video recording will destroy a microSD card's write endurance within months. An external SSD is the right call for anything beyond a brief test IP camerasAny camera supporting RTSP streaming — budget PoE cameras are a common, cost-effective choice NetworkWired ethernet strongly preferred for both the Pi and cameras — WiFi introduces latency and reliability issues for continuous video streaming

Installation via Docker

Frigate is distributed as a Docker container, which is the recommended and best-supported installation method.

  1. Install Docker on Raspberry Pi OS if you don't already have it: curl -sSL https://get.docker.com | sh
  2. Create a directory structure for Frigate's config and storage: mkdir -p ~/frigate/config ~/frigate/storage
  3. Create ~/frigate/config/config.yml with your camera and detector configuration (see below)
  4. Run Frigate with docker-compose, mounting your config and storage directories, and passing through the Coral USB device

Basic Configuration

mqtt: enabled: false detectors: coral: type: edgetpu device: usb cameras: front_door: ffmpeg: inputs: - path: rtsp://username:password@camera-ip:554/stream1 roles: - detect - record detect: width: 1280 height: 720 fps: 5 objects: track: - person - car - dog record: enabled: true retain: days: 7

Each camera you add gets its own block under cameras:. Detection resolution (5fps in the example) can run much lower than your actual recording resolution — Frigate only needs enough frame rate to catch motion transitions, not a smooth video feed, for the AI detection pass itself.

Tuning Detection Zones

A huge source of false alerts is detecting motion/objects in areas you don't actually care about — a sidewalk beyond your property line, a road visible in the corner of frame. Frigate supports masking and zones to address this:

Configure these visually through Frigate's web UI rather than hand-calculating coordinates — it provides a click-and-drag interface over your actual camera feed.

Storage Planning

Continuous recording at even modest resolution adds up fast. Rough planning:

Retention StrategyStorage Impact Record everything, retain N daysHighest storage use, but full context if you need to check something the AI missed Record only on detected objects (event-based)Dramatically less storage, but you only have footage of moments Frigate's AI actually flagged Mixed: continuous at lower quality, event clips at full qualityFrigate supports this natively — a good middle ground for most home setups

Home Assistant Integration

Frigate integrates natively with Home Assistant (if you're running it, per our Home Assistant on Raspberry Pi guide) via MQTT, giving you camera entities, person/car detection sensors, and snapshot images directly in your existing dashboard — letting you trigger automations off camera events (turn on porch lights when a person is detected after dark, for example) without any separate system to manage.

Common Setup Issues

SymptomLikely Cause High CPU usage, dropped framesCoral not being used (check detector logs), or too many cameras for your hardware — verify the Coral is actually being detected and used, not silently falling back to CPU Constant false person/car detectionsDetection confidence threshold too low, or need motion masks/zones to exclude irrelevant areas Storage filling up faster than expectedRetention settings too generous for available storage, or record-everything instead of event-based recording Camera stream won't connectRTSP URL format varies by camera brand — verify the exact path/credentials format your specific camera model expects

The initial config takes some tuning to get zones and masks dialed in for your specific layout, but once set up, Frigate genuinely delivers what commercial "smart" cameras charge a subscription for — real AI detection, fully local, running on hardware you own outright.