Deploy OpenClaw on Railway with a browser-first setup flow. No SSH required for onboarding.
IF YOU ARE UPGRADING FROM A PREVIOW VERSION REMOVE THE ENV VAR 'OPENCLAW_ENTRY' AS NOW OPENCLAW IS INSTALLED VIA NPM
This template exposes your OpenClaw gateway to the public internet.
- Review OpenClaw security guidance: https://docs.openclaw.ai/gateway/security
- Use a strong
SETUP_PASSWORD - If you only use chat channels, consider disabling public networking after setup
- OpenClaw Gateway + Control UI at
/and/openclaw - Setup Wizard at
/setup(Basic auth protected) - Optional browser TUI at
/tui - Persistent state on Railway volume (
/data) - Health endpoint at
/healthz - Diagnostics and logs via setup tools +
/logs
- Deploy this template to Railway.
- Ensure a volume is mounted at
/data. - Set variables:
SETUP_PASSWORD(required)OPENCLAW_STATE_DIR=/data/.openclawOPENCLAW_WORKSPACE_DIR=/data/workspace- Optional:
ENABLE_WEB_TUI=true
- Open
https://<your-domain>/setupand complete onboarding. - Open
https://<your-domain>/openclawfrom the setup page.
SETUP_PASSWORD: password for/setup
OPENCLAW_STATE_DIR=/data/.openclawOPENCLAW_WORKSPACE_DIR=/data/workspaceOPENCLAW_GATEWAY_TOKEN(stable token across redeploys)
PORT=8080INTERNAL_GATEWAY_PORT=18789INTERNAL_GATEWAY_HOST=127.0.0.1ENABLE_WEB_TUI=falseTUI_IDLE_TIMEOUT_MS=300000TUI_MAX_SESSION_MS=1800000
- Confirm
/setuploads and accepts password - Run onboarding once
- Verify
/healthzreturns{ "ok": true, ... } - Open
/openclawvia setup link - If using Telegram/Discord, approve pending devices from setup tools
- Message
@BotFather - Run
/newbot - Copy bot token (looks like
123456789:AA...) - Paste into setup wizard
- Create app in Discord Developer Portal
- Add bot + copy bot token
- Invite bot to server (
bot,applications.commandsscopes) - Enable required intents for your use case
Disabled by default. Set ENABLE_WEB_TUI=true to enable.
Built-in safeguards:
- Protected by
SETUP_PASSWORD - Single active session
- Idle timeout
- Max session duration
docker build -t openclaw-railway-template .
docker run --rm -p 8080:8080 \
-e PORT=8080 \
-e SETUP_PASSWORD=test \
-e OPENCLAW_STATE_DIR=/data/.openclaw \
-e OPENCLAW_WORKSPACE_DIR=/data/workspace \
-e ENABLE_WEB_TUI=true \
-v $(pwd)/.tmpdata:/data \
openclaw-railway-template- Setup:
http://localhost:8080/setup(password:test) - UI:
http://localhost:8080/openclaw - TUI:
http://localhost:8080/tui
- Open
/setupfirst, then click the OpenClaw UI link from there. - Approve pending devices in setup if pairing is required.
- Check
/healthz - Run doctor from setup (
openclaw doctor --repair) - Verify
/datavolume is mounted and writable
OPENCLAW_STATE_DIRorOPENCLAW_WORKSPACE_DIRis not on/data- Fix both vars and redeploy
- Set
ENABLE_WEB_TUI=true - Redeploy and reload
/setup
/setup- onboarding + management/openclaw- Control UI/healthz- public health/logs- live server logs UI
Need help? Open an issue or use Railway Station support for this template.