Come hang with us on Discord and chat directly with the team!Discordtop-bar-close-icon

2024-09-22

How to Install Frigate on Ubuntu Server

tutorials
img

Frigate offers a powerful solution for video surveillance on Ubuntu, utilizing low-cost hardware like Raspberry Pi. Follow this guide to install Frigate, a solution supporting live streaming and motion detection.

Step 1: Update Server

Ensure your server is up to date:

sudo apt update
sudo apt upgrade

Step 2: Install Docker

Frigate runs on Docker. Install Docker with:

curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh

Verify installation:

sudo docker version

Step 3: Install Frigate

Create a directory for Frigate configuration:

sudo mkdir -p /etc/frigate

Set up configuration files:

sudo nano /etc/frigate/config.yml

Use the following YAML configuration:

mqtt:
  host: mqtt://localhost
rtmp:
  enabled: true
  stream_labels: true
  movie_url: http://localhost:8080/
cameras:
  - name: Camera1
    ffmpeg:
      inputs:
        - rtsp://user:password@192.168.1.15:554/1
      width: 640
      height: 480
      fps: 10
    detect:
      objects:
        person:
        car:
      mask:
        - /etc/frigate/mask.png

Now create a Docker Compose file:

sudo nano /etc/frigate/docker-compose.yml

Add this configuration:

version: '3'
services:
  frigate:
    image: blakeblackshear/frigate:stable-amd64
    restart: always
    environment:
      - FRIGATE_RTSP_PASSWORD=password
    devices:
      - /dev/video0
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /etc/frigate:/config
    ports:
      - "5000:5000"
      - "1935:1935"
    command: /start.sh

Step 4: Start Frigate

Launch Frigate with Docker Compose:

sudo docker-compose -f /etc/frigate/docker-compose.yml up -d

Verify with:

sudo docker ps

Step 5: Access Frigate Web Interface

Open a browser and go to http://[Your server IP address]:5000 to access Frigate's interface.

Conclusion

You have successfully installed Frigate on Ubuntu Server, which supports video streaming and motion detection through Docker Compose.