---
url: /recording/storage.md
---

# Storage & retention

## Where recordings are stored

By default, recordings live with the rest of camera.ui's data. For more than a couple of cameras, put them on a **dedicated local disk**, separate from the system disk. See [System requirements](/intro/requirements#storage-for-recordings).

A local disk, or a symlink to one, is fine. A **network share (NAS, SMB, NFS) is not**: detection events, timeline markers and the search index sit next to the footage as databases, and those need file locking that network filesystems do not provide reliably. What breaks there is the event database, not the video. If your storage lives on a NAS, run camera.ui on the NAS and record locally there.

A pool of local disks with mergerfs works. With `cache.files=off`, the default since mergerfs 2.41, these databases only open with mergerfs 2.41 or newer on Linux 6.6 or newer. Otherwise the NVR plugin logs `disk I/O error: no such device` on start. Use `cache.files=partial` there.

If a disk of the pool is missing when the NVR plugin starts, the log names the file concerned and says that a disk may be missing. The plugin then removes no leftovers from that file until the disk is back. If the message comes back at every start with all disks in place, that stays so. Nothing breaks, the leftovers only take space.

## Moving recordings to another disk

Changing the storage path does not move your recordings: camera.ui starts fresh at the new location and the old folder stays as it is. A new path that camera.ui can't create or write to is not taken, recording stays in the old folder and a notification says why. To move the data:

1. Stop the server.
2. Move the whole storage folder to the new disk, including the `events` and `clip` folders. They hold your events, timeline markers and search index for that footage.
3. Start the server and set the new path in **Settings → Recordings**.

Nothing inside stores an absolute path, so everything works at the new location without a rebuild. Without `events` and `clip` the footage arrives bare, and they cannot be recreated from the video files. Enrolled faces live outside the recordings folder and are not affected.

## Rough sizing

Continuous recording size follows the stream's bitrate:

**GB per day, per camera ≈ bitrate in Mbit/s × 10.8**

| Stream | Bitrate | Continuous, per day | Per camera, 7 days |
|---|---|---|---|
| 1080p H.264 | 4 Mbit/s | ~43 GB | ~300 GB |
| 4K H.264 | 8 Mbit/s | ~86 GB | ~600 GB |
| H.265 (HEVC) | about half the bitrate | roughly half the above | roughly half the above |
| 720p MJPEG, 15 fps | ~4 Mbit/s | ~40 GB | ~280 GB |

MJPEG has no fixed bitrate, it follows the camera's resolution, frame rate and JPEG quality.

Event recording uses a fraction of that, depending on how busy the scene is. When in doubt, set a retention window or storage cap and watch the per-camera rate (below) for a week.

## How long they're kept

* **Retention (Days).** Keep footage for up to this many days (0 means no day limit).
* **Max Storage (GB).** Cap the total space recordings may use (0 means no cap). Beyond it the oldest recordings are deleted, also with **Strict**.

When the disk runs low, the **Retention Mode** decides:

* **Overwrite** (default). The oldest recordings are deleted to make room. Recording only pauses when other data fills the disk and no older recordings are left to delete.
* **Strict.** Nothing younger than the retention window is deleted. If the disk fills, recording pauses until you free space.

Cleanup takes the oldest hours of all cameras side by side, so a quiet camera cannot lose its whole history while a busy one keeps everything, and it stops once enough space is free. [Favorites](/recording/browsing#favorites) are skipped and stay playable however old they are.

Events follow the retention too, also those of a camera that records nothing. Favorites stay here as well.

### Limits per camera

With **Own Storage Limits** on in a camera's settings, the camera gets its own **Retention (Days)** and **Max Storage (GB)**. Its retention replaces the global one, shorter or longer, and its events go with its footage. Its cap deletes only its own oldest recordings, also with **Strict**. The global **Max Storage** and the free disk space still count for all cameras, so a longer retention only holds while they leave room.

## Free disk space

Independent of those limits, **Min Free Space (GB)** keeps part of the disk clear: cleanup works to keep at least that much available. Below half of it cleanup deletes faster, and recording pauses there with **Strict**, or with **Overwrite** once nothing is left to delete. At 0 the reserve is a share of the whole volume.

Set your own value when the recordings share a disk with other data, otherwise the derived reserve on a large disk can delete recordings, or with **Strict** pause recording, long before your storage cap is reached. Values below 10 GB count as 10, or as a quarter of the disk if that is less.

## Footage from removed cameras

If you delete a camera or unassign the NVR from it, its recordings stay on disk. They still count towards **Max Storage** and are aged out and cleaned up like an active camera's.

To keep that footage, put an empty file named `.cameraui-keep` into the camera's folder in your recordings directory. camera.ui then leaves the folder alone: not counted, not aged out, not touched when space runs low.\[^keepmarker]

\[^keepmarker]: The marker only applies to cameras camera.ui no longer knows. The folder of an active camera follows retention and the storage cap either way.

## Keeping an eye on usage

**Metrics → Storage** shows disk usage in the **Storage Overview** and, in the **Camera Storage** table, per camera: size on disk, days of footage held, recording rate per day, mode, and its own limits.

The dot in front of each camera shows its recording state: green while it records, blue while a camera in Event or Ad-hoc mode waits for the next event, orange when your plan has no [camera slot](/recording/#camera-slots) left for it, grey when recording is off. Red means it should record and doesn't: the camera or all its recorded streams are unreachable, or recording has paused.

Once recording is off for a camera, **Delete recordings** at the end of its row removes its recordings. Turn on **Delete events too** to remove all its events as well, favorites included, otherwise they stay without footage. What is recorded after you confirm stays.

A warning that the storage volume is small means it has little room for recordings, so they rotate out quickly. Usually the larger disk you meant to use isn't mounted, so check the storage path. Separate warnings appear when free space drops below 8% and once recording has paused for lack of space.

If a custom storage path held recordings before and its disk is missing at startup, camera.ui records into its default folder instead of the empty mount point until the next start, and marks this on the timeline. If the disk drops out while camera.ui records, recording pauses, admins get one notification, and recording resumes by itself once the path is back.

## Uninstalling the NVR

Uninstalling the NVR plugin with **Also delete stored data** removes its settings, databases and caches but keeps your recordings folder, which is protected by a `.cameraui-keep` file inside it. To delete the recordings too, remove that file first, then uninstall.
