In this project, we will show you how to Install Frigate NVR on your Raspberry Pi.
Frigate is an open-source and free network video recorder that can process your camera streams in real-time.
While the Raspberry Pi isn’t the most powerful device, it can handle a couple of cameras on Frigate. Additionally, combining the Pi with a Coral accelerator can even run AI models on your streams.
Frigate will integrate nicely with Home Assistant if you have that and MQTT installed on your Raspberry Pi.
Over the following sections, we will show you how to install Frigate on your Raspberry Pi and configure it to utilize hardware acceleration.
For the best experience with Frigate, we highly recommend using a Raspberry Pi 4. It is highly recommended that you invest in a Coral TPU, as that will substantially improve the performance of Frigate on your Pi.
Before continuing with this tutorial, be sure to taper your expectations. The Raspberry Pi will only be able to handle a couple of cameras if they use the H264 codec. H265 will cause significant slowdowns as there is no hardware acceleration for that codec on the Pi.
Equipment
Below is the equipment we used to set up Frigate NVR on our Raspberry Pi.
Recommended
- Raspberry Pi ( Amazon | SunFounder )
- Micro SD Card ( Amazon | SunFounder )
- Power Supply ( Amazon | SunFounder )
- Ethernet Cable ( Amazon ) or Wi-Fi ( Amazon | SunFounder )
Optional
- Raspberry Pi Case ( Amazon | SunFounder )
- USB Mouse ( Amazon | SunFounder )
- USB Keyboard ( Amazon | SunFounder )
- HDMI Cable ( Amazon | SunFounder )
- Monitor ( Amazon | SunFounder )
This tutorial was tested on a Raspberry Pi 400, running the latest version of Raspberry Pi OS Bullseye.
Installing Frigate NVR on the Raspberry Pi
In the following section, you will learn how to install Frigate NVR and get it to run on your Raspberry Pi.
Installing the software will is a relatively straightforward process. However, configuring Frigate NVR takes some time and reading.
Preparing your Raspberry Pi for Frigate
1. Our first step is to ensure we have an up-to-date system to work off.
You can upgrade all existing packages and update the package list by using the following two commands.
sudo apt update
sudo apt upgrade -y
2. Next, follow our guide on installing Docker on the Raspberry Pi.
Docker makes running Frigate a super straightforward process. You can install Docker by running the following command.
3. Once you have Docker installed, you can continue with this guide.
Creating Directories for Frigate NVR
4. Our next step is to create a directory to store our docker-compose file for Frigate on our Raspberry Pi.
We will be creating this directory by using the mkdir command. It will be called “frigate-nvr
” and stored within the current user’s home directory.
mkdir ~/frigate-nvr
5. Next, we will create a directory for Frigate NVR to store its data on our Raspberry Pi.
If you want your data to be stored on a mounted drive or a network drive, mount it before continuing with this guide and note the mount point.
mkdir ~/frigate-nvr/storage
Writing a Basic Config File for Frigate NVR On your Raspberry Pi
6. For Frigate NVR to run on your Raspberry Pi, it does require a basic configuration file to be created. You will need your camera to be set up and with a readable input stream.
We can begin writing this configuration file by using the command below.
nano ~/frigate-nvr/config.yml
7. Within this file, you will want to start with a basic configuration you can add to as you grow your NVR setup. We won’t be delving too much into this as it can get complicated and is out of the scope of this install guide.
We have included the “hwaccel
” tag so that Frigate NVR on your Raspberry Pi will use hardware acceleration when dealing with h264 streams.
If you want to learn more about configuring Frigate NVR, check out their official guides. Particular cameras will require additional settings to work within Frigate.
mqtt:
enabled: False
ffmpeg:
hwaccel_args: preset-rpi-64-h264 #Enable Hardware Acceleration
cameras:
name_of_your_camera: #Name for your comment
ffmpeg:
inputs:
- path: rtsp://10.0.10.10:554/rtsp #The Stream you want to monitor
roles:
- detect
detect:
enabled: False # Detection is disabled
width: 1280 # The Cameras resolution
height: 720 # The Cameras resolution
8. Once you have filled out this configuration file, save and quit by pressing CTRL + X, then Y, followed by the ENTER key.
Setting up the Docker Compose File
9. Our next step is to write a compose file for Docker to manage Frigate NVR on the Raspberry Pi.
Begin writing this file by using the following command in the terminal.
nano ~/frigate-nvr/docker-compose.yml
10. Within this file, type out the following lines.
Ensure that you replace “<USERNAME>
” with the name of your user. Additionally, you will want to replace “<PASSWORD>
” with a password of your choosing.
Also, you can change “/home/<USERNAME>/frigate-nvr/storage
” to point to where you want Frigate to store its recordings on your Raspberry Pi.
services:
frigate:
container_name: frigate
privileged: true # this may not be necessary for all setups
restart: unless-stopped
image: ghcr.io/blakeblackshear/frigate:0.14.1-standard-arm64
shm_size: "64mb"
devices:
- /dev/bus/usb:/dev/bus/usb #Used for Coral if Available
- /dev/video10 #Map the Pi hardware acceleration
volumes:
- /etc/localtime:/etc/localtime:ro
- /home/<USERNAME>/frigate-nvr/config.yml:/config/config.yml
- /home/<USERNAME>/frigate-nvr/storage:/media/frigate
- type: tmpfs #Remove this if using a Pi with 2GB or Less RAM
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: "<PASSWORD>"
11. With the file filled out, save and quit by pressing CTRL + X, followed by Y, then the ENTER key.
Launching Frigate NVR On your Raspberry Pi
12. We now need to ensure that we are in the directory where we wrote the Docker compose file earlier.
To change to this directory, use the following command.
cd ~/frigate-nvr
13. Now that we are in the right place, we can bring Frigate NVR online on our Raspberry Pi by using the command below.
After running this command, Docker will download Frigate’s container and start it up immediately.
docker compose up -d
By using the “-d
” option we are telling Docker to start the application detached. If for some reason Frigate didn’t launch, try removing this option to view the logs from Frigate.
Accessing the Frigate NVR Web Interface
14. You will now have Frigate NVR up and running on your Raspberry Pi.
You will now want to access its web interface by going to the following address in your web browser. Ensure you replace “<RASPBERRYPIIP>
” with the IP of your device.
http://<RASPBERRYPIIP>:5000
15. You should now see a screen similar to the one below.
As the black screen indicates, we haven’t configured our camera correctly yet. If you see something similar, you will need to adjust your settings.
Conclusion
You should now have Frigate NVR on the Raspberry Pi at this point in the tutorial.
While the Raspberry Pi can’t process too many video feeds, it is helpful if you only need to manage a couple of cameras. Pairing the Pi with a Coral Accelerator will even let you perform AI detections on a video feed.
Please comment below if you have questions about getting Frigate NVR to run on your device.
If you found this tutorial useful, be sure to check out our many other Raspberry Pi projects.
in step 10
uncomment line: version: “3.9”
modify line:
image: ghcr.io/blakeblackshear/frigate:stable
into:
ghcr.io/blakeblackshear/frigate:0.14.1-standard-arm64
due to recent release update for Frigate
Hi Rene,
Thank you for pointing this out. I have updated the tutorial to point to the latest release at the time of writing. It’s a bit of a a frustrating change on there part.
Kind regards,
Emmet
Hi, on my RPi 4B 4GB there is no option to set GPU Memory Allocation and I’m not sure what to do.
Hi Yusuf,
Due to changes with the Raspberry Pi and its operating system, that option is no longer relevant, and I have removed the steps from the tutorial.
Kind regards,
Emmet
Another question sorry, if I use an old laptop such as Dell XPS15 would I still need something like the Coral TPU, or is that mainly for RPis?
How is it like on a Pi5? Or shall I get a mini pc for this, what spec and I looking for exactly? I don’t need a powerful graphics card right?
Hi Alex,
You can definitely get away with a Raspberry Pi 5 but if you want to use AI detections something like the Coral TPU is a must.
On the case of wanting to use your old laptop instead, I would still highly recommend a Coral TPU as it significantly reduces the processing requirement when dealing with AI detections.
Please let me know if that helps answer your question.
Kind regards,
Emmet
Worked like a charm! is there a linke where I can buy you a coffee or beer or something?
thanks again, have a good one!
Hi Galo,
Glad to hear that this worked perfectly for you. If you are interested in supporting us we do offer a “Premium” which gives you ad-free access to the website.
Kind regards,
Emmet