* hand renewed tls keys to the runtime user and time out the go2rtc healthcheck - Renewed certbot keys were owned by root with mode 0600, so the non-root nginx couldn't read them and every certsync reload failed until the cert expired. certsync now chowns a mounted key to the runtime user before each reload, under the same conditions as the nginx startup handover - The go2rtc healthcheck curl had no total timeout, so a go2rtc that accepted connections but never answered blocked the check forever. It now gives up after 15 s - The TLS and non-root docs now tell read-only mount users to set the key's group and group read, which certbot keeps on renewal * stop chowning mounted tls keys and check they're readable instead The root chown of a mounted key followed symlinks, so a runtime user that could write the cert folder could have any root file handed to it, and the chown never covered keys renewed after startup. Frigate no longer changes ownership of mounted certs. nginx startup logs an error naming the gid when the runtime user can't read the key, and the TLS docs have users grant group read once on the host, which certbot keeps on renewal. This also drops the certsync handover added earlier on this branch. * skip the tls key check when tls is disabled and tighten its wording * check fullchain.pem and folder access in the tls startup check
3.4 KiB
id, title
| id | title |
|---|---|
| tls | TLS |
import ConfigTabs from "@site/src/components/ConfigTabs"; import TabItem from "@theme/TabItem"; import NavPath from "@site/src/components/NavPath";
TLS
Frigate's integrated NGINX server supports TLS certificates. By default Frigate will generate a self signed certificate that will be used for port 8971, stored in /config/tls so it survives container recreation. Frigate is designed to make it easy to use whatever tool you prefer to manage certificates.
Frigate is often running behind a reverse proxy that manages TLS certificates for multiple services. You will likely need to set your reverse proxy to allow self signed certificates or you can disable TLS in Frigate's config. However, if you are running on a dedicated device that's separate from your proxy or if you expose Frigate directly to the internet, you may want to configure TLS with valid certificates.
In many deployments, TLS will be unnecessary. Disable it as follows:
Navigate to .
- Set Enable TLS to off if running behind a reverse proxy that handles TLS (default: on)
tls:
enabled: False
Certificates
TLS certificates can be mounted at /etc/letsencrypt/live/frigate using a bind mount or docker volume.
frigate:
...
volumes:
- /path/to/your/certificate_folder:/etc/letsencrypt/live/frigate:ro
...
Within the folder, the private key is expected to be named privkey.pem and the certificate is expected to be named fullchain.pem. Mounted certificates take precedence over the self signed pair in /config/tls.
privkey.pem and fullchain.pem must be readable by the runtime user that runs NGINX, and that user must be able to enter the folders above them. Frigate doesn't change ownership of mounted certificates, so give the key to the runtime user's group (gid 1000, your PGID, or the group in Docker's user:) with group read on the host, for example chgrp 1000 privkey.pem && chmod g+r privkey.pem. certbot keeps the key's group and group read on renewal, so this is a one-time step. See Running as a non-root user.
Note that certbot uses symlinks, and those can't be followed by the container unless it has access to the targets as well, so if using certbot you'll also have to mount the archive folder for your domain, e.g.:
frigate:
...
volumes:
- /etc/letsencrypt/live/your.fqdn.net:/etc/letsencrypt/live/frigate:ro
- /etc/letsencrypt/archive/your.fqdn.net:/etc/letsencrypt/archive/your.fqdn.net:ro
...
Frigate automatically compares the fingerprint of the certificate it loaded, from either location, against the fingerprint of the TLS cert in NGINX every minute. If these differ, the NGINX config is reloaded to pick up the updated certificate.
If you issue Frigate valid certificates you will likely want to configure it to run on port 443 so you can access it without a port number like https://your-frigate-domain.com by mapping 8971 to 443.
frigate:
...
ports:
- "443:8971"
...
ACME Challenge
Frigate also supports hosting the acme challenge files for the HTTP challenge method if needed. The challenge files should be mounted at /etc/letsencrypt/www. With a read-only root filesystem this has to be a mounted volume, since Frigate cannot create the directory itself.