Website • Documentation • GitHub
Watchtower automatically updates your running Docker containers when new images are available. Set it and forget it — your containers stay up to date.
- Automatic Updates — Pulls new images and restarts containers
- Label-Based Control — Choose which containers to update
- Notifications — Email, Slack, Teams, and more
- Cleanup — Removes old images after updates
- Scheduling — Update on your preferred schedule
- Private Registries — Support for authenticated registries
- Docker and Docker Compose
Edit docker-compose.yml to enable email notifications:
environment:
- WATCHTOWER_NOTIFICATION_EMAIL_FROM=watchtower@example.com
- WATCHTOWER_NOTIFICATION_EMAIL_TO=admin@example.com
- WATCHTOWER_NOTIFICATION_EMAIL_SERVER=smtp.example.com
- WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PORT=587
- WATCHTOWER_NOTIFICATION_EMAIL_SERVER_USER=your-user
- WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PASSWORD=your-passworddocker compose up -dWatchtower will now check for updates every 24 hours (default).
| Variable | Description | Default |
|---|---|---|
WATCHTOWER_CLEANUP |
Remove old images | true |
WATCHTOWER_INCLUDE_RESTARTING |
Update restarting containers | true |
WATCHTOWER_INCLUDE_STOPPED |
Update stopped containers | true |
WATCHTOWER_REVIVE_STOPPED |
Start stopped containers after update | true |
WATCHTOWER_LABEL_ENABLE |
Only update labeled containers | true |
WATCHTOWER_NOTIFICATIONS |
Notification type | email |
The --interval flag sets how often Watchtower checks for updates (in seconds):
command: --interval 86400 # 24 hoursCommon intervals:
3600— 1 hour21600— 6 hours86400— 24 hours (recommended)604800— 1 week
This template uses WATCHTOWER_LABEL_ENABLE=true, meaning only containers with the label will be updated.
Add this label to containers you want Watchtower to update:
labels:
- "com.centurylinklabs.watchtower.enable=true"All templates in this repository include this label by default.
- WATCHTOWER_NOTIFICATIONS=email
- WATCHTOWER_NOTIFICATION_EMAIL_FROM=watchtower@example.com
- WATCHTOWER_NOTIFICATION_EMAIL_TO=admin@example.com
- WATCHTOWER_NOTIFICATION_EMAIL_SERVER=smtp.example.com
- WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PORT=587
- WATCHTOWER_NOTIFICATION_EMAIL_SERVER_USER=user
- WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PASSWORD=password- WATCHTOWER_NOTIFICATIONS=slack
- WATCHTOWER_NOTIFICATION_SLACK_HOOK_URL=https://hooks.slack.com/services/xxx- WATCHTOWER_NOTIFICATIONS=shoutrrr
- WATCHTOWER_NOTIFICATION_URL=discord://token@webhookid| Path | Description |
|---|---|
/var/run/docker.sock |
Docker socket (required) |
/etc/timezone |
Host timezone (read-only) |
To manually trigger an update check:
docker exec watchtower /watchtower --run-onceTo prevent a container from being updated, either:
- Don't add the Watchtower label, or
- Add the disable label:
labels:
- "com.centurylinklabs.watchtower.enable=false"Check Watchtower's logs:
docker logs watchtowerWatchtower is released under the Apache-2.0 License.
