Skip to main content

Environment variables

Mediarr reads these from .env. After changing them, apply them with docker compose up -d.

Required​

VariableMeaning
MEDIARR_VERSIONThe version to run, latest or a number
DB_USERDatabase user. Letters and digits only
DB_PASSWORDDatabase password. Letters and digits only
UPLOAD_LOCATIONAbsolute path for your original files
CACHE_LOCATIONAbsolute path for thumbnails and video versions
DB_LOCATIONAbsolute path for the database, on a local disk
PUID, PGIDThe user and group that own UPLOAD_LOCATION and CACHE_LOCATION
BIND_ADDRESSThe address to listen on. Use 127.0.0.1 behind your own reverse proxy
HTTP_PORTThe port Mediarr opens on. Default 9851

Optional​

VariableMeaning
COMPOSE_PROFILESOptional services: ml, ai, or ml,ai
ML_URLhttp://ml:8000 turns on smart search and faces
ML_FACE_MODELbuffalo_l, or buffalo_s, which is smaller and faster but less accurate
ML_THREADSProcessor threads for analysis. Default: all of them
EXTERNAL_LIBRARY_PATHA folder of photos to show without copying them, read only
BACKUP_PATHA folder for backups, best on another disk
TRUSTED_PROXY_HOPSHow many reverse proxies stand in front of Mediarr, usually 1
MAX_UPLOAD_MBThe largest single upload. Default: limited only by free disk space
WORKER_CONCURRENCYBackground jobs at once. Default: half of the processor cores
VIDEO_ACCELVideo encoding hardware: none, qsv, nvenc or vaapi
METRICS_TOKENTurns on /metrics for Prometheus, using this as a bearer token
OTEL_EXPORTER_OTLP_ENDPOINTSends traces to an OpenTelemetry collector