Skip to content

Deploying Frigate

Introduction

Frigate is a complete open-source Network Video Recorder (NVR) solution designed from the ground up for real-time AI object detection. Built with a focus on performance and efficiency, Frigate processes video streams locally using machine learning models to detect people, vehicles, animals, and other objects—enabling intelligent alerts, automated recording, and powerful search capabilities without relying on cloud services or subscriptions.

Unlike traditional NVR systems that simply record everything or motion-triggered systems that generate countless false alerts from shadows, rain, or leaves, Frigate uses sophisticated object detection to understand what’s actually happening in your camera feeds. It can distinguish between a person walking up your driveway and a branch swaying in the wind, between your car pulling in and headlights passing by, or between your dog and a stranger approaching your door.

Frigate achieves this through efficient use of hardware acceleration, supporting Google Coral TPU, NVIDIA GPUs, Intel OpenVINO, and even CPU-based detection. It intelligently manages resources by only analyzing frames when motion is detected, caching objects for smooth scrubbing through footage, and maintaining 24/7 recording alongside event-based clips. The web interface provides live camera views, detailed event timelines, configurable zones and object filters, and integration with home automation platforms like Home Assistant, MQTT brokers, and REST APIs.

Deploying Frigate on Klutch.sh brings enterprise-grade infrastructure to your home security and automation setup. You get reliable persistent storage for recordings and database snapshots, automatic HTTPS for secure remote access to your camera feeds, straightforward configuration through environment variables, and the flexibility to scale compute resources as you add more cameras or enable more advanced detection features—all without managing physical servers or wrestling with complex networking.

This guide walks you through deploying Frigate on Klutch.sh using Docker, configuring camera streams, setting up object detection, connecting to MQTT for home automation, managing persistent storage for recordings and clips, and implementing production-ready practices for reliability, security, and performance optimization.


Why Deploy Frigate on Klutch.sh?

  • Local AI Processing: Run real-time object detection without cloud dependencies or subscription fees
  • Automatic HTTPS: Secure remote access to camera feeds and web interface
  • Persistent Storage: Reliable volume storage for recordings, clips, and database
  • Flexible Compute: Scale CPU/RAM resources based on camera count and detection load
  • Easy Integration: Built-in support for MQTT, Home Assistant, and REST APIs
  • No Hardware Hassles: Deploy without managing physical NVR boxes or servers
  • Quick Updates: Deploy new Frigate versions with zero-downtime rollouts
  • Cost-Effective: Pay only for compute and storage, no per-camera licensing
  • GitHub Integration: Version-controlled configuration management
  • Professional Reliability: Enterprise uptime for critical security infrastructure

Prerequisites

Before you begin, ensure you have:

  • A Klutch.sh account
  • A GitHub account with a repository for your deployment
  • IP cameras with RTSP streams (most modern cameras support this)
  • Basic understanding of video streaming and networking concepts
  • Camera network credentials (username and password for RTSP access)

Technical Requirements:

Frigate’s resource needs scale with camera count and resolution:

  • Minimum 2GB RAM (4GB+ recommended for multiple cameras)
  • At least 20GB persistent storage (scales with retention needs and camera count)
  • CPU with AVX support for TensorFlow Lite (most modern CPUs)
  • Optional: Hardware accelerator (Coral TPU, NVIDIA GPU) for better performance

Optional Dependencies:

For enhanced functionality, consider deploying:

  • MQTT broker (like EMQX) for home automation integration
  • Redis for improved performance with multiple Frigate instances

Understanding Frigate Architecture

Frigate is built as a sophisticated video processing and analysis system:

Core Components:

  • FFmpeg: Handles video stream decoding and encoding
  • Detector: Runs machine learning models for object detection
  • Motion Detection: Efficient pixel-based motion detection to trigger object detection
  • Object Tracking: Tracks detected objects across frames
  • Recording Manager: Handles 24/7 recording and event-based clips
  • HTTP Server: Provides web UI and REST API
  • MQTT Client: Publishes events and receives commands
  • Database: SQLite for event metadata and object tracking

Detection Pipeline:

  1. FFmpeg decodes RTSP camera streams
  2. Motion detection identifies areas of interest
  3. When motion detected, frames sent to object detector
  4. Detector identifies objects (person, car, dog, etc.)
  5. Objects tracked across frames for smooth tracking
  6. Events created when objects enter defined zones
  7. Clips and snapshots saved for matched events
  8. Metadata published via MQTT and API

