Email Notifications¶
Deprecated Email Notification Options
The following legacy email notification options are deprecated and subject to removal with the release of Watchtower v2:
notification-email-fromnotification-email-tonotification-email-servernotification-email-server-tls-skip-verifynotification-email-server-usernotification-email-server-passwordnotification-email-subjecttagnotification-email-server-portnotification-email-delay
Use the notification-url configuration option with a smtp:// Shoutrrr URL instead.
Use the legacy notifications migration tool to help with migrating to a Shoutrrr URL.
Overview¶
Watchtower uses Shoutrrr's SMTP service to send email notifications.
Examples¶
services:
watchtower:
image: nickfedor/watchtower:latest
environment:
WATCHTOWER_NOTIFICATION_URL: smtp://USERNAME:[email protected]:587/[email protected]&[email protected]
volumes:
- /var/run/docker.sock:/var/run/docker.sock
docker run -d \
--name watchtower \
-v /var/run/docker.sock:/var/run/docker.sock \
-e WATCHTOWER_NOTIFICATION_URL="smtp://USERNAME:[email protected]:587/[email protected]&[email protected]" \
nickfedor/watchtower
docker run -d \
--name watchtower \
-v /var/run/docker.sock:/var/run/docker.sock \
nickfedor/watchtower \
--notification-url "smtp://USERNAME:[email protected]:587/[email protected]&[email protected]"
Replace the following:
USERNAME: the user name for your SMTP server, with an@in it written as%40PASSWORD: the password for your SMTP server, percent-encoded
Use your SMTP server's host name in place of smtp.example.com and your own addresses in place of [email protected] and [email protected].
The following legacy SMTP configuration examples are deprecated and will be removed with the release of Watchtower v2.
services:
watchtower:
image: nickfedor/watchtower:latest
environment:
WATCHTOWER_NOTIFICATIONS: email
WATCHTOWER_NOTIFICATION_EMAIL_FROM: [email protected]
WATCHTOWER_NOTIFICATION_EMAIL_TO: [email protected]
WATCHTOWER_NOTIFICATION_EMAIL_SERVER: smtp.example.com
WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PORT: 587
WATCHTOWER_NOTIFICATION_EMAIL_SERVER_USER: USERNAME
WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PASSWORD: 'PASSWORD'
WATCHTOWER_NOTIFICATION_EMAIL_DELAY: 10
volumes:
- /var/run/docker.sock:/var/run/docker.sock
services:
watchtower:
image: nickfedor/watchtower:latest
environment:
WATCHTOWER_NOTIFICATIONS: email
WATCHTOWER_NOTIFICATION_EMAIL_FROM: [email protected]
WATCHTOWER_NOTIFICATION_EMAIL_TO: [email protected]
WATCHTOWER_NOTIFICATION_EMAIL_SERVER: relay.example.com
volumes:
- /var/run/docker.sock:/var/run/docker.sock
Note
This example sends through an SMTP relay at relay.example.com that accepts mail on port 25 without authentication.
If the relay offers STARTTLS, Watchtower checks its certificate against the server name, so the certificate must be valid for relay.example.com. A relay in the same Compose project can take that name as a network alias.
docker run -d \
--name watchtower \
-v /var/run/docker.sock:/var/run/docker.sock \
-e WATCHTOWER_NOTIFICATIONS=email \
-e WATCHTOWER_NOTIFICATION_EMAIL_FROM=[email protected] \
-e WATCHTOWER_NOTIFICATION_EMAIL_TO=[email protected] \
-e WATCHTOWER_NOTIFICATION_EMAIL_SERVER=smtp.example.com \
-e WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PORT=587 \
-e WATCHTOWER_NOTIFICATION_EMAIL_SERVER_USER=USERNAME \
-e WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PASSWORD='PASSWORD' \
-e WATCHTOWER_NOTIFICATION_EMAIL_DELAY=10 \
nickfedor/watchtower
docker run -d \
--name watchtower \
-v /var/run/docker.sock:/var/run/docker.sock \
nickfedor/watchtower \
--notifications email \
--notification-email-from [email protected] \
--notification-email-to [email protected] \
--notification-email-server smtp.example.com \
--notification-email-server-port 587 \
--notification-email-server-user USERNAME \
--notification-email-server-password 'PASSWORD' \
--notification-email-delay 10
docker run -d \
--name watchtower \
-v /var/run/docker.sock:/var/run/docker.sock \
-e WATCHTOWER_NOTIFICATIONS=email \
-e WATCHTOWER_NOTIFICATION_EMAIL_FROM=[email protected] \
-e WATCHTOWER_NOTIFICATION_EMAIL_TO=[email protected] \
-e WATCHTOWER_NOTIFICATION_EMAIL_SERVER=relay.example.com \
nickfedor/watchtower
docker run -d \
--name watchtower \
-v /var/run/docker.sock:/var/run/docker.sock \
nickfedor/watchtower \
--notifications email \
--notification-email-from [email protected] \
--notification-email-to [email protected] \
--notification-email-server relay.example.com
Note
These examples send through an SMTP relay at relay.example.com that accepts mail on port 25 without authentication.
If the relay offers STARTTLS, Watchtower checks its certificate against the server name, so the certificate must be valid for relay.example.com.
Replace the following:
USERNAME: the user name for your SMTP serverPASSWORD: the password for your SMTP server, inside the single quotes. In a Compose file, write each'in it as''and each$as$$. In a shell command, write each'as'\''.
Use your SMTP server's or relay's host name in place of smtp.example.com or relay.example.com and your own addresses in place of [email protected] and [email protected].
Common SMTP Configurations¶
| Property | Value |
|---|---|
| Port | 587 |
| Encryption | ExplicitTLS |
| UseStartTLS | Yes |
smtp://GMAIL_USER%40gmail.com:[email protected]:587/?fromaddress=GMAIL_USER%40gmail.com&toaddresses=TO_ADDRESS&encryption=ExplicitTLS&usestarttls=yes&timeout=30s
Replace the following:
GMAIL_USER: the part of your Gmail address before the@APP_PASSWORD: your Gmail password, or an App PasswordTO_ADDRESS: the address that receives the notifications, with its@written as%40
Note
For Gmail, use an App Password if two-factor authentication is enabled.
Omit spaces from the App Password. Google displays the 16-character passcode in groups of four, but those spaces are not part of the password.
Do not use &auth=OAuth2 with an App Password. That method expects a SASL XOAUTH2 access token in the password field.
| Property | Value |
|---|---|
| Port | 587 |
| Encryption | ExplicitTLS |
| UseStartTLS | Yes |
smtp://SMTP_USERNAME:[email protected]:587/?fromaddress=FROM_ADDRESS&toaddresses=TO_ADDRESS&encryption=ExplicitTLS&usestarttls=yes&timeout=30s
Replace the following:
SMTP_USERNAME: the user name of your Amazon SES SMTP credentialsSMTP_PASSWORD: the password of your Amazon SES SMTP credentials, percent-encodedREGION: the AWS Region of your Amazon SES endpoint, such asus-east-1FROM_ADDRESS: a verified sender address, with its@written as%40TO_ADDRESS: the address that receives the notifications, with its@written as%40
| Property | Value |
|---|---|
| Port | 587 |
| Authentication | OAuth2 client credentials |
| RequireStartTLS | Yes |
smtp://[email protected]:587/?fromaddress=FROM_ADDRESS&toaddresses=TO_ADDRESS&clientid=CLIENT_ID&clientsecret=CLIENT_SECRET&scopes=https%3A%2F%2Foutlook.office365.com%2F.default&tokenurl=https%3A%2F%2Flogin.microsoftonline.com%2FTENANT_ID%2Foauth2%2Fv2.0%2Ftoken&requirestarttls=yes&timeout=30s
Replace the following:
MAILBOX: the address of the sending mailbox, with its@written as%40FROM_ADDRESS: the sender address, with its@written as%40TO_ADDRESS: the address that receives the notifications, with its@written as%40CLIENT_ID: the application (client) ID of your app registrationCLIENT_SECRET: the client secret of your app registration, percent-encodedTENANT_ID: your Microsoft Entra tenant ID
Note
Shoutrrr gets OAuth2 access tokens from Microsoft Entra ID with the client credentials grant. Follow Shoutrrr's Microsoft 365 guide to register the application and give it access to the sending mailbox.
Exchange Online turns off Basic authentication for SMTP AUTH by default in existing tenants at the end of December 2026. A URL with a password, such as smtp://MAILBOX:[email protected]:587/, works only while the tenant allows it.
| Property | Value |
|---|---|
| Port | 465 |
| Encryption | ImplicitTLS |
| UseStartTLS | No |
smtp://USERNAME:[email protected]:465/?fromaddress=FROM_ADDRESS&toaddresses=TO_ADDRESS&encryption=ImplicitTLS&usestarttls=no&timeout=30s
Replace the following:
USERNAME: the user name for your SMTP server, with an@in it written as%40PASSWORD: the password for your SMTP server, percent-encodedFROM_ADDRESS: the sender address, with its@written as%40TO_ADDRESS: the address that receives the notifications, with its@written as%40
| Property | Value |
|---|---|
| Port | 25 |
| Encryption | None |
| UseStartTLS | No |
smtp://USERNAME:[email protected]:25/?fromaddress=FROM_ADDRESS&toaddresses=TO_ADDRESS&encryption=None&usestarttls=no&timeout=30s
Replace the following:
USERNAME: the user name for your SMTP server, with an@in it written as%40PASSWORD: the password for your SMTP server, percent-encodedFROM_ADDRESS: the sender address, with its@written as%40TO_ADDRESS: the address that receives the notifications, with its@written as%40
Notes¶
-
Timeout:
- The default SMTP timeout is 10 seconds.
- If you experience timeouts (e.g.,
failed to send: timed out: using smtp), add&timeout=30sto the URL to allow more time for server responses, especially with proxies or slow networks.
-
Authentication:
- Use
&auth=Plainfor username and password authentication, including Gmail App Passwords. This is the default when credentials are provided. - Set
clientid,clientsecret,scopesandtokenurlto have Shoutrrr get OAuth2 access tokens with the client credentials grant, as the Microsoft 365 example does. Shoutrrr then uses OAuth2 without&auth=OAuth2. - Use
&auth=OAuth2only for SASL XOAUTH2 with a static access token in the password field. App Passwords are not OAuth2.
- Use
-
Testing:
- Install Shoutrrr using one of the various installation methods.
- Test your URL with the Shoutrrr CLI:
Replace
NOTIFICATION_URLwith thesmtp://URL to test. -
Proxy Issues:
- If using a Docker proxy (e.g.,
tcp://dockerproxy:2375), ensure it allows outbound connections to your SMTP server's host and port. - Test connectivity with
telnet SMTP_HOST SMTP_PORTinside the container. ReplaceSMTP_HOSTwith your SMTP server's host name andSMTP_PORTwith its port.
- If using a Docker proxy (e.g.,