Build a Local AI Security Camera System with Frigate NVR on a Raspberry Pi
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
- No subscription. Most consumer smart cameras gate meaningful features (person detection, extended clip storage) behind a monthly fee. Frigate does this natively, free, forever.
- Privacy. Footage stays on your network unless you explicitly configure remote access — nothing streams to a third-party cloud by default.
- Works with cheap cameras. Frigate doesn't care about brand lock-in — any RTSP-capable IP camera works, including budget options that would otherwise have no smart features at all.
- Real object detection, not just motion. Motion-only alerts (branches moving, headlights sweeping past) generate constant false alarms. AI object detection specifically flags "person," "car," "dog," etc., which is a massive reduction in noise.
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 streamingInstallation via Docker
Frigate is distributed as a Docker container, which is the recommended and best-supported installation method.
- Install Docker on Raspberry Pi OS if you don't already have it: curl -sSL https://get.docker.com | sh
- Create a directory structure for Frigate's config and storage: mkdir -p ~/frigate/config ~/frigate/storage
- Create ~/frigate/config/config.yml with your camera and detector configuration (see below)
- 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: 7Each 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:
- Motion masks exclude specific regions of frame from triggering detection at all — useful for a tree that sways in wind, or a section of public sidewalk you don't need alerts for
- Zones let you define specific areas (like "driveway" or "front porch") and configure alerts differently per zone — e.g., alert on any person in the "porch" zone, but only alert on a person who lingers in the broader "yard" zone
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 setupsHome 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 expectsThe 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.
Related Guides
- Raspberry Pi Security Camera/NVR with Frigate
- Running Frigate NVR on Raspberry Pi for Security Cameras
- Build a Wall-Mounted Maker Dashboard: Aggregating Your Print Farm, Security, and Home Server on One CYD Panel
- DIY Home Security System: Combining Raspberry Pi, ESP32 Sensors, and Flipper Zero
- Build a Driveway and Gate Camera with License Plate Recognition Using Raspberry Pi and Frigate
- How to Set Up OpenCV Machine Vision on a Raspberry Pi
- Running Home Assistant on a Raspberry Pi 4
- Home Assistant on Raspberry Pi: Complete Server Setup