Frigate NVR (with rclone)
Keep an offsite copy of Frigate recordings, snapshots and exports in XNS storage with rclone.
Overview
Frigate is an open-source network video recorder (NVR) with AI object detection, often run with Home Assistant. It records cameras to a local disk and has no built-in S3 storage. This recipe adds an offsite copy: rclone runs on a schedule next to Frigate and copies Frigate’s media folder to a bucket on your Relayer. Frigate keeps recording locally as before; the bucket holds the copy you need when the NVR’s disk fails or the box is stolen.
Tested with Frigate 0.18.2 and rclone 1.74.1 on 2026-10-18 against Relayer build 59a37e64.
The test ran Frigate in Docker with a looped test video as the camera, continuous recording, a manual event (snapshot) and an export. rclone copied the recordings, clips and exports folders to the bucket, picked up only the new segments on the next run, kept a snapshot in the bucket after Frigate deleted it, and ran unattended as a Docker Compose sidecar. All 367 files read back with matching SHA-256 checksums, and rclone check found no differences. Both http://<relayer-host>:9000 and https://<relayer-host>:9443 with a trusted certificate worked.
Connect to XNS
Every S3 tool connects to your Relayer with the same settings. Enter them exactly as shown; the notes below the table cover the two that most tools get wrong by default.
| Setting | Value |
|---|---|
| Endpoint (HTTP) | http://<relayer-host>:9000, where <relayer-host> is the address of the machine running your Relayer. Always available. |
| Endpoint (HTTPS) | https://<relayer-host>:9443, available only after a certificate is installed on the Relayer. Port 9000 never serves HTTPS. |
| Region | us-east-1 |
| Addressing | Path-style. In tools that ask, turn on force path style or path-style access, and turn off virtual-hosted style. |
| Signature | Signature Version 4 (V4). Version 2 is refused. |
| Access key and secret key | For a tool, create a scoped key: IAM → Create IAM User in the Relayer UI. The secret is shown once, so copy it then. The install’s root pair is on Configure → Credentials; keep it for administration. |
| Bucket | Create it first: Files → Create Bucket in the Relayer UI, or let the tool create it. Names are 3-63 characters of lowercase letters, digits, hyphens and periods. |
HTTPS and certificates. The Relayer UI offers two certificates for port 9443: Let’s Encrypt, which needs a domain managed in Cloudflare and a Cloudflare API token, or self-signed. Most tools refuse a self-signed certificate unless certificate verification is turned off in the tool. On a private network, plain HTTP on port 9000 avoids the question.
Path-style. A tool left on virtual-hosted style (often labeled Amazon S3 or AWS) sends the bucket name in the hostname, and the Relayer cannot find the bucket. Choose the tool’s S3 compatible or generic S3 option and set path-style.
Not supported: server-side encryption with customer-provided keys (SSE-C) or KMS keys (SSE-KMS), bucket website hosting and bucket replication. Server-side encryption with AES256 is accepted. See Encryption at the Gateway, Identity and Access and Configure.
Prerequisites
- A running Frigate install (Docker), with its media folder on the host, for example
./storage:/media/frigatein Frigate’sdocker-compose.yml. - rclone on the Frigate host, or the
rclone/rcloneDocker image. rclone 1.74.1 was tested. - A bucket for the copies, for example
frigate-offsite, and a scoped key on your Relayer (see the table above).
Setup
Step 1: Create the rclone remote
Set up a remote named xns as described in the rclone guide. The part of rclone.conf that matters:
[xns]
type = s3
provider = Other
endpoint = http://<relayer-host>:9000
region = us-east-1
force_path_style = true
access_key_id = <access key>
secret_access_key = <secret key>Check it with rclone lsd xns:; the bucket should be listed.
Step 2: Know what Frigate writes
Everything sits under Frigate’s /media/frigate folder (the host folder you mapped to it):
| Folder | Contents |
|---|---|
recordings/ | Recording segments, one MP4 file of about 10 seconds each, in <date>/<hour>/<camera>/<MM.SS>.mp4. Dates and hours are UTC. |
clips/ | Event snapshots, thumbnails, review thumbnails and preview videos. It also holds preview_restart_cache/, hundreds of temporary frames Frigate writes when it stops; leave that folder out. |
exports/ | Exports you create in Frigate’s Export page, one MP4 file each. |
Frigate writes each segment in a cache folder and moves it into recordings/ only when it is complete, so rclone never copies a half-written segment.

