Configuration - Update-Watcher YAML Config Guide
Update-Watcher is configured through a YAML file that defines which package managers to check (watchers), where to send notifications (notifiers), and global settings. This section covers every aspect of configuration.
Configuration Pages
Config File Locations
Update-Watcher looks for its configuration file in the following locations, in order of priority:
| Priority | Platform | Path | Typical Use |
|---|---|---|---|
| 1 | Any | Path passed via --config flag | Explicit override |
| 2 | Linux | /etc/update-watcher/config.yaml | System-wide (server setup) |
| 3 | Linux, macOS | ~/.config/update-watcher/config.yaml | Per-user |
On Linux, the system-wide path (/etc/update-watcher/) is created by the server setup during installation. If both files exist, the system-wide config takes precedence. On macOS, only the user config path is used.
To use a custom config file path:
update-watcher run --config /path/to/my-config.yamlConfiguration Structure Overview
A complete configuration file has three top-level sections:
# Optional: server hostname (auto-detected if empty)
hostname: ""
# What to check
watchers:
- type: apt
enabled: true
options:
use_sudo: true
# Where to send notifications
notifiers:
- type: slack
enabled: true
options:
webhook_url: "${SLACK_WEBHOOK_URL}"
# Global settings
settings:
send_policy: "only-on-updates"
log_file: "/var/log/update-watcher.log"
schedule: "0 7 * * *"hostname– Identifies the server in notifications. Leave empty for auto-detection.watchers– A list of package manager checkers. Each entry specifies atype, anenabledflag, and type-specificoptions.notifiers– A list of notification channels. Same structure as watchers:type,enabled, andoptions.settings– Global behavior: notification policy, log file path, and cron schedule.
For the full annotated reference with all options, see Config File Reference.
Configuration Precedence
When the same setting can be specified in multiple places, the following precedence applies (highest to lowest):
- CLI flags – Flags like
--quiet,--verbose,--config, and--onlyalways take the highest priority. - Environment variables – Variables with the
UPDATE_WATCHER_prefix override config file values via Viper. Additionally,${VAR}substitution is applied to all string values in the YAML file. - Config file – The YAML configuration file provides the base values.
For example, if your config file sets send_policy: "only-on-updates" but you set UPDATE_WATCHER_SETTINGS_SEND_POLICY=always in the environment, the environment variable wins.
See Environment Variables for details on the substitution syntax and the UPDATE_WATCHER_ prefix.
Validating Your Configuration
Run the built-in validation command to check for syntax errors, missing required fields, and invalid option values:
update-watcher validateIf the config is valid:
Configuration is valid.If there are issues, the output describes each problem and where it occurs.
You can also view the resolved configuration (after environment variable substitution) with:
update-watcher statusFor machine-readable output:
update-watcher status --format jsonCreating Your First Config
The easiest way to create a config file is through the interactive setup wizard:
update-watcher setupThe wizard auto-detects installed package managers, walks you through enabling watchers and notifiers, and writes the file with correct permissions. See First Run for a full walkthrough.
Alternatively, you can write the YAML by hand. Start with the minimal example in the Config File Reference and add watchers and notifiers as needed.
Next Steps
- Config File Reference – Full annotated YAML with all options.
- Environment Variables – Secrets management and
.envfiles. - Security Best Practices – Permissions, secrets, and hardening.