# Default paths

Everything Fregata writes lives in well-known places. This page is
the canonical map.

## Top-level layout

```
~/Fregata/
├── config/                     # FRIGATE_CONFIG_DIR
│   ├── config.yml              # the file you edit
│   ├── frigate.db              # SQLite events / recordings index
│   ├── model_cache/            # downloaded Frigate+ models
│   ├── models/                 # your own ONNX (conventional)
│   └── ssl/                    # cert.pem + privkey.pem (optional)
├── media/                      # FRIGATE_MEDIA_DIR
│   ├── recordings/<camera>/<date>/<hour>/<minute.second>.mp4
│   ├── clips/<camera>-<event>.mp4
│   ├── clips/thumbs/           # event thumbnails
│   ├── clips/triggers/         # synthetic clips for trigger pipeline
│   ├── clips/faces/            # face-recognition snapshots
│   └── exports/                # user-initiated exports
├── temp/                       # FRIGATE_CACHE_DIR — Basic RAM disk only;
│   ├── nginx_cache/            #   Smart memory uses a hidden ~/Library/Caches/ path
│   └── go2rtc.yaml             #   (see "The cache backing" below)
├── run/                        # FRIGATE_RUN_DIR (SSD-resident)
│   └── *.sem                   # POSIX semaphore tracker files
└── logs/                       # FRIGATE_LOG_DIR (SSD-resident)
    ├── frigate/current         # live Frigate log (capped ~5 MiB, oldest 2 MiB chopped on overflow)
    ├── go2rtc/current          # live go2rtc log (same cap + chop)
    └── nginx/current           # live nginx log  (same cap + chop)
```

`run/` and `logs/` live on the SSD — semaphore state has to
survive reboots, and logs persist across restarts and crashes so you
can always see what happened. `temp/` lives in RAM and is destroyed
on quit — see the next section for the two possible backings.
Everything else is what you'd expect.

## The cache backing

`FRIGATE_CACHE_DIR` is RAM-backed by one of two mechanisms, picked in
the welcome wizard's "Memory for recordings" step:

| Mode | Backing | Where the mount lives |
| --- | --- | --- |
| **Smart memory** (default) | tmpfs (sparse, demand-paged) | `~/Library/Caches/com.3rdbitlabs.fregata/temp` |
| **Basic RAM disk** | HFS+ disk image (pre-allocated, wired) | `~/Fregata/temp` |

The path in the tree above (`~/Fregata/temp/`) is therefore only
literal under **Basic RAM disk**. Under **Smart memory** the same
contents (nginx slice cache, `go2rtc.yaml`, IPC sockets, detection
scratch) live under `~/Library/Caches/`, deliberately hidden from
Finder and Spotlight. The
chosen mode is logged at startup as `Cache backing: …` in the Frigate
log.

The tray's **Settings → Folders → Open Cache Folder** menu item is
disabled under **Smart memory** — the mount path isn't safe to open
in Finder (see the danger callout on
[Performance — RAM-disk cache](/guides/performance/#ram-disk-cache))
and there's nothing in there worth poking at anyway. Under **Basic
RAM disk** the same item opens `~/Fregata/temp/` normally.

Both backings unmount automatically when Fregata quits. Neither
needs manual management.

See [Performance — RAM-disk cache](/guides/performance/#ram-disk-cache)
for the full trade-off (sparse vs wired, sizing, fall-back behaviour
if the privileged helper isn't approved).

## Where the macOS app puts its own state

| Path | What's in it |
| --- | --- |
| `/Applications/Fregata.app` | The signed, notarized bundle. |
| `~/Library/Preferences/com.3rdbitlabs.fregata.plist` | Folder choices, env vars, "launch at login" flag, welcome-wizard state. |
| `~/Library/Caches/com.3rdbitlabs.fregata/temp` | **Smart memory** cache mount (tmpfs, ephemeral, destroyed on quit). Not Finder-safe. |
| macOS Service Management database | Login Item registration. No user-visible file. |

## Bundle internals

Most users never care about this — but if you're poking around or
debugging:

```
Fregata.app/Contents/
├── Info.plist
├── MacOS/Fregata           # the Swift entry point
└── Resources/
    ├── frigate-ffmpeg      # bundled ffmpeg binary
    ├── frigate-ffprobe
    ├── frigate-go2rtc
    ├── frigate-nginx
    ├── Python.framework/   # bundled Python interpreter + stdlib
    ├── lib/python3.11/site-packages/  # Frigate, Fregata, deps
    ├── models/default.onnx # the bundled YOLOv9-tiny
    ├── labelmap.txt        # default COCO labels
    └── web/                # built web UI assets
```

Everything in `Resources/` is signed at build time. Modifying the
bundle in place breaks the signature and triggers Gatekeeper
warnings on next launch.

## Custom go2rtc binary

Fregata ships its own go2rtc build inside the bundle
(`Resources/frigate-go2rtc`). If you need a different version — a
newer release, a build with a codec Fregata's binary doesn't include,
or a debug build for tracing — you can drop a replacement in
`~/Fregata/config/`:

1. Download the macOS arm64 `go2rtc` binary from the
   [go2rtc releases page](https://github.com/AlexxIT/go2rtc/releases).
2. Copy it to `~/Fregata/config/go2rtc`.
3. Make it executable:
   ```bash
   chmod +x ~/Fregata/config/go2rtc
   ```
4. Restart Fregata. You can confirm it took effect by checking the
   version line near the top of `~/Fregata/logs/go2rtc/current`.

To go back to the bundled binary, delete `~/Fregata/config/go2rtc` and restart.

:::caution
The bundled binary is Apple-notarized and signed. A replacement binary
won't be — macOS may quarantine it and prevent Fregata from launching it.
If go2rtc fails to start after swapping the binary, run:
```bash
xattr -d com.apple.quarantine ~/Fregata/config/go2rtc
```
:::

## Logs

The Python core's stdout/stderr is redirected to
`~/Fregata/logs/frigate/current` on the SSD (go2rtc and nginx write
alongside it at `~/Fregata/logs/go2rtc/current` and
`~/Fregata/logs/nginx/current`). Each file is kept under ~5 MiB: once it crosses that,
a background thread chops the oldest ~2 MiB at a line boundary and
keeps the latest ~3 MiB.

To follow the live log from a terminal:

```bash
tail -F ~/Fregata/logs/frigate/current
```

The tray's **Settings → Open Frigate Logs** entry opens this file in
Console.app, which follows it live as new lines are appended;
**Reveal Logs in Finder** opens `~/Fregata/logs/`.

## Changing locations

The two folders you'd realistically want to move are config and
media. Both are settable via **Settings → Folders → Change …
Location…** in the tray. The launcher writes the new path to
UserDefaults and Fregata moves the existing files on next launch.

Alternatively, set `FRIGATE_CONFIG_DIR` or `FRIGATE_MEDIA_DIR`
explicitly in **Settings → Environment Variables** and restart.
The env-var path wins over the UserDefaults path; this is useful
when you've separately copied or symlinked data first.

:::caution[Config folder must be on a local disk]
The config folder holds Frigate's SQLite database and Fregata's activation token. Both require reliable POSIX file locking and atomic writes — guarantees that network drives (NAS shares over SMB or NFS, AFP, WebDAV) cannot provide. **Keep the config folder on a local APFS or HFS+ disk.** Fregata blocks network volumes in the folder picker and will warn you in the setup wizard. The media folder has no such restriction and works fine on a NAS.
:::
