| title | Watchtower |
|---|---|
| description | A guide on how to install Watchtower for container updates |
| published | true |
| date | 2025-07-11 12:19:59 UTC |
| tags | |
| editor | markdown |
| dateCreated | 2024-02-23 13:43:38 UTC |
Watchtower is a tool that automates the updating of Docker containers by pulling new images and restarting the containers with the same options used during deployment.
services:
watchtower:
image: containrrr/watchtower
container_name: watchtower
environment:
- TZ=America/New_York
- WATCHTOWER_NOTIFICATIONS_HOSTNAME=
- WATCHTOWER_CLEANUP=true
- WATCHTOWER_INCLUDE_STOPPED=true
- WATCHTOWER_SCHEDULE=0 0 3 * * *
# - WATCHTOWER_NOTIFICATION_URL=discord://token@webhookid
# - WATCHTOWER_NOTIFICATIONS=gotify
# - WATCHTOWER_NOTIFICATION_GOTIFY_URL=https://
# - WATCHTOWER_NOTIFICATION_GOTIFY_TOKEN=
restart: unless-stopped
volumes:
- /var/run/docker.sock:/var/run/docker.sockI have added some custom environment variables to this compose file. For a full explanation of all possible variables, see the docs {.is-info}
Watchtower does not update apps from the TrueNAS catalog. To skip those, add this line to the
environmentsection:- WATCHTOWER_DISABLE_CONTAINERS=ix*{.is-warning}
If you ever need to update your apps outside of the specified schedule, use this command from the shell of the machine hosting watchtower:
docker exec -it watchtower /watchtower --run-onceTo use the Discord notification uncomment out the top line WATCHTOWER_NOTIFICATION_URL
Your Discord Webhook-URL will look like this:
https://discord.com/api/webhooks/**webhookid**/**token**
The shoutrrr service URL should look like this:
discord://token@webhookid
To use Gotify, uncomment out the bottom 3 lines:
WATCHTOWER_NOTIFICATIONS
WATCHTOWER_NOTIFICATION_GOTIFY_URL
WATCHTOWER_NOTIFICATION_GOTIFY_TOKEN