Storage Strategy:

  • Recordings: Continuous 24/7 recording with configurable retention
  • Clips: Event-based segments when objects detected
  • Snapshots: Still images of detected objects
  • Database: SQLite database for metadata and search
  • Cache: In-memory cache for smooth timeline scrubbing

Preparing Your Repository

Step 1: Create Project Directory

Create a new directory for your Frigate deployment:

Terminal window
mkdir frigate-nvr
cd frigate-nvr

Step 2: Create Frigate Configuration

Create a config.yml file for Frigate configuration:

# Frigate Configuration
# See: https://docs.frigate.video/configuration/
mqtt:
# MQTT broker for Home Assistant integration
# Replace with your MQTT broker URL
enabled: false
# host: mqtt-broker.klutch.sh
# port: 8000
# user: frigate
# password: your-mqtt-password
database:
path: /media/frigate/frigate.db
detectors:
cpu1:
type: cpu
num_threads: 3
model:
width: 300
height: 300
# Configure object detection
objects:
track:
- person
- car
- dog
- cat
filters:
person:
min_area: 5000
max_area: 100000
threshold: 0.75
car:
min_area: 10000
threshold: 0.75
# Recording configuration
record:
enabled: true
retain:
days: 7
mode: all
events:
retain:
default: 30
mode: motion
snapshots:
enabled: true
timestamp: true
bounding_box: true
crop: false
retain:
default: 30
# Live view configuration
live:
stream_name: default
# Camera configuration
cameras:
front_door:
enabled: true
ffmpeg:
inputs:
- path: rtsp://username:password@camera-ip:554/stream
roles:
- detect
- record
detect:
width: 1280
height: 720
fps: 5
record:
enabled: true
retain:
days: 7
snapshots:
enabled: true
zones:
porch:
coordinates: 640,0,1280,0,1280,720,640,720
objects:
- person
- car
# Add more cameras as needed
# backyard:
# enabled: true
# ffmpeg:
# inputs:
# - path: rtsp://username:password@camera-ip:554/stream
# roles:
# - detect
# - record
# detect:
# width: 1280
# height: 720
# fps: 5

Step 3: Create Dockerfile

Create a Dockerfile for your Frigate deployment:

FROM ghcr.io/blakeblackshear/frigate:stable
# Frigate stable includes:
# - FFmpeg with hardware acceleration support
# - TensorFlow Lite for CPU-based detection
# - Python runtime and all dependencies
# - Web UI and API server
# - MQTT client
# Configuration will be mounted at runtime
# Recordings and clips stored in persistent volumes
# Expose ports
# 5000: HTTP API and Web UI
# 8554: RTSP restream server
# 8971: WebRTC server
EXPOSE 5000 8554 8971
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s \
CMD curl -f http://localhost:5000/api/version || exit 1
# Frigate starts automatically via base image

Alternative: Custom Build with Coral TPU Support

For Google Coral TPU acceleration:

