Drop your bot in the hive. We keep it alive.
Self-hostable platform for running Telegram bots: paste a bot token, upload a zip or connect a GitHub repo, and BotHive builds it into a container, deploys it, restarts it when it crashes, and gives you live logs.
- Token-to-running-bot in minutes — no servers to manage per bot; each bot runs in its own hardened container (
--cap-drop ALL,no-new-privileges, memory/CPU/pids caps). - Bring any code — Dockerfile, Procfile, or auto-detected Python/Node/Go/PHP projects; zip upload or GitHub repo.
- Three database modes per bot — BYO external DB, managed SQLite volume, or hosted Postgres (schema-per-bot on a shared instance).
- Polling or webhook ingress —
BOT_INGRESS=pollingruns bots with zero public infrastructure (no domain, TLS, or reverse proxy needed); webhook mode routes{slug}.{domain}through Traefik. - Multi-node ready — workers heartbeat into a
nodestable; bots are pinned to nodes and jobs are claimed by eligible workers only. - Operator-controlled signups —
BOTHIVE_SIGNUP=open|invite|closedwith invite links, plus email/password, magic link, OAuth (GitHub/Google/Discord), and Telegram login. - Single-user mode —
BOTHIVE_MODE=singleskips login entirely for a personal instance.
bothive-api/ Go control plane API + worker + builder binaries (chi + betterauth-go)
bothive-web/ Dashboard SPA (Vite + TanStack Router + Query)
deploy/ Compose files, VPS deploy script, image build script
examples/ echo-go, echo-js, echo-py, echo-php reference bots
config/ nodes.example.yaml
DOCS/ OAuth setup checklist, image build guide
- Go 1.25+ (API), Node 20+ (dashboard)
- Podman or Docker, with compose
- A Telegram bot token from @BotFather
# API + control Postgres + tenants Postgres on :8080
./deploy/docker-dev.sh
# Dashboard on :5173 (proxies /api → :8080)
cd bothive-web && npm ci && npm run devOpen http://localhost:5173. First run redirects to /setup — create the owner account, paste a bot token, deploy an example from examples/.
Running the API without containers instead:
cp .env.example .env # fill secrets
cd bothive-api && go run ./cmd/serverFull runbook with Traefik/TLS details: deploy/VPS-DEPLOY.md.
git clone https://github.com/sudoR3D/Hive.git
cd Hive
cp deploy/env/prod.env.example deploy/env/prod.env # then edit secrets/domains
./deploy/vps-deploy.sh
curl -fsS https://api.example.com/health # → okBuild the dashboard separately and serve bothive-web/dist from any static host:
VITE_API_URL=https://api.example.com ./deploy/build-platform.sh --web-only| Variable | Default | Purpose |
|---|---|---|
BOTHIVE_MODE |
single |
single = one operator, no login. multi = real auth. |
BOTHIVE_SIGNUP |
open |
multi mode signup policy: open | invite | closed |
BOT_INGRESS |
webhook |
polling needs no domain/TLS; webhook needs {slug}.{WEBHOOK_BASE_DOMAIN} |
WEBHOOK_BASE_DOMAIN |
example.com |
Base domain for bot webhook hostnames |
API_DOMAIN |
— | Public API hostname (Traefik route) |
TRUSTED_ORIGINS |
— | Exact dashboard origin(s) for CORS/auth cookies |
BOT_RAM_MB / BOT_CPUS |
256 / 0.25 |
Per-bot resource caps |
PODMAN_SOCKET |
— | Runtime socket mounted into the worker |
OAuth, SMTP, and Telegram login variables are optional — see DOCS/OAUTH-SETUP.md. Without SMTP, magic-link and password-reset emails are disabled cleanly.
- Create a bot with @BotFather, copy the token.
- In the dashboard: paste token → name it → pick code source (zip or GitHub).
- Deploy. The platform builds an image (or uses the repo's Dockerfile), runs the container wired with
BOT_TOKEN,DATABASE_URL, and ingress config, and reports health in the dashboard.
Reference bots live in examples/ — minimal echo bots in Go, JS, Python, and PHP that answer /start.
MIT — see LICENSE.