Step 3: Copy, or sync
Frigate deletes old recordings and events on its own retention schedule. Choose how the bucket follows:
rclone copykeeps everything. Files Frigate deletes stay in the bucket. This is the usual choice for an offsite copy; remove old copies yourself (below).rclone syncmirrors the folder. When Frigate deletes a file, the next sync deletes it from the bucket too.rclone sync --backup-dirmirrors the folder, but moves deleted files to another prefix in the bucket instead of deleting them.
rclone copy /srv/frigate/storage/recordings xns:frigate-offsite/recordings
rclone copy /srv/frigate/storage/exports xns:frigate-offsite/exports
rclone copy /srv/frigate/storage/clips xns:frigate-offsite/clips --exclude "preview_restart_cache/**"Replace /srv/frigate/storage with your host folder. In the test, deleting an event in Frigate removed its snapshot from clips/. The next rclone copy left the bucket’s copy alone, and rclone sync /srv/frigate/storage/clips xns:frigate-offsite/clips --backup-dir xns:frigate-offsite/deleted/2026-10-18 moved it to deleted/2026-10-18/ with a server-side copy:
INFO : test_cam-1792327981.157527-ul2nh5-clean.webp: Copied (server-side copy)
INFO : test_cam-1792327981.157527-ul2nh5-clean.webp: Deleted
INFO : test_cam-1792327981.157527-ul2nh5-clean.webp: Moved into backup dirA second run copies only the new segments; in the test, 9 new segments were copied and 19 already in the bucket were skipped:
Transferred: 17.674 MiB / 17.674 MiB, 100%
Checks: 19 / 19, 100%, Listed 53
Transferred: 9 / 9, 100%With rclone copy the bucket keeps growing. To drop copies older than, for example, 90 days, run rclone delete xns:frigate-offsite/recordings --min-age 90d now and then (this command was not part of the test).
Step 4: Run it on a schedule
Frigate’s media files are owned by root, so run rclone as root or in a container. The tested form is a sidecar container in Frigate’s docker-compose.yml. It takes the remote from environment variables, so no rclone.conf is needed, and copies every 5 minutes:
frigate-offsite:
image: rclone/rclone:1.74.1
restart: unless-stopped
environment:
RCLONE_CONFIG_XNS_TYPE: s3
RCLONE_CONFIG_XNS_PROVIDER: Other
RCLONE_CONFIG_XNS_ENDPOINT: http://<relayer-host>:9000
RCLONE_CONFIG_XNS_REGION: us-east-1
RCLONE_CONFIG_XNS_FORCE_PATH_STYLE: "true"
RCLONE_CONFIG_XNS_ACCESS_KEY_ID: <access key>
RCLONE_CONFIG_XNS_SECRET_ACCESS_KEY: <secret key>
volumes:
- ./storage:/media/frigate:ro
entrypoint: /bin/sh
command:
- -c
- |
while true; do
rclone copy /media/frigate/recordings xns:frigate-offsite/recordings -v
rclone copy /media/frigate/exports xns:frigate-offsite/exports -v
rclone copy /media/frigate/clips xns:frigate-offsite/clips --exclude "preview_restart_cache/**" -v
sleep 300
doneKeep the two key lines out of a file you share: put them in a file only root can read and load it with env_file. Start it with docker compose up -d frigate-offsite and follow it with docker compose logs -f frigate-offsite; each run lists the new files as Copied (new).
Without Docker, a root cron entry does the same with the remote from Step 1 (this form was not run in the test):
*/5 * * * * rclone copy /srv/frigate/storage/recordings xns:frigate-offsite/recordings --log-file /var/log/frigate-offsite.logUse one line per folder, as in Step 3. If one run can take longer than the interval, wrap it in flock -n /run/frigate-offsite.lock so runs do not overlap.
Step 5: Test a restore
Copy the bucket back to a new folder and compare it with Frigate’s media folder:
rclone copy xns:frigate-offsite/recordings /tmp/frigate-restore/recordings
rclone check /srv/frigate/storage/recordings xns:frigate-offsite/recordingsrclone check should end with 0 differences found. While Frigate is recording, segments written after the last copy show up as missing in the bucket; that is expected. The restored MP4 files play in any video player. Frigate itself cannot play recordings from the bucket.
HTTPS on port 9443
Once a certificate is installed on the Relayer, set endpoint = https://<relayer-host>:9443 (or RCLONE_CONFIG_XNS_ENDPOINT in the sidecar). The test used a trusted certificate. With a self-signed certificate, add no_check_certificate = true to the remote (RCLONE_CONFIG_XNS_NO_CHECK_CERTIFICATE: "true" in the sidecar).
Known limits
- Frigate has no S3 storage of its own. It records only to a local disk; the bucket holds a copy made by rclone, so recordings reach the bucket at the next scheduled run, not live.
- Leave out
clips/preview_restart_cache/. Frigate writes hundreds of temporary frames there each time it stops (333 in the test). rclone purge xns:<bucket>reports AccessDenied with a scoped key under the ReadWrite policy: it deletes every object and then tries to delete the bucket, which that policy does not allow. The objects are gone; the empty bucket stays. Userclone deleteor purge a prefix such asxns:frigate-offsite/recordings.- Object Lock was not tested. The Relayer implements S3 Object Lock, which can keep the offsite copy from being deleted, even by
rclone syncor a stolen key. A key under the canned ReadWrite policy cannot read a bucket’s Object Lock configuration. - Folder names are UTC. Frigate names
recordings/folders by UTC date and hour; look for local times accordingly when you restore. - Not supported by the Relayer: SSE-C and SSE-KMS server-side encryption, bucket website hosting and bucket replication. To encrypt the copies before they leave the host, use an rclone
cryptremote on top ofxns.
