Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Help about MediaWiki
FUTO
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Introduction to a Self Managed Life: a 13 hour & 28 minute presentation by FUTO software
(section)
Main Page
Discussion
English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==== 3.2 Install Frigate ==== <ol style="list-style-type: decimal;"> <li><p>'''Create a Directory for Frigate:'''</p> <ul> <li><p>Run the following command to create a directory to store Frigate files:</p> <pre>mkdir -p /home/$USER/Downloads/programs cd ~/Downloads/programs</pre></li></ul> </li> <li><p>'''Clone the Frigate Repository:'''</p> <ul> <li><p>Clone the Frigate GitHub repository by running:</p> <pre>git clone https://github.com/blakeblackshear/frigate.git cd frigate</pre></li></ul> </li> <li><p>'''Set Up Docker Compose for Frigate:'''</p> <ul> <li><p>Create and edit the <code>docker-compose.yml</code> file. '''Make sure it specifies Frigate version 0.13.2. New versions use a horrible user interface that is [https://www.youtube.com/watch?v=uiFLqqKkj3M&t=117s rage inducing.]''' My example file below specifies version 0.13.2 for you. You’ll need to set the container name, restart policy, image version, shared memory size, devices (e.g., USB Coral, PCIe Coral, video device for Raspberry Pi), and volumes for storing local time, config files, media, and cache. Be sure to open necessary ports (e.g., 5000, 8971, 8554, 8555).</p></li> <li><p>*'''If any of what I said''' in the last bulletpoint after the “rage inducing” part '''confuses the hell out of you''', don’t worry: you have the easiest path there is; '''JUST COPY AND PASTE BELOW WITHOUT MESSING WITH IT!'''</p></li></ul> </li></ol> <pre>version: "3.9" services: frigate: container_name: frigate privileged: true # This may not be necessary for all setups restart: unless-stopped image: ghcr.io/blakeblackshear/frigate:0.13.2 # Last good version shm_size: "64mb" # Update for your cameras based on requirements devices: - /dev/bus/usb:/dev/bus/usb # USB Coral, modify for other hardware - /dev/apex_0:/dev/apex_0 # PCIe Coral, modify based on your setup - /dev/video11:/dev/video11 # For Raspberry Pi 4B - /dev/dri/renderD128:/dev/dri/renderD128 # Intel hwaccel, update for your hardware volumes: - /etc/localtime:/etc/localtime:ro - ./config:/config - ./storage:/media/frigate - ./database:/data/db - type: tmpfs # Optional: Reduces SSD wear target: /tmp/cache tmpfs: size: 1000000000 ports: - "8971:8971" - "5000:5000" # Internal unauthenticated access. Be careful with exposure. - "8554:8554" # RTSP feeds - "8555:8555/tcp" # WebRTC over TCP - "8555:8555/udp" # WebRTC over UDP environment: FRIGATE_RTSP_PASSWORD: "password"</pre> <blockquote>'''IMPORTANT NOTE:''' This is going to record to your solid state drive for your main drive by default, which is very bad practice. The only reason it is configured this way is because we have not gotten to the zfs pool creation part of the guide, where we will create a redundant, encrypted, self-healing array of drives as a zfs pool. We want to record camera footage to large hard drives, not tiny solid state drives. Later on in the guide, you will want to change this once ZFS is set up. The two lines of interest will be: </blockquote> <pre> - ./storage:/media/frigate - ./database:/data/db</pre> * This is still set to record everything to main drive: we will come back to edit this later once we have set up a ZFS pool at the end. > '''DOCKER CHEAT SHEET: breaking down the <code>docker-compose.yml</code> File for Frigate''' > Every line of this <code>docker-compose.yml</code> is there for a reason. You likely have no clue what this is all for if you are reading this, so let’s go through it. > > '''1. <code>version: "3.9"</code>''' > This is the version of Docker Compose file format. Version <code>3.9</code> is compatible with new Docker setups > > '''2. <code>services:</code>''' > This section defines the “services” you want to run, which are containers. Here, we only have one container: <code>frigate</code>. > > '''3. <code>frigate:</code>''' > This is the name of the service(container). It helps you identify the container in logs or commands like <code>docker ps</code>. You can name it anything you like, but <code>frigate</code> makes sense since that’s the application we’re running. > > '''4. <code>container_name: frigate</code>''' > Custom name for the frigate container so it is easy to find when you type <code>docker ps -a</code> . Sometimes while debugging things that are not working you may want to enter the environment of the virtual container''(this is like sshing into your server, but into the virtual server that runs frigate)'', which you can do by typing <code>docker exec -it frigate bash</code> - but to do that you need to know which container is which! This is where using sensible names comes into play. > > '''5. <code>privileged: true</code>''' > Running the container in “privileged mode” allows it to access hardware devices like USB or PCIe directly. This is done because frigate can use devices you plug in(like a coral) to improve the performance of the machine learning for detecting items on camera(car, human, bird, etc) > > ''Warning:'' This gives the container elevated permissions, so only use it if absolutely needed (like here). > > '''6. <code>restart: unless-stopped</code>''' > This tells Docker to restart the container unless you stop it. If the computer reboots or the container crashes, it will turn back on automatically > > '''7. <code>image: ghcr.io/blakeblackshear/frigate:0.13.2</code>''' > This tells it what Docker image to use. Here, we’re pulling version <code>0.13.2</code> of Frigate from github container registry (<code>ghcr.io</code>) instead of the newest one because the user interface was tortured & butchered to death with new releases. They destroyed it. It makes me sad how bad new versions are. > > '''8. <code>shm_size: "64mb"</code>''' > This sets the size of shared memory available to the container. frigate uses shared memory for hardware acceleration and video processing. frigate documentation tells you how to increase this based on how many cameras you have running. > > '''9. <code>devices:</code>''' > This part of the docker-compose file maps hardware devices from your host system''(the physical computer you are installing this program onto)'' into the container. Frigate needs access to specific hardware for video processing. Let’s explain each line: > > - <code>/dev/bus/usb:/dev/bus/usb</code>: Maps USB devices for hardware like a USB Coral accelerator which can improve/speed up object detection & take the load off of the host computer. > - <code>/dev/apex_0:/dev/apex_0</code>: Maps a pci express coral thing for faster object detection. > - <code>/dev/video11:/dev/video11</code>: Maps a video input device, like a camera, for systems like Raspberry Pi. > - <code>/dev/dri/renderD128:/dev/dri/renderD128</code>: Maps Intel hardware acceleration for video encoding/decoding. > > '''10. <code>volumes:</code>''' > This section maps directories or volumes between the host and the container. Volumes are where we save configuration, media, and data outside the container so they continue existing even if the container is restarted/deleted/shut off. > > - <code>/etc/localtime:/etc/localtime:ro</code>: This maps the time of the host computer to the time of the container(“computer”) running frigate. The <code>:ro</code> means “read-only,” so the container can’t cause the host machine to time travel. Time travel is cool though. If you agree, watch the movie '''Primer''' - you won’t be disappointed. '''Triangle''' is a close second. The ending messes me up every time. > - <code>./config:/config</code>: Maps the <code>config</code> directory on the host to <code>/config</code> in the container, where Frigate expects its configuration file. > - <code>./storage:/media/frigate</code>: Maps the <code>storage</code> directory on the host to <code>/media/frigate</code> in the container, where Frigate saves camera recordings. > - <code>./database:/data/db</code>: Maps the <code>database</code> directory on the host to <code>/data/db</code> in the container, where Frigate stores metadata and video analytics. > - <code>type: tmpfs</code>: Creates a temporary file system in memory. This reduces wear on SSDs by storing cache data in RAM. > - <code>target: /tmp/cache</code>: Specifies the location of the cache inside the container. > - <code>tmpfs.size: 1000000000</code>: Limits the cache size to 1 GB. > > '''11. <code>ports:</code>''' > This section maps network ports on the host to ports in the container. It allows you to access Frigate’s web interface and services. > - <code>"8971:8971"</code>: Exposes Frigate’s main web interface on port <code>8971</code>. > - <code>"5000:5000"</code>: Exposes an internal port for access without username/password authentication. We will fix this later using nginx & an authentication setup. > - <code>"8554:8554"</code>: Exposes Real-Time Streaming Protocol (RTSP) feeds for viewing video streams. > - <code>"8555:8555/tcp"</code> and <code>"8555:8555/udp"</code>: Expose WebRTC services over TCP and UDP, allowing low-latency streaming. > > '''12. <code>environment:</code>''' > This section defines environment variables, which are key-value pairs that configure the container. > > - <code>FRIGATE_RTSP_PASSWORD: "password"</code>: Sets the password for accessing RTSP streams in Frigate. > '''13. Important Warning About Default Storage''' > By default, this configuration saves camera footage (<code>./storage:/media/frigate</code>) and metadata (<code>./database:/data/db</code>) to your main drive. This is fine for testing, but long-term use will fill up and wear out your SSD. Later in the guide, you’ll learn to change these paths to a ZFS pool for redundant, self-healing storage that provides us with way more space than our operating system’d SSD. <span id="create-frigate-configuration-file"></span>
Summary:
Please note that all contributions to FUTO may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
FUTO:Copyrights
for details).
Do not submit copyrighted work without permission!
To protect the wiki against automated edit spam, we kindly ask you to solve the following hCaptcha:
Cancel
Editing help
(opens in new window)