Riven is distributed as a Docker image (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/rivenmedia/riven/llms.txt
Use this file to discover all available pages before exploring further.
spoked/riven:latest) and is designed to run alongside a PostgreSQL database and a media server in a single Docker Compose stack. This page covers every aspect of a production deployment: the full Compose file, all supported environment variables, volume mount requirements, FUSE bind mount setup, and options for making the mount persistent across reboots.
Docker Compose (primary deployment method)
The Compose file below is the canonical starting point — it is identical to the upstreamdocker-compose.yml with inline annotations. Copy it to your host, replace the /path/to/riven/* placeholders with real host paths, and follow the bind mount instructions in the next section before starting the stack.
The
riven_postgres service uses a health check (pg_isready). The riven service declares depends_on: condition: service_healthy, so Docker will not start the Riven backend until PostgreSQL is accepting connections.Environment variables
Container runtime variables
These variables are consumed by the container entrypoint script (entrypoint.sh) before the Python process starts. They control the OS-level user and group that Riven runs as inside the container.
| Variable | Default | Description |
|---|---|---|
PUID | 1000 | UID of the user created inside the container. Set this to match your host user’s UID so volume-mounted files have correct ownership (id -u). |
PGID | 1000 | GID of the group created inside the container. Set this to match your host user’s primary GID (id -g). |
TZ | America/New_York | Timezone string (e.g. Europe/London, Etc/UTC). Used for log timestamps and scheduling. |
DEBUG | (unset) | Set to any non-empty value to start the backend under debugpy on port 5678, enabling remote Python debugging. |
Application variables
These variables are read by the Python application at startup and map directly into Riven’ssettings.json.
| Variable | Default | Description |
|---|---|---|
RIVEN_FORCE_ENV | false | When true, Riven reads all RIVEN_* prefixed environment variables and merges them into settings.json at startup. This lets you configure any nested setting without editing the file. |
RIVEN_DATABASE_HOST | postgresql+psycopg2://postgres:postgres@localhost/riven | Full SQLAlchemy connection string for the PostgreSQL database. In a Compose stack, point this at the service name of your riven_postgres container (e.g. …@riven-db/riven). |
SETTINGS_FILENAME | settings.json | Override the name of the settings file loaded from /riven/data/. Useful when running multiple Riven instances sharing the same data volume. |
Server port
The Riven FastAPI server port is configured via the--port CLI argument when launching src/main.py. Inside the container, the default is 8080. The docker-compose.yml maps "8080:8080" accordingly. If you need to change the host-side port, update the ports mapping rather than the container-side port.
Volume mounts
| Container path | Purpose |
|---|---|
/riven/data | Persistent data directory. Contains settings.json, log files, and database snapshots. Mount a host directory here so settings survive container restarts. |
/mount | RivenVFS FUSE mount point. Must be mounted with :rshared,z so that FUSE sub-mounts are propagated to other containers that share this path. |
Bind mount setup
RivenVFS uses FUSE to present debrid-cached files as a filesystem at/mount. For the media server container to receive these mount events, the host directory must be marked as a shared bind mount before Docker is started.
One-time setup (run after every host reboot until automated)
Making the bind mount persistent on boot
Choose one of the two options below.- Option A — systemd unit (recommended)
- Option B — /etc/fstab entry
Create Enable and start the unit:
/etc/systemd/system/riven-bind-shared.service:The Riven Dockerfile configures
user_allow_other in /etc/fuse.conf automatically, so you do not need to set it yourself. On SELinux-enabled hosts, add :z to the bind mount command if volume relabelling is required.Media server mount propagation
The media server container must mount the same host path with:rslave,z (or :rshared,z) to receive FUSE mount events from RivenVFS.
/mount/movies and /mount/shows — not the host path. Both Riven and the media server refer to /mount inside their respective containers, and mount propagation ensures they see the same FUSE filesystem.
Troubleshooting: /mount appears empty after Riven restart
If your media server shows an empty/mount after restarting Riven, the most common causes are:
- Missing
rsharedon the host — re-run the bind mount commands above and verify withfindmnt. - Stale FUSE mount — if Riven crashed without cleanly unmounting, run:
Then restart the Riven container.
- Wrong path in Riven settings — ensure the VFS mount path in Riven settings is set to the container-internal path
/mount, not the host path.
Health check
Riven exposes a health endpoint atGET /api/v1/health. It returns {"message": "True"} once the program has fully initialised.
docker-compose.yml polls http://localhost:8080 every 30 seconds with up to 10 retries, giving Riven up to 5 minutes to complete startup before being marked unhealthy.
Required container capabilities
The Riven container requires the following Linux capabilities and device access to run RivenVFS:| Requirement | Purpose |
|---|---|
cap_add: SYS_ADMIN | Allows FUSE mount operations inside the container. |
devices: /dev/fuse | Grants access to the host FUSE character device. |
security_opt: apparmor:unconfined | Prevents AppArmor from blocking FUSE syscalls on Ubuntu and other AppArmor-enabled hosts. |
shm_size: 1024m | Increases shared memory available to the container, used by RivenVFS caching. |
Persistence summary
| Path on host | Mounted at | What is stored |
|---|---|---|
/path/to/riven/data | /riven/data | settings.json, log files, database snapshots |
/path/to/riven/db | /var/lib/postgresql/data/pgdata | PostgreSQL data directory (media item state) |
/path/to/riven/mount | /mount | RivenVFS FUSE mount (no persistent files — virtual) |