---
title: "Deploy LangBot IM Bots + Plugin Runtime (Postgres)"
description: "LangBot for Telegram, Discord, Slack and more, with plugins and Postgres"
category: "Bots"
url: https://railway.com/deploy/langbot-im-bots-plugin-runtime-postgres
---

# Deploy LangBot IM Bots + Plugin Runtime (Postgres)

LangBot for Telegram, Discord, Slack and more, with plugins and Postgres

**[Deploy LangBot IM Bots + Plugin Runtime (Postgres) on Railway](https://railway.com/template/langbot-im-bots-plugin-runtime-postgres)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/langbot-im-bots-plugin-runtime-postgres/manifest.json

- **Creator:** Protemplate
- **Category:** Bots
- **Total deploys:** 2

## Template content

### Postgres https://avatars.githubusercontent.com/u/177543?v=4

- **Image:** pgvector/pgvector:pg17
- **Start command:** `docker-entrypoint.sh postgres -c "listen_addresses=*"`

### LangBot https://raw.githubusercontent.com/langbot-app/LangBot/master/docs/langbot-logo.png

- **Image:** rockchin/langbot:v4.11.4
- **Start command:** `sh -c 'echo aW1wb3J0IGpzb24KaW1wb3J0IG9zCmltcG9ydCBzeXMKaW1wb3J0IHRpbWUKaW1wb3J0IHVybGxpYi5yZXF1ZXN0CgpUQUcgPSAiW3NlZWQtYWRtaW5dIgplbWFpbCA9IG9zLmVudmlyb24uZ2V0KCJMQU5HQk9UX0FETUlOX0VNQUlMIiwgIiIpLnN0cmlwKCkKcGFzc3dvcmQgPSBvcy5lbnZpcm9uLmdldCgiTEFOR0JPVF9BRE1JTl9QQVNTV09SRCIsICIiKQp1cmwgPSAiaHR0cDovLzEyNy4wLjAuMTolcy9hcGkvdjEvdXNlci9pbml0IiAlIG9zLmVudmlyb24uZ2V0KCJBUElfX1BPUlQiLCAiNTMwMCIpCgppZiBub3QgZW1haWwgb3Igbm90IHBhc3N3b3JkOgogICAgcHJpbnQoVEFHLCAiV0FSTklORzogTEFOR0JPVF9BRE1JTl9FTUFJTCBvciBMQU5HQk9UX0FETUlOX1BBU1NXT1JEIGlzIGVtcHR5OyB0aGUgZ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SAocmVzLmdldCgiY29kZSIpLCByZXMuZ2V0KCJtc2ciKSksIGZsdXNoPVRydWUpCiAgICAgICAgc3lzLmV4aXQoMCkKICAgIGV4Y2VwdCBFeGNlcHRpb246CiAgICAgICAgdGltZS5zbGVlcCgwLjUpCnByaW50KFRBRywgIkVSUk9SOiBMYW5nQm90IEFQSSBkaWQgbm90IGFuc3dlciBvbiBsb29wYmFjayB3aXRoaW4gMTUgbWludXRlcyIsIGZsdXNoPVRydWUpCnN5cy5leGl0KDEpCg== | base64 -d > /tmp/seed-admin.py; python /tmp/seed-admin.py & exec uv run --no-sync main.py'`
- **Health check:** /healthz
- **Public domain:** Yes

### Plugin Runtime https://raw.githubusercontent.com/langbot-app/LangBot/master/docs/langbot-logo.png

- **Image:** rockchin/langbot:v4.11.4
- **Start command:** `uv run --no-sync -m langbot_plugin.cli.__init__ rt`
- **Health check:** /healthz

## Documentation

# Deploy and Host LangBot on Railway

LangBot is an open source platform for running AI bots on instant messaging apps. Connect Telegram, Discord, Slack, Lark, DingTalk, WeCom, QQ, WeChat Official Accounts or LINE to models such as OpenAI, Anthropic, DeepSeek, Gemini, Ollama, Dify or n8n, and manage bots, pipelines, knowledge bases and plugins from one web UI.

## About Hosting LangBot

This template runs the official upstream layout: the LangBot core (web UI, API, webhooks and IM adapters) and a separate Plugin Runtime that executes plugins, both from the pinned `rockchin/langbot:v4.11.4` image. Data lives in a pgvector Postgres service instead of SQLite, and the runtime is reachable only over Railway's private network with a generated control token. The owner account is created automatically on first boot from the email you enter, so nobody else can claim your instance before you sign in.

## Common Use Cases

- **Team assistant in chat**: an LLM bot in Slack, Discord, Lark or Telegram groups
- **Customer support bot**: answer questions from a knowledge base on WeCom, WeChat or LINE
- **Front end for agent platforms**: put Dify, n8n, Coze or Langflow workflows behind IM bots
- **Multi platform bot hub**: one place to manage many bots, models and pipelines
- **Plugin driven automations**: extend bots with marketplace plugins and MCP tools

## Dependencies for LangBot Hosting

- **Postgres with pgvector**: included (migrations enable the vector extension)
- **Plugin Runtime**: included, private only
- **Model provider key**: added in the web UI after login, not needed to boot
- **IM platform credentials**: bot tokens or app keys for the platforms you connect

### Deployment Dependencies

- [LangBot GitHub repository](https://github.com/langbot-app/LangBot)
- [LangBot Docker deployment docs](https://docs.langbot.app/en/deploy/langbot/docker)
- [LangBot configuration reference](https://docs.langbot.app/en/deploy/settings)

### Implementation Details

LangBot reads any `SECTION__KEY` environment variable as an override of its `config.yaml`, which this template uses for every setting:

```env
LANGBOT_ADMIN_EMAIL=you@yourdomain.com
LANGBOT_ADMIN_PASSWORD=${{secret(24)}}
DATABASE__USE=postgresql
DATABASE__POSTGRESQL__URL=${{Postgres.DATABASE_URL}}
PLUGIN__RUNTIME_WS_URL=ws://${{Plugin Runtime.RAILWAY_PRIVATE_DOMAIN}}:5400/control/ws
LANGBOT_PLUGIN_RUNTIME_CONTROL_TOKEN=${{Plugin Runtime.LANGBOT_PLUGIN_RUNTIME_CONTROL_TOKEN}}
API__WEBHOOK_PREFIX=https://${{RAILWAY_PUBLIC_DOMAIN}}
BOX__ENABLED=false
MCP__STDIO__ENABLED=false
```

First steps after deploy: open the LangBot domain, sign in with `LANGBOT_ADMIN_EMAIL` and the generated `LANGBOT_ADMIN_PASSWORD` from the LangBot variables, change the password, add a model provider, then add a bot. Webhook callback URLs in the UI use your Railway domain. Keep `SYSTEM__RECOVERY_KEY` for the Forgot password flow.

The upstream Box sandbox is not included because it needs the host Docker socket. Shell and file agent tools and local stdio MCP servers are therefore off; HTTP and SSE MCP servers, skills, plugins and all IM adapters work. A Hobby plan is recommended for two Python services plus Postgres.

## Why Deploy LangBot on Railway?

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


## Similar templates

- [Telegram JavaScript Bot](https://railway.com/deploy/5lRkWa) — A template for Telegram bot in JavaScript using grammY
- [Cobalt Tools [Updated Oct ’26]](https://railway.com/deploy/cobalt) — Cobalt Tools [Oct ’26] (Media Downloader, Converter & Automation) Self Host
- [Telegram Gateway](https://railway.com/deploy/railway-telegram-gateway) — Multi-bot Telegram webhook gateway with WebSocket event streaming

Open this page in a browser: https://railway.com/deploy/langbot-im-bots-plugin-runtime-postgres
