
Deploy Deploy and Host OpenClaw on Railway
Self-host OpenClaw: private AI agent for ~$1/month. No ChatGPT subscription
Openclaw Main
Just deployed
/data
Deploy and Host OpenClaw on Railway
OpenClaw (formerly Clawdbot and Moltbot) is the open-source AI agent with 328k+ GitHub stars that goes beyond chat — it browses the web, manages files, runs commands, handles email, and works autonomously on your behalf, accessible from WhatsApp, Telegram, Discord, Slack, iMessage, and 20+ other messaging platforms.
Self-host a personal AI agent for ~$1–3/month — compared to $20/month for ChatGPT Plus, $20/month for Claude Pro, or Manus AI which is cloud-only with no self-host option. Full data ownership. No usage caps. No subscription.
What This Template Deploys
| Service | Purpose |
|---|---|
| OpenClaw Gateway | Core agent runtime — LLM routing, channel connections, autonomous task execution, and Control UI at /openclaw |
| Persistent Volume (5 GB) | Railway volume at /data — config, credentials, memory, and workspace files survive every redeploy |
No database. No Redis. No inter-service networking. State lives entirely on the persistent volume — the simplest production OpenClaw stack on Railway.
About Hosting OpenClaw
Running OpenClaw in production means keeping a persistent Node.js gateway alive 24/7, managing secure credentials for your LLM provider and messaging platforms, handling HTTPS termination, and ensuring config and memory survive redeploys. Without a managed host, you're looking at VPS setup, Nginx config, SSL certificates, process managers, and manual Docker maintenance.
Railway handles all of it. This template mounts a 5 GB persistent volume at /data,
provisions the gateway with automatic HTTPS, and injects secrets as environment variables.
OpenClaw's memory, channel auth, and workspace survive every redeploy without manual
intervention. The browser-based /setup wizard configures everything after deploy — no SSH,
no terminal, no config files.
Typical cost: ~$1–3/month on Railway's Hobby plan. ChatGPT Plus costs $20/month. Claude Pro costs $20/month. Manus AI is cloud-only with no self-host option. OpenClaw on Railway gives you an autonomous AI agent at a fraction of the cost with full data ownership.
Deploy in Under 5 Minutes
- Click Deploy on Railway and let the initial build complete (~3–5 minutes)
- Open your Railway URL and complete the
/setupwizard — pick your AI provider and paste your API key - Optionally connect a messaging channel — Telegram bot token, Discord bot token, or Slack app
- Start chatting from your browser or messaging app
No SSH. No command line. No server administration.

