Run an always-on AI agent on Telegram or Discord

By Tracklayer · Updated 2026-11-20

Short answer: deploy an agent gateway that runs continuously on Railway and holds outbound connections to your chat apps. Tracklayer’s Hermes Agent template runs Hermes Agent v0.21.7 from Nous Research, so you can message it on Telegram, Discord or Slack, or chat in the browser. Memory, skills and schedules persist on a volume. You supply an LLM provider key, and the provider bills model usage.

Deploy Hermes Agent on Railway

When to host an agent yourself

A chat assistant on your laptop stops when the laptop sleeps. A hosted gateway stays reachable. The template’s README lists these uses:

AI agent templates people deploy on Railway

TemplateCreatorDeploymentsServices
LibreChatLibreChat6,7625
Hermes Agent by Nous Researchlovexbytes's Projects6,4131
OpenClawTechulus5,1671
Hermes AgentHeimdall4,0921
BytebotBytebot3,4404
OpenClaw - Railway TemplateCodetitlan2,5081
AnythingLLMTimothy Carambat's Projects1,9721
HermesHeimdall1,8811

Railway marketplace data as of 2026-11-19. Full ranking: Best AI agent templates on Railway.

Names rarely show which version is pinned, how the interface is protected or whether state sits on a volume. Open each template page and check.

Deploy Hermes Agent, step by step

These steps use Tracklayer’s Hermes Agent template.

  1. Deploy the template and enter your LLM provider key when asked. It creates two services: Hermes, which runs the gateway, the official dashboard, Hermes WebUI and a headless Chromium, and a small Caddy proxy that gives the WebUI its own HTTPS address.
  2. Open the dashboard. Go to the Hermes service URL and sign in as admin with HERMES_DASHBOARD_BASIC_AUTH_PASSWORD from Variables. Choose your default model. The stock default is a premium model, so pick one that fits your budget.
  3. Open web chat. Go to the Hermes WebUI service URL and enter HERMES_WEBUI_PASSWORD. Allow about a minute after a deploy. On a phone, use Add to Home Screen.
  4. Connect Telegram, Discord or Slack. Add a bot token at deploy time, or later under Channels in the dashboard. For Telegram, BotFather issues the token.
  5. Message your bot. Unknown users get a pairing code that you approve on the Pairing page, or you can pre-approve IDs with TELEGRAM_ALLOWED_USERS.
  6. Add providers and schedules. Use API Keys for more providers and Cron for scheduled jobs.

Persistence

A Railway volume at /opt/data holds config, sessions, memory, skills, WebUI state and the agent’s workspace. Redeploys keep it. Both web interfaces and the bot share the same memory, skills and sessions, so a conversation started on Telegram appears in the WebUI sidebar.

Cost

Railway bills usage, and Hermes is the main consumer. The template’s resource figures are estimates, not measurements; the README does not claim to have measured the WebUI process.

Model usage is billed by your LLM provider, and that can exceed the Railway bill if you use a premium model.

Security notes

Scaling and upgrades

Keep one replica and scale vertically. For separate personas, use Hermes profiles inside the same service. To upgrade, change the pinned images in services/hermes/Dockerfile and services/webui-proxy/Dockerfile, and move Hermes Agent and Hermes WebUI together to versions released close to each other. If the release notes say so, run hermes config migrate through railway ssh. Do not run hermes update inside the container.

Other options

OpenClaw (Clawdbot) is another open-source agent platform with a gateway and Control UI. Its template deploys one service with a password-protected setup wizard at /setup where you enter model credentials and channel tokens for Telegram, Discord or Slack. State is stored on a volume at /data. The template’s listing gives no version, licence or resource figures, so check the OpenClaw documentation and the template’s repository before relying on it, and check the service variables for the setup password.

For the full ranking, see AI agent templates on Railway.

FAQ

What do I need before deploying Hermes Agent?

A Railway account and an LLM provider key. The template asks for an OpenRouter key, and other providers such as Anthropic or OpenAI can be added later. A bot token for Telegram, Discord or Slack is optional at deploy time, because you can add it later in the dashboard, and the browser chat works without one. Model usage is billed by your provider, not by Railway.

How do I log in to Hermes?

For the dashboard, open the Hermes service URL and sign in as admin with HERMES_DASHBOARD_BASIC_AUTH_PASSWORD from the Hermes service's Variables tab. For web chat, open the Hermes WebUI service URL and use HERMES_WEBUI_PASSWORD, found on the same Variables tab. The WebUI needs about a minute after each deploy.

How do I stop strangers from using my bot?

Unknown users who message the bot receive a pairing code, which you approve on the dashboard's Pairing page. To skip pairing for people you trust, set TELEGRAM_ALLOWED_USERS (or the Discord or Slack equivalent) with their IDs.

How much does it cost on Railway?

The template's own estimate, not a measurement, is about $11 per month idle and about $22 to $24 per month in typical use, based on Railway's list prices. It lists Hobby as the minimum plan. Your LLM provider bills separately, and the stock default model is a premium one, so choose a model that fits your budget.

Is my agent's memory kept across redeploys?

Yes. Config, sessions, memory and skills live on a Railway volume at /opt/data. Hermes is a single-writer process, so run one replica and never point two gateways at one data directory.