FROM ghcr.io/blakeblackshear/frigate:stable-tensorrt
# This image includes:
# - TensorRT for NVIDIA GPU acceleration
# - Support for Google Coral Edge TPU
# - OpenVINO for Intel acceleration
# Install additional utilities if needed
RUN apt-get update && \
apt-get install -y --no-install-recommends \
curl \
&& rm -rf /var/lib/apt/lists/*
# Copy custom configuration
COPY config.yml /config/config.yml
EXPOSE 5000 8554 8971
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s \
CMD curl -f http://localhost:5000/api/version || exit 1

Step 4: Create Environment Configuration

Create a .env.example file for documentation:

# Frigate Configuration
FRIGATE_RTSP_PASSWORD=your-rtsp-password
# Camera Credentials
CAMERA_USERNAME=admin
CAMERA_PASSWORD=your-camera-password
# MQTT Configuration (optional)
MQTT_HOST=mqtt-broker.klutch.sh
MQTT_PORT=8000
MQTT_USER=frigate
MQTT_PASSWORD=your-mqtt-password
# Timezone
TZ=America/New_York
# Plus API Key (for Frigate+ features)
# PLUS_API_KEY=your-plus-api-key

Step 5: Create .gitignore

Create a .gitignore file to exclude sensitive data:

# Environment files
.env
.env.local
.env.production
# Frigate data
/media/
/recordings/
/clips/
/cache/
frigate.db
frigate.db-shm
frigate.db-wal
# Logs
*.log
# System files
.DS_Store
Thumbs.db
# Temporary files
*.tmp

Step 6: Create README.md

Document your deployment:

# Frigate NVR on Klutch.sh
Open-source Network Video Recorder with real-time AI object detection.
## Quick Start
1. Update `config.yml` with your camera RTSP URLs
2. Push this repository to GitHub
3. Deploy on Klutch.sh with HTTP traffic
4. Access web interface at your assigned URL
5. Configure zones and notifications
## Features
- Real-time AI Object Detection
- 24/7 Recording + Event Clips
- Home Assistant Integration
- Mobile-Friendly Web UI
- Zone-Based Detection
- MQTT Support
- Hardware Acceleration
## Configuration
Edit `config.yml` to add cameras and configure detection settings.
See Klutch.sh dashboard for environment variables.
## Documentation
- [Frigate Documentation](https://docs.frigate.video/)
- [Camera Setup Guide](https://docs.frigate.video/configuration/cameras)

Step 7: Push to GitHub

Initialize git and push your repository:

Terminal window
git init
git add Dockerfile config.yml .env.example .gitignore README.md
git commit -m "Initial Frigate NVR deployment setup"
git branch -M main
git remote add origin https://github.com/your-username/frigate-nvr.git
git push -u origin main

Deploying Frigate on Klutch.sh

Step 1: Create New App

    1. Log in to the Klutch.sh dashboard

    2. Create a new project or select an existing one

    3. Create a new app and configure it:

      • Repository: Select your Frigate GitHub repository
      • Branch: Choose the branch to deploy (e.g., main or production)
      • Traffic Type: Select HTTP (Frigate’s web interface runs on HTTP)
      • Internal Port: Set to 5000 (Frigate’s web server listens on port 5000)

Step 2: Configure Persistent Volumes

Frigate requires persistent storage for recordings, clips, snapshots, and database.

    1. In your app settings, navigate to the Volumes section

    2. Add a volume for Frigate media (recordings, clips, snapshots):

      • Mount Path: /media/frigate
      • Size: 50GB minimum (100GB+ recommended based on camera count and retention)
    3. Add a volume for cache (optional but recommended for performance):

      • Mount Path: /tmp/cache
      • Size: 10GB
    4. Add a volume for configuration:

      • Mount Path: /config
      • Size: 1GB

Step 3: Configure Environment Variables

Set essential environment variables for your Frigate deployment:

    1. In your app settings, navigate to the Environment Variables section

    2. Add the following variables (mark sensitive values as secrets):

      Timezone:

      Terminal window
      TZ=America/New_York

      Camera Credentials:

      Terminal window
      CAMERA_USERNAME=admin
      CAMERA_PASSWORD=your-camera-password

      MQTT Configuration (if using MQTT broker):

      Terminal window
      MQTT_HOST=mqtt-broker.klutch.sh
      MQTT_PORT=8000
      MQTT_USER=frigate
      MQTT_PASSWORD=your-mqtt-password

      RTSP Password (for restreaming):

      Terminal window
      FRIGATE_RTSP_PASSWORD=your-rtsp-password

      Plus API Key (optional, for Frigate+ features):

      Terminal window
      PLUS_API_KEY=your-plus-api-key

Step 4: Deploy Your Application

    1. Click Deploy to start the build process

    2. Klutch.sh will:

      • Pull your GitHub repository
      • Detect the Dockerfile automatically
      • Build the Frigate container image
      • Deploy it with your configured volumes and environment variables
    3. Monitor the build logs for any errors

    4. Once deployed, your Frigate NVR will be available at https://example-app.klutch.sh

    5. Initial startup may take 2-3 minutes as Frigate initializes the database and loads models


Initial Setup and Configuration

After deployment, configure your Frigate installation:

Step 1: Access Web Interface

    1. Navigate to https://example-app.klutch.sh in your browser

    2. You should see the Frigate web interface with a live view dashboard

    3. If no cameras are configured, you’ll see a message prompting you to add cameras

Step 2: Verify Configuration

    1. Click the settings icon (gear) in the top right corner

    2. Navigate to System to view:

      • Frigate version
      • Detector status
      • Storage usage
      • GPU/TPU availability
    3. Check that your configuration loaded correctly

Step 3: Test Camera Streams

    1. Navigate to the Live view in Frigate

    2. You should see your configured cameras streaming

    3. If cameras don’t appear:

      • Check camera RTSP URLs are correct
      • Verify network connectivity to cameras
      • Ensure camera credentials are correct
      • Check Frigate logs for connection errors

Camera Configuration

Finding Camera RTSP URLs

Most IP cameras support RTSP streaming. Common URL formats:

Generic Format:

rtsp://username:password@camera-ip:554/stream

Popular Camera Brands:

Reolink:

rtsp://username:password@camera-ip:554/h264Preview_01_main
rtsp://username:password@camera-ip:554/h264Preview_01_sub

Hikvision:

rtsp://username:password@camera-ip:554/Streaming/Channels/101
rtsp://username:password@camera-ip:554/Streaming/Channels/102

Dahua:

rtsp://username:password@camera-ip:554/cam/realmonitor?channel=1&subtype=0
rtsp://username:password@camera-ip:554/cam/realmonitor?channel=1&subtype=1

Amcrest:

rtsp://username:password@camera-ip:554/cam/realmonitor?channel=1&subtype=0

Wyze (with RTSP firmware):

rtsp://username:password@camera-ip/live

Adding Cameras to config.yml

Edit your config.yml to add cameras:

cameras:
front_door:
enabled: true
ffmpeg:
inputs:
# Main stream for recording
- path: rtsp://admin:password@192.168.1.10:554/stream1
roles:
- record
# Sub stream for detection (lower resolution = better performance)
- path: rtsp://admin:password@192.168.1.10:554/stream2
roles:
- detect
detect:
width: 640
height: 480
fps: 5
record:
enabled: true
retain:
days: 7
mode: all
events:
retain:
default: 30
snapshots:
enabled: true
timestamp: true
bounding_box: true
crop: false
backyard:
enabled: true
ffmpeg:
inputs:
- path: rtsp://admin:password@192.168.1.11:554/stream1
roles:
- record
- path: rtsp://admin:password@192.168.1.11:554/stream2
roles:
- detect
detect:
width: 640
height: 480
fps: 5
record:
enabled: true
retain:
days: 7
snapshots:
enabled: true

Stream Configuration Best Practices

    1. Use Two Streams:

      • Main stream (high resolution) for recording
      • Sub stream (lower resolution) for detection
      • Reduces CPU load significantly
    2. Detection Resolution:

      • 640x480 or 854x480 recommended
      • Higher resolution = more CPU usage
      • No significant accuracy benefit above 720p
    3. Detection FPS:

      • 5 FPS is optimal for most scenarios
      • Higher FPS = more CPU usage
      • 10+ FPS only needed for fast-moving objects
    4. Recording Settings:

      • Use main stream at full camera resolution
      • H.264 codec recommended
      • Consider bandwidth and storage

Configuring Object Detection

Detection Settings

Configure what objects to detect and track:

objects:
# Objects to track
track:
- person
- car
- dog
- cat
- bicycle
- motorcycle
# Object-specific filters
filters:
person:
min_area: 5000 # Minimum pixels
max_area: 100000 # Maximum pixels
threshold: 0.75 # Confidence threshold (0-1)
min_score: 0.6 # Minimum detection score
car:
min_area: 10000
threshold: 0.75
dog:
min_area: 3000
threshold: 0.7

Detection Zones

Define zones for targeted detection:

cameras:
front_door:
zones:
# Porch zone - only detect people
porch:
coordinates: 640,0,1280,0,1280,720,640,720
objects:
- person
# Driveway zone - detect cars and people
driveway:
coordinates: 0,400,640,400,640,720,0,720
objects:
- person
- car
# Street zone - ignore to reduce false alerts
street:
coordinates: 0,0,1280,200,1280,400,0,400
inertia: 3 # Require object present for 3 frames

Finding Zone Coordinates

    1. Access your Frigate web interface

    2. Navigate to Live view and select a camera

    3. Click the mask/zone editor icon

    4. Click points to define zone boundaries

    5. Copy the generated coordinates

    6. Paste into your config.yml


Configuring Motion Detection

Frigate uses efficient motion detection to trigger object detection:

cameras:
front_door:
motion:
# Enable motion detection
enabled: true
# Mask areas to ignore motion (trees, flags, etc.)
mask:
- 0,0,100,0,100,100,0,100 # Top-left corner
- 1180,0,1280,0,1280,100,1180,100 # Top-right corner
# Motion detection sensitivity
threshold: 25 # Lower = more sensitive (default: 25)
# Contour area threshold
contour_area: 30 # Minimum motion area in pixels
# Pixels to improve motion
improve_contrast: true
# Frame height for motion detection
frame_height: 180 # Lower = faster, less accurate

Creating Motion Masks

To reduce false alerts from trees, flags, or other moving objects:

    1. Navigate to the mask/zone editor in Frigate

    2. Select Motion Mask mode

    3. Draw polygons around areas to ignore

    4. Copy the generated coordinates

    5. Add to your config.yml under motion.mask


Recording Configuration

Continuous Recording

Configure 24/7 recording:

record:
enabled: true
# Retention settings
retain:
days: 7 # Keep recordings for 7 days
mode: all # Record continuously
# Event-based clips
events:
# Pre-capture before event
pre_capture: 5 # seconds
# Post-capture after event
post_capture: 5 # seconds
# Retention for event clips
retain:
default: 30 # days
mode: motion # Only save clips with motion
# Per-object retention
objects:
person: 60 # Keep person clips for 60 days
car: 30
dog: 14

Snapshot Configuration

Configure event snapshots:

snapshots:
enabled: true
# Clean snapshot strategy
clean_copy: true # Save clean image without bounding box
# Timestamp on snapshot
timestamp: true
# Draw bounding box
bounding_box: true
# Crop to object
crop: false
# Snapshot quality (1-100)
quality: 85
# Retention
retain:
default: 30 # days
objects:
person: 60
car: 30

MQTT Integration

Configuring MQTT

Connect Frigate to an MQTT broker for home automation:

mqtt:
enabled: true
host: mqtt-broker.klutch.sh
port: 8000
user: frigate
password: your-mqtt-password
# Client ID
client_id: frigate
# Topic prefix
topic_prefix: frigate
# Stats interval (seconds)
stats_interval: 60

Note: Deploy an MQTT broker first. See our EMQX deployment guide for instructions.

MQTT Topics

Frigate publishes events to MQTT topics:

Event Topics:

  • frigate/{camera}/person - Person detected
  • frigate/{camera}/car - Car detected
  • frigate/{camera}/events - All events

State Topics:

  • frigate/available - Frigate online status
  • frigate/{camera}/recordings - Recording status
  • frigate/{camera}/snapshots - Snapshot status

Command Topics:

  • frigate/{camera}/detect/set - Enable/disable detection
  • frigate/{camera}/recordings/set - Enable/disable recording
  • frigate/{camera}/snapshots/set - Enable/disable snapshots

Home Assistant Integration

Frigate integrates seamlessly with Home Assistant:

    1. Install the Frigate integration in Home Assistant

    2. Add your Frigate instance:

      • URL: https://example-app.klutch.sh
      • MQTT: Auto-discovered if using same broker
    3. Frigate entities will appear in Home Assistant:

      • Camera live feeds
      • Event sensors
      • Recording switches
      • Snapshot buttons

Hardware Acceleration

CPU Detection (Default)

Frigate uses CPU-based detection by default:

detectors:
cpu1:
type: cpu
num_threads: 3 # Adjust based on available CPUs

Google Coral TPU

For significant performance improvement, use a Coral TPU:

detectors:
coral:
type: edgetpu
device: usb

Note: Coral TPU requires USB passthrough, which may not be available in containerized environments. Consider CPU detection or NVIDIA GPU for cloud deployments.

NVIDIA GPU

Use NVIDIA GPU for acceleration:

detectors:
tensorrt:
type: tensorrt
device: 0 # GPU device ID

Update Dockerfile to use TensorRT image:

FROM ghcr.io/blakeblackshear/frigate:stable-tensorrt

Intel OpenVINO

Use Intel integrated graphics:

detectors:
openvino:
type: openvino
device: GPU

Performance Optimization

Reduce CPU Usage

    1. Use Lower Resolution for Detection:

      detect:
      width: 640
      height: 480
    2. Reduce Detection FPS:

      detect:
      fps: 5
    3. Use Sub-Streams:

      • Configure separate streams for recording and detection
      • Detection uses lower resolution stream
    4. Limit Tracked Objects:

      objects:
      track:
      - person
      - car
    5. Optimize Motion Detection:

      motion:
      frame_height: 180
      threshold: 25

Optimize Storage

    1. Adjust Retention Periods:

      record:
      retain:
      days: 7 # Reduce for less storage
    2. Use Event-Based Recording:

      record:
      retain:
      mode: motion # Only save when motion detected
    3. Lower Recording Resolution:

      • Configure cameras to use lower bitrate for recording
      • Balance quality vs storage
    4. Enable Database Vacuum:

      • Frigate automatically optimizes database
      • Manually vacuum if database grows large

Notifications and Alerts

MQTT Notifications

Use MQTT events to trigger notifications:

Example: Node.js MQTT Client

const mqtt = require('mqtt');
const client = mqtt.connect('mqtt://mqtt-broker.klutch.sh:8000', {
username: 'frigate',
password: 'your-mqtt-password'
});
client.on('connect', () => {
console.log('Connected to MQTT broker');
// Subscribe to all Frigate events
client.subscribe('frigate/+/person');
client.subscribe('frigate/+/car');
});
client.on('message', (topic, message) => {
const event = JSON.parse(message.toString());
if (event.type === 'new' && event.after.label === 'person') {
console.log(`Person detected at ${event.after.camera}`);
// Send notification (email, SMS, push, etc.)
sendNotification({
title: 'Person Detected',
message: `Person detected on ${event.after.camera}`,
image: `https://example-app.klutch.sh/api/${event.after.camera}/person/snapshot.jpg?bbox=1`
});
}
});

REST API Notifications

Use Frigate’s REST API to query events:

Terminal window
# Get recent events
curl https://example-app.klutch.sh/api/events
# Get events for specific camera
curl https://example-app.klutch.sh/api/events?camera=front_door
# Get events for specific object
curl https://example-app.klutch.sh/api/events?label=person
# Get event snapshot
curl https://example-app.klutch.sh/api/events/{event_id}/snapshot.jpg

Security Best Practices

Authentication

    1. Proxy Authentication:

      • Frigate doesn’t have built-in authentication
      • Use a reverse proxy with authentication (Nginx, Caddy, Authelia)
      • Klutch.sh provides HTTPS by default
    2. Network Segmentation:

      • Place cameras on isolated VLAN
      • Restrict camera internet access
      • Only allow Frigate to access cameras
    3. RTSP Credentials:

      • Use strong passwords for camera RTSP access
      • Change default camera credentials
      • Store credentials in environment variables (not config.yml)

Camera Security

    1. Disable Cloud Services:

      • Disable manufacturer cloud features
      • Block camera internet access via firewall
      • Use local-only recording
    2. Firmware Updates:

      • Keep camera firmware updated
      • Check manufacturer security bulletins
      • Test updates before deploying to all cameras
    3. Network Isolation:

      • Use separate network for cameras
      • Implement firewall rules
      • Monitor network traffic

Access Control

    1. HTTPS Only:

      • Klutch.sh provides automatic HTTPS
      • Never expose Frigate over HTTP
      • Use secure WebSocket for live streams
    2. IP Whitelisting:

      • Restrict access to known IP addresses
      • Use VPN for remote access
      • Implement rate limiting
    3. Regular Audits:

      • Review Frigate logs regularly
      • Monitor access patterns
      • Check for unauthorized access attempts

Backup and Recovery

Configuration Backup

    1. Version Control:

      • Store config.yml in GitHub
      • Commit changes with descriptive messages
      • Use branches for testing changes
    2. Automated Backups:

      • Backup configuration directory
      • Export zone and mask coordinates
      • Document camera settings

Database Backup

    1. SQLite Database:

      • Located at /media/frigate/frigate.db
      • Backup regularly for event history
      • Use SQLite backup command:
      Terminal window
      sqlite3 /media/frigate/frigate.db ".backup /media/frigate/backups/frigate-backup.db"
    2. Automated Backup Script:

      #!/bin/bash
      DATE=$(date +%Y%m%d-%H%M%S)
      sqlite3 /media/frigate/frigate.db ".backup /media/frigate/backups/frigate-$DATE.db"
      find /media/frigate/backups -name "frigate-*.db" -mtime +30 -delete

Recording Backup

    1. Important Events:

      • Export critical event clips
      • Save snapshots separately
      • Consider cloud backup for important footage
    2. Bulk Export:

      • Use Frigate’s export feature in web UI
      • Download clips via REST API
      • Automate exports for specific labels

Monitoring and Maintenance

System Monitoring

    1. Frigate Web UI:

      • Navigate to System page
      • Monitor CPU, RAM, and GPU usage
      • Check detector statistics
      • Review storage usage
    2. Klutch.sh Dashboard:

      • Monitor resource utilization
      • Track CPU and memory usage
      • Review volume storage
      • Check application health
    3. Frigate Stats API:

      Terminal window
      curl https://example-app.klutch.sh/api/stats

Log Monitoring

    1. Frigate Logs:

      • View logs in Klutch.sh dashboard
      • Check for camera connection errors
      • Monitor detector performance
      • Review MQTT connection status
    2. Common Log Messages:

      • Unable to connect to camera: Check RTSP URL and credentials
      • Detector appears to have stopped: Restart application
      • MQTT connection lost: Check MQTT broker connectivity
      • Out of memory: Increase RAM allocation

Regular Maintenance

    1. Weekly Tasks:

      • Review detection accuracy
      • Check recording retention
      • Monitor storage usage
      • Verify camera connectivity
      • Review event notifications
    2. Monthly Tasks:

      • Update Frigate to latest version
      • Optimize database (automatic)
      • Review and adjust zones
      • Clean up old recordings
      • Audit camera access
    3. Quarterly Tasks:

      • Review configuration
      • Update camera firmware
      • Test disaster recovery
      • Audit security settings
      • Review performance metrics

Troubleshooting Common Issues

Frigate Won’t Start

    1. Check Logs:

      • View application logs in Klutch.sh dashboard
      • Look for configuration errors
      • Check for missing environment variables
    2. Verify Configuration:

      • Validate config.yml syntax
      • Check for typos in camera names
      • Ensure RTSP URLs are correct
    3. Check Resources:

      • Verify sufficient RAM allocated
      • Check CPU availability
      • Ensure storage volume mounted correctly

Camera Not Connecting

    1. Verify RTSP URL:

      • Test RTSP URL with VLC or FFmpeg
      • Check camera IP address
      • Verify port number (usually 554)
    2. Check Credentials:

      • Verify username and password
      • Check for special characters in password
      • Ensure camera allows RTSP connections
    3. Network Connectivity:

      • Ping camera IP address
      • Check firewall rules
      • Verify network routing
    4. Test with FFmpeg:

      Terminal window
      ffmpeg -rtsp_transport tcp -i "rtsp://username:password@camera-ip:554/stream" -frames:v 1 test.jpg

No Object Detection

    1. Check Detector Status:

      • Navigate to System page
      • Verify detector is running
      • Check detector logs for errors
    2. Verify Motion Detection:

      • Check if motion is being detected
      • Review motion detection settings
      • Adjust motion threshold
    3. Review Object Filters:

      • Check min_area and max_area settings
      • Verify confidence threshold
      • Ensure objects are in tracked list
    4. Test Detection:

      • Walk in front of camera
      • Check live view for detection boxes
      • Review recent events

Poor Detection Accuracy

    1. Adjust Confidence Threshold:

      objects:
      filters:
      person:
      threshold: 0.7 # Lower for more detections
    2. Optimize Detection Area:

      • Adjust min_area for object size
      • Review zone coordinates
      • Check camera angle and positioning
    3. Improve Lighting:

      • Add lighting to detection areas
      • Enable camera night vision
      • Adjust camera exposure settings
    4. Use Zones:

      • Create specific zones for detection
      • Exclude areas with false positives
      • Adjust zone-specific filters

High CPU Usage

    1. Reduce Detection Load:

      • Lower detection FPS (5 recommended)
      • Use lower resolution for detection
      • Reduce number of tracked objects
    2. Optimize Motion Detection:

      • Increase motion threshold
      • Add motion masks for busy areas
      • Lower motion frame height
    3. Use Sub-Streams:

      • Configure separate streams for detection
      • Use main stream only for recording
    4. Scale Resources:

      • Increase CPU allocation in Klutch.sh
      • Consider hardware acceleration
      • Reduce number of cameras

Recording Issues

    1. Check Storage Space:

      • Verify volume has sufficient space
      • Review retention settings
      • Manually delete old recordings if needed
    2. Verify Recording Settings:

      record:
      enabled: true
      retain:
      days: 7
    3. Check FFmpeg Errors:

      • Review Frigate logs for FFmpeg errors
      • Test camera stream stability
      • Adjust FFmpeg input parameters
    4. Database Issues:

      • Check database file permissions
      • Verify database not corrupted
      • Restart Frigate to rebuild cache

Advanced Features

Multi-Camera Views

Create custom camera groups:

camera_groups:
front:
cameras:
- front_door
- driveway
icon: mdi:home-outline
order: 1
back:
cameras:
- backyard
- garage
icon: mdi:garage
order: 2

Custom Notifications

Use webhooks for custom notifications:

# Not built into Frigate, use external service with MQTT or API

Search recordings by detected objects:

    1. Navigate to Events page

    2. Filter by:

      • Camera
      • Object label
      • Date range
      • Zone
    3. Click event to view clip and snapshot

    4. Export clips as needed

Statistics and Analytics

View detection statistics:

    1. Navigate to Storage page for space usage

    2. Use REST API for custom analytics:

      Terminal window
      # Get event count by label
      curl https://example-app.klutch.sh/api/events?limit=0&label=person
      # Get events in date range
      curl "https://example-app.klutch.sh/api/events?after=1640995200&before=1641081600"
    3. Export data for visualization in external tools


Scaling Considerations

Adding More Cameras

    1. Resource Planning:

      • Estimate 5-10% CPU per camera (720p @ 5fps)
      • Plan storage: ~1-2GB/day per camera (depends on activity)
      • Scale RAM: 1-2GB base + 200-300MB per camera
    2. Update Configuration:

      • Add cameras to config.yml
      • Configure detection settings
      • Set up zones and masks
    3. Scale Klutch.sh Resources:

      • Increase CPU allocation
      • Add more RAM
      • Expand storage volumes

Multi-Instance Deployment

For large deployments, use multiple Frigate instances:

    1. Split by Location:

      • Deploy separate instances per building/location
      • Configure separate MQTT topics
      • Use Redis for shared state (optional)
    2. Load Balancing:

      • Distribute cameras across instances
      • Balance by detection load
      • Consider network bandwidth
    3. Centralized Management:

      • Use Home Assistant to aggregate instances
      • Centralized notification handling
      • Unified event storage

Production Deployment Checklist

Before going live with Frigate:

  • Persistent volumes configured and tested (minimum 50GB for /media/frigate)
  • All environment variables set correctly
  • Camera RTSP streams tested and working
  • config.yml configured with all cameras
  • Detection zones defined for each camera
  • Motion masks created to reduce false alerts
  • Recording retention configured
  • Snapshot settings configured
  • MQTT broker deployed and connected (optional)
  • Home Assistant integration tested (optional)
  • HTTPS working correctly (automatic via Klutch.sh)
  • Event notifications tested
  • CPU/RAM resources sized appropriately
  • Storage usage monitored
  • Backup strategy implemented
  • Security best practices applied
  • Camera network segmented
  • Firmware updated on all cameras
  • Logs reviewed for errors
  • Performance metrics validated
  • Documentation updated with camera details

Resources and Further Reading


Conclusion

Deploying Frigate on Klutch.sh gives you a powerful, self-hosted security camera system with intelligent AI object detection. With automatic HTTPS, persistent storage for recordings, flexible resource scaling, and seamless home automation integration, you can build a professional-grade surveillance solution without the complexity of managing physical servers or dealing with cloud service limitations.

This guide covered everything from initial deployment to advanced configuration, including camera setup, object detection tuning, zone configuration, MQTT integration, recording management, and troubleshooting. Whether you’re setting up a simple home security system or deploying a multi-camera surveillance network, Frigate on Klutch.sh provides the performance, reliability, and features you need.

Remember to keep your system updated, monitor resource usage, regularly review detection accuracy, and follow security best practices to protect your camera feeds and recordings. For additional help or questions, refer to the resources above or engage with the Frigate community.

Happy monitoring!