9. Archive Streams to Disk
9.1 Overview
The relay can archive streams to disk in real time. Archives are written inside the container to ARCHIVE_PATH; mount a host directory there so the files survive container removal.
9.2 Enable Archive
-
Create a host directory and give it to the container's nginx user (UID 100, GID 101):
-
In
docker-compose.yml, add avolumes:entry to the existingrelayservice: -
In
env/relay.env, setARCHIVE_PATHto the container side of that mount: -
Recreate the container:
-
Confirm the service is enabled:
Expected output:
Archive configuration complete, and service enabled.If you see
ERROR: ARCHIVE_PATH is not writable by the nginx user., the container has stopped: the relay does not run at all, not only archiving. Check thatARCHIVE_PATHmatches the container side of the mount in step 2, and that step 1'schownsucceeded.
9.3 Settings
ARCHIVE_PATH turns archiving on. For its default and valid values, see ARCHIVE_PATH. Archives are always FLV files.
9.4 File Naming
Each stream is written to a new file named:
For example, a stream published as rtmp://<relay>/relay/live on 25 September 2026 at 14:53:40 UTC produces:
The date and time are in UTC, not your local time zone. Because the date is day-first, sorting by filename does not sort by date across months; sort by the Unix time after the stream name instead, or by modification time (ls -t).
9.5 See Also
- Change Relay Settings - Edit, apply and confirm a setting
- Requirements - System prerequisites
- Troubleshooting - Common archive issues