https://github.com/pyenb/watchtower-telegram-notifications
A simple write-up on how to receive Telegram notifications from Watchtower whenever an image is updated.
https://github.com/pyenb/watchtower-telegram-notifications
docker docker-compose notifications telegram telegram-bot watchtower watchtower-container watchtowerrr
Last synced: 4 days ago
JSON representation
A simple write-up on how to receive Telegram notifications from Watchtower whenever an image is updated.
- Host: GitHub
- URL: https://github.com/pyenb/watchtower-telegram-notifications
- Owner: Pyenb
- License: gpl-3.0
- Created: 2023-09-03T21:27:22.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-11T13:39:05.000Z (over 1 year ago)
- Last Synced: 2025-10-10T21:15:12.120Z (4 days ago)
- Topics: docker, docker-compose, notifications, telegram, telegram-bot, watchtower, watchtower-container, watchtowerrr
- Homepage:
- Size: 19.5 KB
- Stars: 26
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Watchtower telegram notifications
This repo is just a simple write-up on how to get telegram notifications from Watchtower, when a container is updated. This version is mostly focused on docker-compose, but should also work with docker run.
## Contents
1. [Installation](#installation)
2. [Complete docker-compose file](#complete-docker-compose-file)
3. [Contributing](#contributing)
4. [Disclaimer](#disclaimer)## Installation
It's pretty easy to get telegram notifications from Watchtower. You just need to follow these steps:
### 1. Telegram Bot
Firstly, we need to create a new telegram bot. For that open a new chat with [BotFather](https://telegram.me/botfather), type in the command `/newbot` and follow the instructions. In the end you should see a message like this:

### 2. Get your chat id
After creating your bot, you need to get your chat id. For that, open a new chat with your bot, start it and tag `@get_id_bot` in the chat. You should get a message like this:

### 3. Setup Watchtower
Now we need to setup Watchtower. For that, you need to add the following environment variables to your docker-compose file:
```yaml
environment:
- WATCHTOWER_NOTIFICATIONS=shoutrrr
- WATCHTOWER_NOTIFICATION_URL=telegram://HTTP_API_TOKEN@telegram?chats=CHAT_ID
```Replace `HTTP_API_TOKEN` with the token you got from BotFather in step 1. and `CHAT_ID` with the chat id you got from `@get_id_bot` in step 2.
### 4. (Re)start Watchtower
Now you can (re)start Watchtower:
```bash
sudo docker-compose up -d --force-recreate
```and you should get a message from your bot, that Watchtower is running. The message should look like this:

You will also get a message, when a container is updated. It should look like this:

## Complete docker-compose file
If you are still unsure, how your docker-compose file should look like, check out the `docker-compose.yml` file in this repo. Most optional settings are commented, so everything is more understandable. Just remember to replace `HTTP_API_TOKEN` with the token you got from BotFather in step 1. and `CHAT_ID` with the chat id you got from `@get_id_bot` in step 2.
## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
[](https://www.gnu.org/licenses/gpl-3.0)
## Disclaimer
This repository is for research purposes only, the use of this code is your responsibility.I take NO responsibility and/or liability for how you choose to use any of the source code available here. By using any of the files available in this repository, you understand that you are AGREEING TO USE AT YOUR OWN RISK. Once again, ALL files available here are for EDUCATION and/or RESEARCH purposes ONLY.