---
title: "Deploy OpenClaw Telegram"
description: "Self-hosted OpenClaw with Telegram bot channel"
category: "AI/ML"
url: https://railway.com/deploy/openclaw-telegram
---

# Deploy OpenClaw Telegram

Self-hosted OpenClaw with Telegram bot channel

**[Deploy OpenClaw Telegram on Railway](https://railway.com/template/openclaw-telegram)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/openclaw-telegram/manifest.json

- **Creator:** onepush
- **Category:** AI/ML

## Template content

### OpenClaw

- **Image:** openclaw/openclaw:2026.10.3-browser@sha256:c84c4c37e7b9dc02dd869c9699ba0c4fb20ff821febe4b789bb2f8f4bfd9c8a3
- **Start command:** `/bin/sh -c "set -ef; D=${RAILWAY_VOLUME_MOUNT_PATH:-/data}; mkdir -p $D/.openclaw $D/workspace $D/.config/openclaw; if [ ! -L /home/node/.config/openclaw ]; then rm -rf /home/node/.config/openclaw; ln -s $D/.config/openclaw /home/node/.config/openclaw; fi; find $D ! -user 1000 -exec chown -h 1000:1000 {} +; chmod 700 $D/.openclaw; cd /app; if [ ${#OPENCLAW_RAILWAY_CONFIG} -gt 0 ]; then setpriv --reuid=1000 --regid=1000 --init-groups env HOME=/home/node USER=node node openclaw.mjs config set --batch-json $OPENCLAW_RAILWAY_CONFIG || echo railway-start: config batch failed; fi; exec setpriv --reuid=1000 --regid=1000 --init-groups env HOME=/home/node USER=node tini -s -- node /app/docker-entrypoint.mjs node openclaw.mjs gateway --bind lan --port 18789 --allow-unconfigured"`
- **Health check:** /healthz
- **Public domain:** Yes

## Documentation

# Deploy and Host OpenClaw Telegram (Self-Hosted AI Assistant Gateway) on Railway

OpenClaw Telegram runs the official openclaw/openclaw:2026.10.3-browser Gateway on Railway with Telegram as the first channel. Same unmodified, digest-pinned container, Chromium plus Xvfb, /data volume, and zero deploy-time config. BotFather token, pairing approve, and groups are the operator path.

## About Hosting OpenClaw Telegram on Railway (self hosted OpenClaw Telegram template)

This template deploys one service on port 18789 with health /healthz and volume /data (state under /data/.openclaw, workspace under /data). The start command chowns the volume, applies OPENCLAW_RAILWAY_CONFIG (gateway.mode local, publicOrigin and controlUi.allowedOrigins from RAILWAY_PUBLIC_DOMAIN, trustedProxies 100.64.0.0/10), then runs `openclaw gateway --bind lan --port 18789 --allow-unconfigured` as the node user.

Generated secret: OPENCLAW_GATEWAY_TOKEN (48 chars). Fixed: PORT and OPENCLAW_GATEWAY_PORT=18789, OPENCLAW_GATEWAY_BIND=lan, OPENCLAW_STATE_DIR, OPENCLAW_CONFIG_DIR, OPENCLAW_CONFIG_PATH, OPENCLAW_WORKSPACE_DIR, HOME, OPENCLAW_HOME, TZ, RAILWAY_RUN_UID. Optional empty: OPENAI_API_KEY, ANTHROPIC_API_KEY, TELEGRAM_BOT_TOKEN. Telegram is a bundled plugin; set the BotFather token in env or Control UI, then approve unknown DMs with `openclaw pairing approve telegram PAIRING-CODE`.

## Why Deploy OpenClaw Telegram, the ChatGPT alternative on Railway (Railway Free Trial)

ChatGPT lives in one closed app. OpenClaw Telegram puts a model-agnostic assistant in Telegram, with tools and browser control on your volume. Older Railway OpenClaw templates wrap npm openclaw@2026.9.x behind /setup; this one runs the official 2026.10.3-browser image so upstream channel docs apply. Railway's $5 trial covers a first bot test.

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 OpenClaw 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.

### Railway vs Other Hosting Providers and VPS for OpenClaw Telegram self hosting

Railway removes reverse proxy, TLS, health checks, and volume work you would own on a raw VPS when exposing a Telegram bot.

| Provider | Setup style | OpenClaw Telegram fit | Typical monthly cost |
| --- | --- | --- | --- |
| DigitalOcean | Droplet or App Platform, manual reverse proxy | Fine if you want root; you still manage OS, TLS, and bot uptime | $6-12 for 1-2 GB RAM |
| AWS | EC2 or ECS, IAM and VPC | Works at scale, heavy for one Gateway + Telegram bot | $10-25 for t3.small plus load balancer |
| Hetzner | Cloud VPS, simple networking | Cheap RAM for the browser image; you run proxy, TLS, updates | EUR 4-10 for 2-4 GB RAM |

The template sets trustedProxies to 100.64.0.0/10 (Railway's proxy range) so Control UI and channel callbacks see correct client context.

## Common Use Cases for hosted OpenClaw Telegram

Personal assistant on your phone: message the bot from Telegram DMs after pairing. Family or small team bot with per-sender pairing so strangers do not get tool access. Group ops bot that only answers when mentioned. Research helper that uses the baked-in Chromium tools, then replies in Telegram. Status and ops: `openclaw channels status --probe` after you set TELEGRAM_BOT_TOKEN.

## Dependencies for OpenClaw Telegram Docker hosted on Railway

Only the official image and Railway. The browser variant bundles Node, Chromium, Xvfb, and OpenClaw 2026.10.3. No build step. A model provider key is needed for prompts, but the Gateway and Telegram channel start without one. BotFather token is the Telegram-specific dependency.

### Deployment Dependencies for Managed OpenClaw Telegram Service (AI Assistant)

One container on port 18789, health /healthz, volume /data. Railway public domain for Control UI. Optional TELEGRAM_BOT_TOKEN already wired empty. After first Control UI open, approve the browser device once with `openclaw devices approve` in the service shell.

### Implementation Details for OpenClaw Telegram (Using OpenClaw official docker image)

Image openclaw/openclaw:2026.10.3-browser, digest-pinned, multi-arch. Doctor migrations run as upstream. Telegram plugin is bundled; WhatsApp and others can be added later without changing the stack. Tools run inside the container for the main session unless you configure sandboxing. DM policy defaults to pairing: unknown Telegram senders get a code, not free access.

## How does OpenClaw Telegram compare against other AI assistant platforms

### OpenClaw vs Hermes Agent

- **Origin:** OpenClaw is a Node.js Gateway; Hermes Agent is Python (Nous Research, MIT).
- **Channels:** OpenClaw ships mature Telegram pairing and 20+ channels; Hermes is more skill/learning focused.
- **Migration:** Hermes can migrate from OpenClaw.
- **Deploy:** Both fit one Railway service; OpenClaw's Telegram path is documented first in upstream channel guides.

### OpenClaw vs Open WebUI

- **Purpose:** Open WebUI is a model chat UI; OpenClaw is an agent Gateway with sessions, tools, and channels.
- **Telegram:** OpenClaw is a native bot with pairing; Open WebUI needs a separate bridge you maintain.
- **Browser:** OpenClaw includes Chromium + Xvfb; Open WebUI does not.
- **State:** OpenClaw keeps channel state under /data/.openclaw.

### OpenClaw vs n8n AI agents

- **License:** OpenClaw MIT; n8n fair-code.
- **Focus:** n8n is workflow automation with AI nodes; OpenClaw is a persistent assistant with Telegram sessions.
- **Telegram:** n8n can trigger on messages; OpenClaw keeps conversation context and tool history in the Gateway.
- **Deploy:** OpenClaw is one Gateway container; n8n may need workers.

### OpenClaw vs ChatGPT

- **Control:** ChatGPT is closed SaaS; OpenClaw is MIT on your service.
- **Telegram:** OpenClaw is an official-style bot you own; ChatGPT has no first-party Telegram bot.
- **Models:** OpenClaw plugins (Claude, Codex, local); ChatGPT is OpenAI-locked.
- **Cost:** No OpenClaw paid plan; you pay API + Railway only.

## How to use OpenClaw Telegram (the OSS AI assistant)?

Open the public domain, paste OPENCLAW_GATEWAY_TOKEN into Control UI, run `openclaw devices approve` once. Create a bot with @BotFather (`/newbot`), set TELEGRAM_BOT_TOKEN (or paste in Settings), restart if needed. When an unknown user DMs, approve with `openclaw pairing approve telegram PAIRING-CODE`. Add a model key under Settings -> Models or via env. For groups, add the bot and approve the group the same way; prefer mention gates for noisy chats.

## How to self host OpenClaw Telegram on other VPS Services (OpenClaw Telegram self hosting guide)

Same stack on any VPS with Docker or Node. Install: `curl -fsSL https://openclaw.ai/install.sh | bash` or `npm install -g openclaw@latest` (Node 24.16+ or 26.1+), then `openclaw onboard --install-daemon`. Prefer the -browser image if you want Chromium tools.

### Clone the Repository

Clone the OpenClaw repo and check out the tag that matches the image (for example 2026.10.3). The repo holds gateway source, channel plugins, and example configs.

### Install Dependencies

Install Node 24.16+ or 26.1+, then npm install. For browser tools on bare metal, install Chromium and Xvfb, or stay on the -browser Docker image.

### Configure Environment Variables

Set OPENCLAW_GATEWAY_TOKEN, ports/bind, state/config/workspace dirs, and HOME. Set TELEGRAM_BOT_TOKEN from BotFather. Add OPENAI_API_KEY or ANTHROPIC_API_KEY when ready. Mirror Railway's publicOrigin and allowedOrigins if you sit behind a reverse proxy.

### Start the OpenClaw Telegram Application

Run `openclaw gateway --bind lan --port 18789 --allow-unconfigured`. Open Control UI, paste the token, approve the device, then pair Telegram senders. Probe with `openclaw channels status --probe`.

## Official Pricing of OpenClaw Telegram (OpenClaw pricing)

OpenClaw is MIT-licensed and free. There is no OpenClaw paid plan. You pay model providers and hosting only.

## OpenClaw Telegram cloud vs self hosted comparison (Pricing, features, costs, and more)

The project does not sell a hosted Gateway. "Cloud" means a platform like Railway running the same image. Self-host keeps Telegram transcripts, tokens, and tool state on your volume.

### Monthly cost of self hosting OpenClaw Telegram on Railway

About $10-25/mo for the browser image (1-2 GB RAM), plus model API spend. Railway $5 trial covers early testing.

### System Requirements for Hosting OpenClaw Telegram on a VPS

1 CPU and 1-2 GB RAM for light use; plan 1.5-2 GB RAM for Chromium + Xvfb. Keep /data on persistent disk. Outbound HTTPS to Telegram and model APIs is required.

## Frequently Asked Questions (FAQs)

### How do I get a Telegram bot token for OpenClaw?

Message @BotFather, send /newbot, pick name and username, copy the HTTP API token into TELEGRAM_BOT_TOKEN or Control UI.

### What does openclaw pairing approve telegram do?

Unknown DM senders get a pairing code. Run `openclaw pairing approve telegram PAIRING-CODE` in the Railway shell to allow that sender.

### Can I use OpenClaw Telegram in a group chat?

Yes. Add the bot to the group, approve the group, and prefer mention-required settings so it does not reply to every message.

### Do I need a public domain for Telegram?

Railway provides one. Long-polling works without custom DNS; webhooks need a reachable HTTPS URL, which Railway already gives you.

### Is the Telegram channel in the official Docker image?

Yes. The Telegram plugin is bundled. Set the token and pair; no extra container.

### Can I add WhatsApp or Discord later?

Yes. Same Gateway stack. WhatsApp needs QR pairing and more on-disk state; Discord uses a bot token. Telegram stays the fastest first channel.


## Similar templates

- [Chat Chat](https://railway.com/deploy/-WWW5r) — Chat Chat, your own unified chat and search to AI platform.
- [stella](https://railway.com/deploy/stella) — Self-host stella with web, API, Postgres, Redis, and object storage.
- [Hermes Agent | OpenClaw Alternative with Dashboard](https://railway.com/deploy/hermes-agent-or-openclaw-alternative-wit) — Self-Hosted Hermes AI Agent for Telegram, Discord & Slack

Open this page in a browser: https://railway.com/deploy/openclaw-telegram
