pyTMbot is a Docker-first Telegram bot for Docker operations, server monitoring, and secure remote administration.
翻訳待ち
Loading the full README.
Read the full README ↗pyTMbot lets you manage Docker containers and monitor server health directly from Telegram — without opening a terminal. It supports both polling and webhook modes, enforces access control with allowlists and TOTP-based 2FA, and extends via a modular plugin system.
Built on pyTelegramBotAPI, psutil, and docker-py.
Create /etc/pytmbot/pytmbot.yaml following the settings guide.
services:
pytmbot:
image: orenlab/pytmbot:stable
container_name: pytmbot
restart: on-failure
environment:
TZ: UTC
PYTMBOT_STATE_DIR: /run/pytmbot
group_add:
- "${DOCKER_GID:-1001}"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- /etc/pytmbot/pytmbot.yaml:/opt/app/pytmbot.yaml:ro
security_opt:
- no-new-privileges:true
read_only: true
cap_drop:
- ALL
pid: host
tmpfs:
- /run/pytmbot:noexec,nosuid,nodev,size=10m,mode=0700,uid=1001,gid=1001
command: [ "--log-level", "INFO" ]
To grant access to the Docker socket, set DOCKER_GID once, next to the compose file (without it, group_add
falls back to the bot's own group 1001 and changes nothing):
echo "DOCKER_GID=$(stat -c %g /var/run/docker.sock)" > .env
docker compose up -d
For a hardened production setup with resource limits, tmpfs, network isolation, and health checks — see the Docker runtime guide.
allowed_user_ids and allowed_admins_idsTwo plugins are included out of the box:
Monitor Plugin — push notifications for CPU, memory, disk, temperature, and container/image state changes.
Outline VPN Plugin — monitor your Outline VPN server from Telegram.
See the plugins guide for the plugin API and configuration reference.
| Component | Requirement |
|---|---|
| Python | >=3.12,<4 (CI: 3.12-3.14) |
| Docker Engine | 20.10+ |
| Docker Compose | v2.0+ |
| Docker socket | required for container management |
Polling — simplest deployment; no HTTPS or public endpoint required.
Webhook — lower latency; requires a public hostname for Telegram setWebhook.
See the webhook guide.
Full docs: orenlab.github.io/pytmbot
| Guide | Description |
|---|---|
| Installation | Step-by-step setup |
| Docker | Docker-specific deployment |
| Settings | pytmbot.yaml reference |
| Commands | All bot commands |
| Webhook mode | Webhook setup and proxy config |
| Security | Hardening and threat model |
| Access control & 2FA | Allowlists and TOTP |
| Health system | Startup and runtime checks |
| Plugins | Plugin API and bundled plugins |
| CLI arguments | --log-level, --health_check, etc. |
| Architecture | Internal design overview |
| Development | Contributing and local setup |
| Roadmap | Planned features |
| Debugging | Logging and troubleshooting |
Bug reports, feature requests, and pull requests are welcome. Please read the development guide before submitting a PR.
Licensed under the MIT License.