Karambir Nain

Home Surveillance Setup - NVR and Cameras

A comprehensive guide to setting up a professional home surveillance system using PoE cameras, network switches, and Frigate NVR software with proper network security.

Introduction

Setting up a home surveillance system has become increasingly accessible with modern IP cameras and open-source NVR software. This guide walks you through creating a robust, secure surveillance network using Power over Ethernet (PoE) cameras, managed network switches, and Frigate NVR software running on a Raspberry Pi or laptop.

Key benefits of this approach:

Network Architecture Overview

The following diagram illustrates the complete network architecture for our home surveillance system:

Home surveillance network architecture diagram showing camera VLAN isolation, PoE switch, and NVR setup

Network Architecture - Isolated Camera Network with VLAN

This architecture ensures that cameras are isolated on their own network segment (VLAN 10), preventing direct access to your main home network while allowing the NVR to manage and record from all cameras.

IP Camera Categories

Indoor Cameras

Outdoor Cameras

Night Vision Capabilities

Lens and Field of View

Camera Recommendations

Budget (₹1,500-3,000)

Mid-range-Premium (₹3,000-7,000)

(PoE) Network Switch Setup

Understanding PoE Technology

Power over Ethernet delivers both data and power through a single Ethernet cable, eliminating the need for separate power adapters at each camera location.

PoE Standards:

Switch Selection for Home Use

6-8 Port PoE Switches (Recommended for homes)

Switch Recommendations

Budget (₹1,500-3,000)

Mid-range-Premium (₹4,000-15,000)

Installation Tips:

PoE Camera Setup

Physical Installation

Cable Requirements:

Cable Recommendation:

Installation Steps:

  1. Plan camera positions

    • Test camera angles using smartphone camera first
    • Consider lighting conditions at different times
    • Ensure adequate PoE power delivery distance
  2. Run Ethernet cables

    • Use cable tester to verify connections
    • Label cables clearly at both ends
    • Secure cables to prevent tampering
  3. Connect and test

    • Connect camera to PoE switch
    • Camera should power on automatically
    • Check switch LED indicators for link status

Network Configuration

RTSP Stream Configuration

Getting RTSP URLs: Most IP cameras provide RTSP streams in this format:

rtsp://username:password@camera_ip:554/stream1
rtsp://username:password@camera_ip:554/stream2

Common paths:

Test RTSP Stream:

Camera Security Configuration

Essential Security Settings:

  1. Change default credentials

    • Use strong passwords (12+ characters)
    • Enable two-factor authentication if available
  2. Disable unnecessary services

    • Turn off UPnP, P2P cloud services
    • Disable ONVIF if not needed
    • Remove default user accounts
  3. Network isolation

    • Place cameras on dedicated VLAN
    • Block internet access for cameras
    • Use firewall rules to restrict access

Network Video Recorder (NVR) Setup

Hardware Requirements

Minimum Specifications:

Recommended Hardware:

  1. Raspberry Pi Setup (₹8,000-12,000)

    • Raspberry Pi 4 (8GB RAM)
    • 64GB microSD for OS
    • 1TB USB 3.0 SSD for recordings
    • Official PoE+ HAT (if using PoE)
  2. Mini PC Setup (₹15,000-25,000)

    • Intel NUC or similar
    • 8GB RAM, 256GB SSD
    • Additional 2TB HDD for recordings

Operating System Installation

Debian Installation:

sudo apt update && sudo apt upgrade -y
sudo apt install curl wget git vim htop

System Configuration:

# interface eth0
static ip_address=192.168.1.100/24
static routers=192.168.1.1
static domain_name_servers=192.168.1.1

# Restart networking
sudo systemctl restart dhcpcd

Configure NVR

Docker Installation

# Install Docker
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo usermod -aG docker $USER

# Install Docker Compose
sudo apt install docker-compose-plugin

# Verify installation
docker --version
docker compose version

Frigate Installation

Create Frigate directory structure:

mkdir -p ~/frigate/{config,media,database}
cd ~/frigate

Create docker-compose.yml:

version: "3.9"
services:
  frigate:
    container_name: frigate
    privileged: true
    restart: unless-stopped
    image: ghcr.io/blakeblackshear/frigate:stable
    shm_size: "64mb"
    devices:
      - /dev/bus/usb:/dev/bus/usb  # Coral USB accelerator
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - ./config:/config
      - ./media:/media/frigate
      - type: tmpfs
        target: /tmp/cache
        tmpfs:
          size: 1000000000
    ports:
      - "5000:5000"
      - "8554:8554" # RTSP feeds
      - "8555:8555/tcp" # WebRTC over tcp
      - "8555:8555/udp" # WebRTC over udp
    environment:
      FRIGATE_RTSP_PASSWORD: "your_password_here"

Create Frigate configuration (config/config.yml):

mqtt:
  enabled: false

database:
  path: /config/frigate.db

detectors:
  cpu1:
    type: cpu
    num_threads: 3

cameras:
  front_door:
    ffmpeg:
      inputs:
        - path: rtsp://admin:[email protected]:554/stream1
          roles:
            - record
            - detect
        - path: rtsp://admin:[email protected]:554/stream2
          roles:
            - detect
    detect:
      width: 640
      height: 480
      fps: 5
    record:
      enabled: true
      retain:
        days: 7
        mode: motion
    snapshots:
      enabled: true
      timestamp: false
      bounding_box: true

  balcony:
    ffmpeg:
      inputs:
        - path: rtsp://admin:[email protected]:554/stream1
          roles:
            - record
            - detect
    detect:
      width: 640
      height: 480
      fps: 5
    record:
      enabled: true
      retain:
        days: 7
        mode: motion

go2rtc:
  streams:
    front_door:
      - rtsp://admin:[email protected]:554/stream1
    balcony:
      - rtsp://admin:[email protected]:554/stream1

Security

VLAN Configuration

Create Camera VLAN (VLAN 10):

Router/Firewall Rules:

UPS Backup Solution

UPS Recommendations:

UPS Configuration:

Remote Backup Strategy

Backup Media Directory:

#!/bin/bash
# Frigate media backup script
SOURCE="/home/user/frigate/media"
DEST="user@backup-server:/backups/frigate"
DATE=$(date +%Y%m%d)

# Sync recordings (keep last 30 days)
rsync -avz --delete --exclude="*.tmp" \
  --include="*/" --include="*.mp4" --include="*.jpg" \
  --exclude="*" "$SOURCE/" "$DEST/"

# Create daily archive of important events
tar -czf "/tmp/frigate_events_$DATE.tar.gz" \
  "$SOURCE/events" 2>/dev/null

# Upload to remote server
scp "/tmp/frigate_events_$DATE.tar.gz" \
  "user@backup-server:/backups/archives/"

# Cleanup local archive
rm "/tmp/frigate_events_$DATE.tar.gz"

# Log backup completion
echo "$(date): Backup completed" >> /var/log/frigate_backup.log

Automate with Cron:

Cloud Backup Options:

Additional Security Measures

Network Monitoring:

Access Control:


There are lot of things that can be improved:

Try reading the Frigate documentation for more information.