Common Use Cases
- Self-hosted alternative to ChatGPT Plus and Claude Pro — your conversations stay on your Railway instance, not OpenAI or Anthropic servers; swap providers freely without losing memory or configuration
- Self-hosted alternative to Manus AI — get autonomous agent capability on infrastructure you control without a cloud-only dependency or third-party data exposure
- Personal AI assistant via WhatsApp or Telegram — message your agent to browse the web, summarize documents, draft emails, or run scheduled tasks from any messaging app you use
- Autonomous task scheduling — configure the heartbeat daemon to run recurring tasks (daily briefings, price monitoring, data pipelines) on a schedule without manual prompting
- Multi-platform bot — connect one agent to Telegram, Discord, and Slack simultaneously with shared memory and session context across all channels
- Private LLM switching — test Anthropic, OpenAI, Gemini, and OpenRouter behind a consistent interface without reconfiguring your setup each time you switch providers
Configuration
| Variable | Required | Description |
|---|---|---|
ANTHROPIC_API_KEY | Recommended | API key for Anthropic Claude — best results for autonomous tasks and long-context reasoning |
OPENAI_API_KEY | Alternative | API key for OpenAI GPT models |
GEMINI_API_KEY | Alternative | API key for Google Gemini |
OPENROUTER_API_KEY | Alternative | Single key for multiple providers — useful for fallback routing |
SETUP_PASSWORD | Recommended | Protects the /setup wizard — set before sharing your Railway URL |
OPENCLAW_GATEWAY_TOKEN | Auto-generated | Secure UI-to-gateway token — generated at deploy time |
TELEGRAM_BOT_TOKEN | Optional | From BotFather — enables Telegram channel |
DISCORD_BOT_TOKEN | Optional | From Discord Developer Portal — enables Discord channel |
SLACK_BOT_TOKEN | Optional | From Slack API — enables Slack channel |
OPENCLAW_STATE_DIR | Pre-set | Defaults to /data/.openclaw — do not change unless migrating |
OPENCLAW_VERSION | Optional | Pin to a specific release e.g. v2026.2.16 — omit for latest |
PORTis injected automatically by Railway. Do not set it manually.
You only need one API key to get started. Everything else is configurable through the
/setup wizard after deploy.
OpenClaw vs. Alternatives
| OpenClaw (self-hosted) | ChatGPT Plus | Claude Pro | Manus AI | |
|---|---|---|---|---|
| Monthly cost | ~$1–3 (Railway) | $20/month | $20/month | Cloud-only |
| Self-hostable | ✅ Yes | ❌ No | ❌ No | ❌ No |
| Data ownership | ✅ Your instance | ❌ OpenAI servers | ❌ Anthropic servers | ❌ Cloud servers |
| Usage caps | ✅ None | ❌ Rate limited | ❌ Rate limited | ❌ Yes |
| LLM provider choice | ✅ Any provider | ❌ OpenAI only | ❌ Anthropic only | ❌ Fixed |
| Messaging platforms | ✅ 20+ platforms | ❌ Web only | ❌ Web only | ❌ Web only |
| Autonomous scheduling | ✅ Heartbeat daemon | ❌ No | ❌ No | ✅ Limited |
| Open source | ✅ Yes | ❌ No | ❌ No | ❌ No |
Dependencies for OpenClaw Hosting
- API key from at least one LLM provider — Anthropic Claude recommended
- Railway account (Hobby plan — ~$5/month base, template itself ~$1–3/month)
- Optional: bot tokens for Telegram, Discord, or Slack
Deployment Dependencies
- Official OpenClaw GitHub Repository
- OpenClaw Documentation
- Railway Volumes Documentation
- Anthropic API Keys
- Telegram BotFather
- Discord Developer Portal
Implementation Details
This template deploys OpenClaw's gateway as a persistent container with a 5 GB Railway
volume at /data — larger than most competing OpenClaw templates on Railway. All agent
state lives on the volume: LLM provider config, channel auth tokens, persistent memory, and
workspace files. The container is fully stateless — redeploy, version update, or restart
without losing anything.
The gateway exposes a Control UI at /openclaw and a setup wizard at /setup, both
protected by token-based authentication. No database or Redis instance required — all state
is filesystem-based on the persistent volume, keeping the stack simple and the cost low.
Frequently Asked Questions
Is OpenClaw the same as Clawdbot or Moltbot?
Yes. OpenClaw was previously known as Clawdbot and before that as Moltbot. The project was
rebranded to OpenClaw — same team, same codebase, continued development. Existing Clawdbot
or Moltbot users can migrate data by moving the /data volume contents to the new instance.
How much does OpenClaw cost on Railway vs ChatGPT or Claude? The Railway container costs ~$1–3/month on the Hobby plan. ChatGPT Plus is $20/month with rate limits. Claude Pro is $20/month with usage caps. LLM API costs are separate and depend on usage — Claude Haiku or GPT-4o-mini keep inference costs low for personal use.
What makes this template different from other OpenClaw Railway templates?
This template ships with a 5 GB persistent volume — larger than the standard 1–2 GB most
competing templates configure. The /setup wizard handles all channel configuration,
provider selection, and credential management in the browser. No SSH, no config files,
no token generation required.
Is my data private? Yes. OpenClaw is fully self-hosted. Conversations stay on your Railway instance. API keys are stored as encrypted Railway environment variables. No data is sent to third-party analytics services.
Do I lose config and memory when Railway redeploys?
No. All state is stored on the persistent volume at /data, not inside the container.
Redeploys, version updates, and restarts do not affect your data.
How do I update OpenClaw to a newer version?
Set OPENCLAW_VERSION to the target release (e.g. v2026.2.16) in Railway Variables and
redeploy. Omit it or set to latest to always pull the newest release on each deploy.
Why Deploy and Host OpenClaw 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.
At ~$1–3/month, OpenClaw on Railway is the cheapest persistent AI agent stack available — own your data, control your LLM provider, and run 24/7 autonomous tasks without a subscription or usage cap.
Template Content
Openclaw Main
sahilrupani/openclaw-railway-templateSETUP_PASSWORD
Password for the setup (no username required)
