Railway

Deploy Telegram Bot API Gateway

Self-hosted Telegram Bot API gateway, register bot tokens in a web admin.

Deploy Telegram Bot API Gateway

Just deployed

/app/data

Deploy and Host Telegram Bot API gateway on Railway

TG Bot Gate is a lightweight Telegram Bot API gateway written in Rust. You register bot tokens in a built-in admin UI; the service proxies /bot/ to Telegram only for registered bots, stores token hashes (not raw tokens) in SQLite, and rejects unknown tokens with 403.

About Hosting Telegram Bot API gateway

Deploying TG Bot Gate means running a single HTTP service that fronts the official Telegram Bot API (api.telegram.org). Your bots call your Railway URL instead of Telegram directly; the gateway checks the token against a registry, forwards allowed traffic, and can optionally log or persist audit data. The Docker image builds the React admin UI and the Rust binary in one container. Railway assigns PORT and HTTPS on your public domain; you set ADMIN_PASSWORD and persist GATE_DB_PATH so bot registrations and settings survive restarts. After deploy, open /admin, add tokens, and point webhooks or HTTP clients at https://.up.railway.app/bot/sendMessage (and other methods).

Common Use Cases

  • Self-hosted bot proxy — Run your own gateway URL so only bots you register can reach Telegram.
  • Multi-bot control plane — Manage several Telegram bots from one admin console with hashed token storage.
  • Observable bot traffic — Enable stdout JSON logging or SQLite audit capture from Settings after deploy.

Dependencies for Telegram Bot API gateway Hosting

  • Telegram Bot API (upstream) — Outbound HTTPS to https://api.telegram.org for proxied requests.
  • Persistent volume (recommended) — SQLite at GATE_DB_PATH (default /app/data/gate.db) for bot registry, admin password hash, and settings.

Deployment Dependencies

Implementation Details

VariableExampleDescription
ADMIN_PASSWORDstrong secretBootstrap admin password; stored as hash in SQLite
GATE_DB_PATH/app/data/gate.dbSQLite path; use a volume-backed path in production
PORTset by RailwayHTTP listen port
  1. Deploy from the template or connect this repo (builds via Dockerfile).
  2. Mount a volume at /app/data and set GATE_DB_PATH=/app/data/gate.db.
  3. Set ADMIN_PASSWORD.
  4. Open https:///admin, register bot tokens.
  5. Call https:///bot/ like the standard Telegram API.

Why Deploy

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying Telegram Bot API gateway on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.


Template Content

More templates in this category

View Template
Foundry Virtual Tabletop
A Self-Hosted & Modern Roleplaying Platform

Lucas
View Template
Letta Code Remote
Run a Letta Code agent 24/7. No inbound ports, just deploy.

Letta
View Template
(v1) Simple Medusa Backend
Deploy an ecommerce backend and admin using Medusa

Shahed Nasser