Skip to content

Introduction

Overview

Watchtower uses Shoutrrr to send notifications.

Enabling Notifications

To send notifications, use the NOTIFICATION URL configuration option to specify the Shoutrrr service URL.

The Shoutrrr URL follows the format:

SERVICE://[CREDENTIALS[:MORE_CREDENTIALS]@]HOST[/PATH][?KEY=VALUE[&KEY=VALUE...]]

This format includes the following values:

  • SERVICE: the Shoutrrr service, such as discord or telegram
  • CREDENTIALS: the credentials the service needs, such as a token
  • MORE_CREDENTIALS: further credentials, for services that need them
  • HOST: the host or service part of the URL
  • PATH: the path, for services that use one
  • KEY and VALUE: a query parameter and its value

Parts in square brackets are optional. Which parts a service uses and what they hold depend on the service. A Gotify URL such as gotify://gotify.example.com/TOKEN has no credentials before its host.

The NOTIFICATION URL configuration option can also reference a file, in which case the contents of the file are used.

Watchtower checks every notification URL when it starts.

Rejected notification URLs

If Shoutrrr cannot use a URL, such as one with no host or with a token that is not in the service's format, Watchtower logs Failed to initialize notifications and exits.

  • The error gives the URL's position, counting from 1. For a URL converted from a legacy notification type, it gives that type instead.
  • The error usually names the service and the problem. It cannot name the service when the URL has no scheme or does not parse. The same holds for a URL that ends in an empty # fragment.
  • The error never contains the URL.
  • When Watchtower runs as its container's main process, it first sets the container's restart policy to no, as with any other startup error. The container then does not restart in a loop.
  • If Watchtower cannot find its container or change the policy, it logs an error and still exits with code 1. The container can then restart in a loop.

Using Multiple Notification Services

Watchtower supports using multiple Shoutrrr URLs to send notifications to multiple notification services.

This is the recommended method for providing Shoutrrr URLs, as they typically contain security-sensitive values.

discord://WEBHOOK_TOKEN@WEBHOOK_ID
telegram://BOT_TOKEN@telegram?chats=CHAT_ID
secrets:
    notification_urls:
        file: ./secrets/notification_urls.txt

services:
    watchtower:
        image: nickfedor/watchtower:latest
        volumes:
            - /var/run/docker.sock:/var/run/docker.sock
        secrets:
            - notification_urls
        environment:
            - WATCHTOWER_NOTIFICATION_URL=/run/secrets/notification_urls
        restart: unless-stopped

Comma or space-separated lists can also be provided to the WATCHTOWER_NOTIFICATION_URL environment variable.

services:
    watchtower:
        image: nickfedor/watchtower:latest
        environment:
            WATCHTOWER_NOTIFICATION_URL: "discord://WEBHOOK_TOKEN@WEBHOOK_ID,telegram://BOT_TOKEN@telegram?chats=CHAT_ID"
        volumes:
            - /var/run/docker.sock:/var/run/docker.sock
        restart: unless-stopped

Comma or space-separated lists can also be provided to the WATCHTOWER_NOTIFICATION_URL environment variable.

services:
    watchtower:
        image: nickfedor/watchtower:latest
        environment:
            WATCHTOWER_NOTIFICATION_URL: >
                discord://WEBHOOK_TOKEN@WEBHOOK_ID,
                telegram://BOT_TOKEN@telegram?chats=CHAT_ID
        volumes:
            - /var/run/docker.sock:/var/run/docker.sock
        restart: unless-stopped

Do NOT define the variable multiple times

Defining WATCHTOWER_NOTIFICATION_URL multiple times in your environment will cause the last value to overwrite previous ones:

# WRONG - Only the second URL will be used:
environment:
- WATCHTOWER_NOTIFICATION_URL=discord://WEBHOOK_TOKEN@WEBHOOK_ID
- WATCHTOWER_NOTIFICATION_URL=telegram://BOT_TOKEN@telegram?chats=CHAT_ID

When using the Docker CLI, the --notification-url environment variable can accept a comma or space-separated list.

docker run -d \
    --name watchtower \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -e WATCHTOWER_NOTIFICATION_URL="discord://WEBHOOK_TOKEN@WEBHOOK_ID,telegram://BOT_TOKEN@telegram?chats=CHAT_ID" \
    nickfedor/watchtower

When using the Docker CLI, the --notification-url CLI flag can be used multiple times.

docker run -d \
    --name watchtower \
    -v /var/run/docker.sock:/var/run/docker.sock \
    nickfedor/watchtower \
    --notification-url "discord://WEBHOOK_TOKEN@WEBHOOK_ID" \
    --notification-url "telegram://BOT_TOKEN@telegram?chats=CHAT_ID"

Replace the following:

  • WEBHOOK_TOKEN: the token of your Discord webhook
  • WEBHOOK_ID: the ID of your Discord webhook
  • BOT_TOKEN: the token of your Telegram bot
  • CHAT_ID: the Telegram chat to send to, such as a chat ID or a channel name that starts with @

CLI Flags vs Environment Variables

The CLI flag can be called multiple times as CLI arguments; however, defining the environment variable multiple times will NOT work and only the last value will be used.

This is because CLI flags use a StringArray type that supports multiple invocations, while environment variables are simple key-value pairs that get overwritten when defined multiple times.

For environment variables, use comma-separated or space-separated values.

Verifying Multiple Notifications

When Watchtower starts, check the logs for the notification summary:

time="2026-01-28T16:07:24+01:00" level=info msg="Using notifications: discord, telegram"

If you only see one service listed (e.g., Using notifications: telegram), your multiple URL configuration was not parsed correctly.

Startup Notifications

Watchtower will log and send a notification every time it is started.

This behavior can be disabled with the DISABLE STARTUP MESSAGE configuration option.

Notification Templates

Watchtower allows you to customize the format and content of notification messages using Go templates. You can define templates either inline or load them from a file.

Inline Templates

Use the notification-template configuration option to specify a template directly as a string.

File-Based Templates

For more complex templates or better maintainability, use the notification-template-file configuration option to specify a path to a template file.

Note

When both inline and file-based templates are specified, the file-based template takes precedence.

For detailed information about template syntax, available data structures, and examples, see the Notification Templates documentation.