Maintainer: Goutham Josh
Original Developer / Contributor: MysteryDemon
Have you encountered the problem where you have to host resource-efficient Telegram Bots for free and you can only host a bot per account, but you wanted to host multiple bots in one instance? Say no more...
BotClusters lets you run multiple bots in the same instance. Built with process isolation, supervisord auto-recovery, dynamic virtual environments, and a live web dashboard.
- ๐ค Web GUI Bot Manager: Add, configure, edit, clone, and delete bot clusters directly from the dashboard without editing config files
- ๐ Real-Time Resource Metrics: Live gauges for CPU load %, host RAM usage (MB / %), and Disk space
- โก Per-Process Telemetry: Track memory consumption (RSS MB), CPU %, uptime, and PID for each bot individually
- ๐๏ธ Batch Cluster Operations: One-click "Start All", "Stop All", and "Restart All" cluster management
- ๐ป Integrated Bot Console / Terminal: Execute diagnostic shell commands (
pip list,git status,python -c ...) inside any bot directory - โฌ๏ธ One-Click Git Pull & Reload: Pull latest commits from bot repositories on demand without full server rebuilds
- ๐ข Telegram Crash Alerts: Instant Telegram notifications if a bot repeatedly crashes or enters auto-pause
- ๐พ Cluster Backup & Restore: Export all bot definitions and environment settings to JSON and restore anytime
- ๐ Advanced Log Streaming: Real-time SSE log stream with process filtering, STDOUT/STDERR isolation, live search, and file export
- ๐ Auto Updates: Optional automatic updates through GitHub on restart
- ๐ก๏ธ Reliable Process Management: Powered by supervisord with automated process supervision and smart auto-pause recovery
- ๐ Environment Control: Configure key-value environment variables per bot directly in the visual editor
- ๐ฎ Custom Execution: Configure custom entry scripts (
bot.py,main.py,app.py,start.sh) - ๐ Private Repo Support: Clone and run bots from private repositories using GitHub tokens
- ๐๏ธ Cloud & Cross-Platform Integration: Ready for Render, Koyeb, Heroku, Docker, Codespaces, and standalone local environments
- ๐ Multi-Python Support: Supports specific Python versions (
3.10to3.13, as installed in the Docker image) - ๐ฉ Node.js Support: Run Node.js bots (
node:20,node:22,node:latest) with automaticnpm install
- Fork and Star this repository
- Configure your bots in
cluster.env - Deploy to your preferred platform using the buttons below
| Config | Description | Required |
|---|---|---|
botname |
Unique name for your bot | โ |
git_url |
Git repository URL | โ |
branch |
Repository branch name | โ |
run_command |
Bot execution command (bot.py, main.py, start.sh) |
โ |
env |
Environment variables dictionary | โ |
runtime_version |
Python version (3.10โ3.13) or Node.js (node:20, node:22, node:latest) |
โ |
cron |
Auto-restart cron schedule, e.g. 0 */6 * * * (7th item; use null as 6th item to skip the version; or set it in the bot form) |
โ |
python3.10 โข python3.11 โข python3.12 โข python3.13
- Format:
["botname", "git_url", "branch", "run_command", {ENV_DICT}, "runtime_version", "cron"]- For Public Repositories:
["bot01", "https://github.com/exampleuser/bot.git", "main", "bot.py", {"PORT": "8787"}]- For Private Repositories:
["bot02", "https://<your_username>:<your_github_token>@github.com/<your_username>/privatebot.git", "main", "main.py", {"PORT": "6060"}]- For Custom Python Version:
["bot03", "https://github.com/exampleuser/legacybot.git", "main", "main.py", {"PORT": "6060"}, "3.11"]- For Node.js Bots:
["bot04", "https://github.com/exampleuser/nodebot.git", "main", "index.js", {"BOT_TOKEN": "123:ABC"}, "node:22"]- For Module Entry Points (
python -m):
["bot05", "https://github.com/exampleuser/pkgbot.git", "main", "-m mypkg.main", {}]- Launch a Codespace on this repository (Code > Codespaces > Create codespace on main).
- Configure your bot in
cluster.env:cp cluster.env.sample cluster.env nano cluster.env
- Build and test using Docker:
docker build -t botclusters . docker run -p 5000:5000 --env-file cluster.env botclusters - Open Dashboard: Codespaces will automatically detect port
5000and prompt you to Open in Browser. Log in withadmin/password123.
- Pull, webhook, auto-pull and rollback no longer start a bot you stopped - they restart only bots that are RUNNING.
- Dependencies now reinstall when
requirements.txt/package.jsonchanges, also at boot after an auto-update (hash stamp insidevenv/ornode_modules/). - Node.js bots: pull / rollback re-run
npm installwhenpackage.jsonchanges. - Dotted module run commands (
pkg.sub.main) are no longer cut topkg. - Settings save is all-or-nothing: an invalid value no longer leaves earlier fields half-saved.
- Graceful shutdown no longer crashes on a changing process list; stale Installingโฆ badges clear at boot immediately.
- Live dashboard updates work again (
broadcast=socket error fixed). - Bots no longer vanish / show STOPPED when one bot is down (
supervisorctl statusexit code 3). worker.pynow uses the same names/paths as the dashboard (no random name prefix), sets up ALLCLUSTER_xx(not only 30), and one bad repo no longer blocks the rest.update.pyno longer deletes/overwritescluster.env.- Random per-install session secret, login lockout, constant-time password check.
- Clone / pip install runs in background with an Installingโฆ / Setup failed card state.
- Per-bot cron restart now really works; global schedule only restarts bots that are running.
- Crash alerts (Telegram) fire even with no browser open; real CPU %; container-aware RAM gauge.
- Reserved bot names (
app,bots, โฆ) blocked - they could wipe dashboard files.
- ๐ RAM sparkline + restart counter on every bot card (spot crash loops / memory leaks).
- โช Versions: last commits per bot, one-click rollback (and roll forward).
- ๐ GitHub webhook auto-deploy: copy the per-bot URL from Versions into GitHub โ Webhooks (push). Push = pull + restart.
- โฌ Auto-pull schedule (Settings โ minutes): restarts a running bot only when its repo has new commits.
- ๐ Secret-masked env editor: tokens/keys/passwords hidden until you click the eye.
- โง Clone bot: copy a bot's settings into a new one.
- Bots can be Python, Node.js, or bash scripts.
- It is not compulsory to set a Python version; only set it if your bot specifically requires an older/newer interpreter.
- Keep your tokens and sensitive information secure in
cluster.env. Never commit a realcluster.env- add it to.gitignore. - If your bot needs additional system or pip packages, define them in
install.sh. - GUI login details (configurable via
ADMIN_USERNAMEandADMIN_PASSWORD):- Default
admin/password123- change it in Settings right after first login (dashboard warns you).
- Default
- Maintainer: Goutham Josh
- Original Developer: MysteryDemon
- Upstream Inspiration: MultiBots
Contributions are welcome! Please feel free to submit a Pull Request.