PrepArr accepts CLI flags to override configuration from environment variables and config files. CLI flags have the highest priority in the configuration hierarchy.
CLI arguments (highest)
Environment variables
Configuration file (JSON/YAML)
Default values (lowest)
Flag Description --initRun in init mode: set up databases, generate config.xml, then exit --help, -hShow help message and exit --version, -vShow version information and exit --generate-api-keyGenerate a new 32-character hex API key and exit
docker run --rm ghcr.io/robbeverhelst/preparr:latest --init
Init mode performs one-time setup:
Creates PostgreSQL databases and users
Generates config.xml with API key and database connection
Exits with code 0 on success
docker run --rm ghcr.io/robbeverhelst/preparr:latest --generate-api-key
# Output: 2bac5d00dca43258313c734821a15c4c
All flags support both --key=value and --key value syntax.
Flag Environment Variable Default Description --postgres-hostPOSTGRES_HOSTlocalhostDatabase host --postgres-portPOSTGRES_PORT5432Database port --postgres-userPOSTGRES_USERpostgresDatabase username --postgres-usernamePOSTGRES_USERNAMEpostgresAlias for --postgres-user --postgres-passwordPOSTGRES_PASSWORD— Database password (required) --postgres-dbPOSTGRES_DBservarrDatabase name --postgres-databasePOSTGRES_DATABASEservarrAlias for --postgres-db
Flag Environment Variable Default Description --servarr-urlSERVARR_URL— Instance URL (e.g., http://sonarr:8989) --servarr-typeSERVARR_TYPEautoApp type: sonarr, radarr, lidarr, readarr, prowlarr, qbittorrent, auto --servarr-api-keySERVARR_API_KEY— 32-character hex API key --servarr-admin-userSERVARR_ADMIN_USERadminAdmin username --servarr-admin-passwordSERVARR_ADMIN_PASSWORD— Admin password (required)
Flag Environment Variable Default Description --qbittorrent-urlQBITTORRENT_URL— qBittorrent web UI URL --qbittorrent-userQBITTORRENT_USER— qBittorrent username --qbittorrent-usernameQBITTORRENT_USERNAME— Alias for --qbittorrent-user --qbittorrent-passwordQBITTORRENT_PASSWORD— qBittorrent password --prowlarr-urlPROWLARR_URL— Prowlarr URL --prowlarr-api-keyPROWLARR_API_KEY— Prowlarr API key
Flag Environment Variable Default Description --app-api-keyAPP_API_KEY— Application API key --app-prowlarr-syncAPP_PROWLARR_SYNCfalseEnable Prowlarr sync --app-root-foldersAPP_ROOT_FOLDERS[]Root folders (JSON array or comma-separated) --app-indexersAPP_INDEXERS— Indexers (JSON array) --app-download-clientsAPP_DOWNLOAD_CLIENTS[]Download clients (JSON array) --app-quality-profilesAPP_QUALITY_PROFILES[]Quality profiles (JSON array) --app-applicationsAPP_APPLICATIONS[]Applications (JSON array) --app-qbittorrentAPP_QBITTORRENT— qBittorrent config (JSON object)
Flag Environment Variable Default Description --health-portHEALTH_PORT9001Health endpoint port --log-levelLOG_LEVELinfoLog verbosity: debug, info, warn, error --log-formatLOG_FORMATprettyLog format: json, pretty
Flag Environment Variable Default Description --config-pathCONFIG_PATH— Path to configuration file --config-watchCONFIG_WATCHfalseWatch config file for changes --config-reconcile-intervalCONFIG_RECONCILE_INTERVAL60Reconciliation interval in seconds
docker run ghcr.io/robbeverhelst/preparr:latest --log-level=debug
docker run ghcr.io/robbeverhelst/preparr:latest \
--servarr-url=http://sonarr:8989 \
--servarr-admin-password=mypassword \
--postgres-host=postgres \
--postgres-password=dbpassword \
--app-root-folders= ' [{"path":"/tv"}] '
docker run --rm ghcr.io/robbeverhelst/preparr:latest \
--postgres-host=postgres \
--postgres-password=dbpassword \
--servarr-admin-password=mypassword