Deploy OpenClaw [Jun'26]
Self-hosted AI assistant. Runs on Telegram, WhatsApp, Slack, Discord
openclaw-railway-template
Just deployed
/data
Deploy and Host OpenClaw on Railway
OpenClaw is an open-source, self-hosted personal AI assistant that connects to the chat apps you already use — Telegram, WhatsApp, Slack, Discord, and more. It runs your own AI agent on your own infrastructure, keeping your data private and under your control.
About Hosting OpenClaw
Hosting OpenClaw on Railway involves running the OpenClaw gateway inside a Docker container alongside a lightweight setup wizard for configuration. The gateway acts as a bridge between your chosen AI provider (Anthropic, OpenAI, or Gemini) and your connected chat channels. Railway handles SSL, networking, and uptime automatically. All configuration, credentials, and workspace files are persisted to a Railway Volume mounted at /data, so nothing is lost between redeploys. After deployment, you configure your AI provider and onboard channels through a password-protected web UI — no command line required.
Common Use Cases
- Personal AI assistant: Connect OpenClaw to WhatsApp or Telegram and chat with your AI model from your phone, on channels you already use daily.
- Team bot: Hook OpenClaw into Slack or Discord to give your team a shared AI assistant with persistent context and workspace files.
- Private AI deployment: Self-host your AI agent so API keys and conversation data never pass through third-party servers.
Dependencies for OpenClaw Hosting
- Railway Volume — mounted at
/data(minimum 5 GB recommended) for persisting OpenClaw config, credentials, and workspace files across redeploys - AI Provider API Key — from Anthropic, OpenAI, Google Gemini, or any OpenAI-compatible endpoint; configured after deployment via the
/setupwizard
Deployment Dependencies
Implementation Details
The template wraps the official openclaw npm package with a small Express server that:
- Spawns the OpenClaw gateway on an internal port (
18789) - Serves a password-protected setup wizard at
/setup - Proxies all other traffic (including WebSockets) to the gateway
- Exposes a health check at
/healthzfor Railway's health monitoring
Key environment variables:
SETUP_PASSWORD=your-secure-password # protects the /setup wizard
OPENCLAW_GATEWAY_TOKEN= # stable admin token for the gateway
OPENCLAW_STATE_DIR=/data/.openclaw # persisted config directory
OPENCLAW_WORKSPACE_DIR=/data/workspace # persisted workspace directory
After deployment, visit https://.up.railway.app/setup to configure your AI provider and onboard your first channel.
Why Deploy 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.
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.
Template Content
openclaw-railway-template
Amritasha/openclaw-railway-templateSETUP_PASSWORD
Generate: openssl rand -base64 18
OPENCLAW_GATEWAY_TOKEN
Generate: openssl rand -hex 32
