{"id":25948819,"url":"https://github.com/gdagtekin/dockegram","last_synced_at":"2026-02-27T20:03:01.263Z","repository":{"id":279848774,"uuid":"940194241","full_name":"gdagtekin/dockegram","owner":"gdagtekin","description":"A Telegram bot for managing Docker containers with simple commands.","archived":false,"fork":false,"pushed_at":"2025-03-03T17:17:08.000Z","size":37,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-07T02:21:51.371Z","etag":null,"topics":["docker","docker-compose","self-hosted","telegram-bot"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gdagtekin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-27T19:07:43.000Z","updated_at":"2025-03-03T17:17:11.000Z","dependencies_parsed_at":"2025-02-28T03:52:49.165Z","dependency_job_id":"b0f63489-cf6d-4b32-9319-84de39cc5948","html_url":"https://github.com/gdagtekin/dockegram","commit_stats":null,"previous_names":["gdagtekin/dockegram"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/gdagtekin/dockegram","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gdagtekin%2Fdockegram","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gdagtekin%2Fdockegram/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gdagtekin%2Fdockegram/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gdagtekin%2Fdockegram/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gdagtekin","download_url":"https://codeload.github.com/gdagtekin/dockegram/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gdagtekin%2Fdockegram/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271636034,"owners_count":24794144,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-22T02:00:08.480Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-compose","self-hosted","telegram-bot"],"created_at":"2025-03-04T11:23:06.183Z","updated_at":"2026-02-27T20:02:56.223Z","avatar_url":"https://github.com/gdagtekin.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DockeGram\n\nDockeGram is a Telegram bot that allows you to manage Docker containers directly through Telegram messages. With DockeGram, you can start, stop, restart containers, view logs, and monitor container status, all from your Telegram app.\n\n## Features\n\n- Start, stop, and restart Docker containers\n- View container logs\n- List all containers with their current status\n- Check if specific containers exist\n- Automatic monitoring of container status with alerts for unexpected stops\n- User authentication to restrict access to authorized users only\n\n## Prerequisites\n\n- Docker installed on your host machine\n- Telegram Bot Token (obtained from BotFather)\n- Telegram User ID of authorized users\n\n### Creating a Telegram Bot\n\n1. Open Telegram and search for `@BotFather`\n2. Start a chat with BotFather and send the command `/newbot`\n3. Follow the instructions to create your bot\n4. Once created, BotFather will provide you with a token. Save this token for later use.\n\n### Getting Your Telegram User ID\n\n\n1. Send a message to `@userinfobot` on Telegram\n2. The bot will reply with your User ID and other information\n\n## Installation and Usage\n\n\u003cdetails open\u003e\n  \u003csummary\u003e\u003ch3\u003eMethod 1: Using Docker Compose\u003c/h3\u003e\u003c/summary\u003e \n\n1. Create a `docker-compose.yml` file with the following content:\n\n```yaml\nversion: '3.9'\n\nservices:\n  dockergram:\n    image: gdagtekin/dockegram:latest\n    container_name: dockegram\n    restart: unless-stopped\n    environment:\n      - TELEGRAM_BOT_TOKEN=YOUR_BOT_TOKEN\n      - ALLOWED_USER_IDS=YOUR_USER_ID\n      - ENABLE_MONITORING=True\n      - MONITORING_INTERVAL=300\n    volumes:\n      - /var/run/docker.sock:/var/run/docker.sock\n```\n\n2. Replace `YOUR_BOT_TOKEN` and `YOUR_USER_ID` with your actual values\n3. Run the following command in the same directory as your `docker-compose.yml` file:\n\n```bash\ndocker compose up -d\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ch3\u003eMethod 2: Using Docker Run\u003c/h3\u003e\u003c/summary\u003e \n\n```bash\ndocker run -d \\\n  --name dockegram \\\n  --restart unless-stopped \\\n  -e TELEGRAM_BOT_TOKEN=YOUR_BOT_TOKEN \\\n  -e ALLOWED_USER_IDS=YOUR_USER_ID \\\n  -e ENABLE_MONITORING=True \\\n  -e MONITORING_INTERVAL=300 \\\n  -v /var/run/docker.sock:/var/run/docker.sock \\\n  gdagtekin/dockegram:latest\n```\n\nReplace `YOUR_BOT_TOKEN` with the token provided by BotFather and `YOUR_USER_ID` with your Telegram User ID. If you want to allow multiple users, separate their IDs with commas (e.g., `123456789,987654321`).\n\n\nCheck your log\n\n```bash\ndocker logs -f dockegram\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ch3\u003eMethod 2: Building from Source\u003c/h3\u003e\u003c/summary\u003e \n\n1. Clone the repository:\n\n```bash\ngit clone https://github.com/gdagtekin/dockegram.git\ncd dockegram\n```\n\n2. Build the Docker image:\n\n```bash\ndocker build -t dockegram .\n```\n\n3. Run the container:\n\n```bash\ndocker run -d \\\n  --name dockegram \\\n  --restart unless-stopped \\\n  -e TELEGRAM_BOT_TOKEN=YOUR_BOT_TOKEN \\\n  -e ALLOWED_USER_IDS=YOUR_USER_ID \\\n  -e ENABLE_MONITORING=True \\\n  -e MONITORING_INTERVAL=300 \\\n  -v /var/run/docker.sock:/var/run/docker.sock \\\n  dockegram\n```\n\n```bash\ndocker logs -f dockegram\n```\n\n\u003c/details\u003e\n\n## Configuration Options\n\nYou can configure Dockegram using the following environment variables:\n\n| Variable | Description | Default |\n|----------|-------------|---------|\n| `TELEGRAM_BOT_TOKEN` | Your Telegram Bot token | Required |\n| `ALLOWED_USER_IDS` | Comma-separated list of authorized Telegram User IDs | Required |\n| `ENABLE_MONITORING` | Enable automatic container monitoring | False |\n| `MONITORING_INTERVAL` | Monitoring check interval in seconds | 300 |\n\n## Bot Commands\n\nDockegram supports two command formats:\n\n### Direct Command Format (Recommended)\n\n- `/start_container_name` - Start a container\n- `/stop_container_name` - Stop a container\n- `/restart_container_name` - Restart a container\n- `/logs_container_name` - Show last 10 logs from a container\n\n### Traditional Format (Also Supported)\n\n- `/start container_name` - Start a container\n- `/stop container_name` - Stop a container\n- `/restart container_name` - Restart a container\n- `/logs container_name` - Show last 10 logs from a container\n- `/check container_name` - Check if a container exists\n\n### Other Commands\n\n- `/list` - List all containers with clickable command links\n- `/help` - Show help message\n- `/info` - Show information about the bot environment\n\n## Usage Examples\n\n- To start a container named \"nginx\": `/start_nginx` or `/start nginx`\n- To stop a container: `/stop_nginx` or `/stop nginx`\n- To view container logs: `/logs_nginx` or `/logs nginx`\n- To list all containers: `/list`\n\n## Monitoring Feature\n\nWhen `ENABLE_MONITORING` is set to `True`, Dockegram will periodically check the status of all containers. If a container stops unexpectedly (not manually stopped through the bot), Dockegram will send an alert message to all authorized users.\n\n## Security Considerations\n\n- The bot only allows commands from users listed in `ALLOWED_USER_IDS`\n- The Docker socket is mounted into the container, which gives the bot full control over your Docker environment\n- Only give access to users you trust with full Docker control\n\n## License\n\nDistributed under the AGPLv3 License. See [`LICENSE.md`](https://github.com/gdagtekin/dockegram/blob/master/LICENSE) for more information.\n\n## Credits\n\nDeveloped by Gökhan Dağtekin\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgdagtekin%2Fdockegram","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgdagtekin%2Fdockegram","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgdagtekin%2Fdockegram/lists"}