Skip to content

YAML and Env Var Config

The web UI is the primary way to manage DVR servers, but ChannelWatch also supports two file-based configuration paths for automated or headless deployments: a YAML config file and a family of environment variables. All three methods feed the same DVR list, and you can use any combination of them.

When ChannelWatch starts, it merges DVR server definitions from all three sources in this order:

  1. /config/dvrs.yaml — file-based config, loaded from the mounted config volume
  2. CW_DVR_<N>_* environment variables — inline config from the compose file or future Kubernetes manifest
  3. Web UI — servers added or edited through the browser

Servers defined in YAML or env vars are merged with servers already saved in settings.json. A server from YAML that matches an existing web-UI entry (same host and port) updates the existing entry rather than creating a duplicate. Servers added through the web UI that are not in YAML or env vars are preserved as-is.

Create /config/dvrs.yaml in your mounted config directory:

dvrs:
- name: "Living Room"
host: "192.168.1.10"
port: 8089
enabled: true
- name: "Basement"
host: "192.168.1.20"
port: 8089
enabled: true
- name: "Office"
host: "192.168.1.30"
port: 8089
enabled: false
FieldTypeRequiredDefaultDescription
namestringNoHost addressDisplay name shown in notifications and the dashboard
hoststringYesIP address or hostname of the Channels DVR server
portintegerYesChannels DVR API port (typically 8089)
enabledbooleanNotrueSet to false to add the server in a disabled state
api_keystringNoPer-DVR API key (stored in settings.json after import; see note below)

For compose-based deployments, you can define DVR servers using numbered environment variables. The <N> placeholder is a 1-based index (1, 2, 3, …).

environment:
CW_DVR_1_NAME: "Living Room"
CW_DVR_1_HOST: "192.168.1.10"
CW_DVR_1_PORT: "8089"
CW_DVR_2_NAME: "Basement"
CW_DVR_2_HOST: "192.168.1.20"
CW_DVR_2_PORT: "8089"
CW_DVR_3_NAME: "Office"
CW_DVR_3_HOST: "192.168.1.30"
CW_DVR_3_PORT: "8089"
CW_DVR_3_ENABLED: "false"
VariableRequiredDescription
CW_DVR_<N>_HOSTYesIP address or hostname of the Channels DVR server
CW_DVR_<N>_PORTYesChannels DVR API port
CW_DVR_<N>_NAMENoDisplay name (defaults to host address if omitted)
CW_DVR_<N>_ENABLEDNo"true" or "false" (defaults to "true")
CW_DVR_<N>_API_KEYNoPer-DVR API key

Indexes must be contiguous starting from 1. ChannelWatch stops scanning when it encounters a gap (e.g. if CW_DVR_3_HOST is missing, CW_DVR_4_HOST is ignored even if set).

Changes to dvrs.yaml are picked up on hot reload without restarting the container. Environment variable changes require a container restart because Docker does not support live env var updates.

To trigger a hot reload after editing dvrs.yaml, use the Reload Config button in Settings > Advanced, or send SIGHUP to the ChannelWatch process:

Terminal window
docker kill --signal=HUP channelwatch

See Hot Reload for the full list of settings that support live reload.

For Kubernetes deployments, use Kubernetes for the current chart shape and install flow. If you need to pass secrets such as shared API keys or bootstrap admin credentials, keep them in Kubernetes Secrets.

If you are using raw env-driven configuration in Kubernetes, verify the exact env var names against the app source and chart templates instead of assuming a dedicated dvrs values block.