Watchtower - zbrewer/homelab GitHub Wiki
Watchtower is a Docker app that updates other running Docker apps automatically.
Installation
The install is very simply. Since no bind mounts/host data is needed it can be deplyed directly in Portainer using this Docker Compose file. The only change relative to the file specified on their website is specifying the timezone.
Notifications
Notifications for Watchtower can be setup using Shoutrrr by following the instructions here. A list of available notification destinations is available in the Shoutrrr documentation here.
The following block is an example of what can be added to the environment
section of the docker-compose.yml
file in order to setup email alerts that are sent via Gmail.
# Settings for notifications
WATCHTOWER_NOTIFICATIONS_HOSTNAME: ${NOTIFICATIONS_HOSTNAME}
# Additional notification URLs can be added to this list (space separated), if desired.
# See https://containrrr.dev/watchtower/notifications/#shoutrrr_notifications for instructions.
# See https://containrrr.dev/shoutrrr/v0.8/services/overview/ for a list of available options.
WATCHTOWER_NOTIFICATION_URL: >
smtp://${EMAIL_SENDER}:${EMAIL_SENDER_PASS}@smtp.gmail.com:465/?from=${EMAIL_SENDER}&to=${DEST_EMAIL}&fromName=Shoutrrr
Be sure the define the NOTIFICATIONS_HOSTNAME
(name you would like to show up in the email subject), EMAIL_SENDER
, EMAIL_SENDER_PASS
, and DEST_EMAIL
environment variables. Note that the email addresses should include the domain name (i.e. [email protected]
) and the EMAIL_SENDER_PASS
should be a Gmail app password that is URL encoded (spaces replaced by %20
).
Notifications should be sent when the container is restarted so that is the easiest way to test that this is working. This can be disabled later (if desired) or the WATCHTOWER_NOTIFICATIONS_LEVEL
can be changed to something higher than info
(such as warn
) to prevent them from being sent.
Pushover
The following block is an example of what can be added to the environment
section of the docker-compose.yml
file in order to setup alerts that are sent via Pushover. The Pushover URL can be added in addition to the email URL, if you desire notifications through both channels. See the official documentation for Pushover URL parameters.
# Settings for notifications
WATCHTOWER_NOTIFICATIONS_HOSTNAME: ${NOTIFICATIONS_HOSTNAME}
# Additional notification URLs can be added to this list (space separated), if desired.
# See https://containrrr.dev/watchtower/notifications/#shoutrrr_notifications for instructions.
# See https://containrrr.dev/shoutrrr/v0.8/services/overview/ for a list of available options.
WATCHTOWER_NOTIFICATION_URL: >
pushover://shoutrrr:${PUSHOVER_API_TOKEN}@${PUSHOVER_USER_KEY}
Note that the PUSHOVER_API_TOKEN
should be a token created for Watchtower in Pushover and the PUSHOVER_USER_KEY
should be the high-level user key for your Pushover account. Be sure to define these as environment variables in a .env
file or using the Environment variables
section in Portainer.