How to Deploy OpenClaw on Railway
I find it frustrating when a promising tool requires hours of terminal work and complex server configuration just to get started. It often feels like the barrier to entry is higher than the actual utility of the software, especially when you just want to see it in action.
If you want to get OpenClaw running without touching a command line, Railway is the best path. You can manage the entire process through your browser using a one-click template and a built-in setup wizard.
What You’ll Need
Section titled “What You’ll Need”- A Railway account.
- A Telegram or Discord bot token.
Quick Start
Section titled “Quick Start”You can finish the initial deployment in about five minutes. This path runs the Gateway for you and lets you configure everything via a web interface.
- Click the Deploy on Railway button below.
- Add a Volume and mount it at
/data. - Set the required environment variables like
SETUP_PASSWORD. - Enable the HTTP Proxy on port
8080. - Open
https://<your-railway-domain>/setupto finish the wizard.
Required Railway Settings
Section titled “Required Railway Settings”To ensure the service runs correctly, you must apply these specific configurations in the Railway dashboard.
Public Networking and Port
Section titled “Public Networking and Port”Go to your service settings and enable the HTTP Proxy.
- Port:
8080
Persistent Volume
Section titled “Persistent Volume”You need a volume so your config and workspace data survive redeploys. Attach a volume mounted at:
/data
Environment Variables
Section titled “Environment Variables”Set these variables on the service to define how the application stores data and handles access:
SETUP_PASSWORD: Your admin password for the setup wizard.PORT:8080(This must match the port in Public Networking).OPENCLAW_STATE_DIR:/data/.openclawOPENCLAW_WORKSPACE_DIR:/data/workspaceOPENCLAW_GATEWAY_TOKEN: An admin secret for your gateway.
Domain Access
Section titled “Domain Access”After deployment, find your public URL in Railway → your service → Settings → Domains. Railway will provide a generated domain or use your custom domain if you have one attached.
Setup Flow
Section titled “Setup Flow”Once the service is live, follow these steps to finish the configuration:
- Visit
https://<your-railway-domain>/setupand enter yourSETUP_PASSWORD. - Choose a model or auth provider and enter your API key.
- Add your Telegram, Discord, Slack, or other platform tokens.
- Click Run setup.
If your Telegram DMs are set to pairing, the setup wizard can approve the pairing code for you during this process.
Getting Bot Tokens
Section titled “Getting Bot Tokens”Telegram Bot
Section titled “Telegram Bot”- Message
@BotFatherin Telegram. - Run the
/newbotcommand. - Copy the token (it looks like
123456789:AA...). - Paste it into the
/setuppage.
Discord Bot
Section titled “Discord Bot”- Go to the Discord Developer Portal.
- Create a New Application and select Bot to add a bot to the project.
- Copy the Bot Token and paste it into the
/setuppage. - Invite the bot to your server using the OAuth2 URL Generator with the
botandapplications.commandsscopes.
Troubleshooting
Section titled “Troubleshooting”If your Discord bot crashes immediately on startup, check your intent settings. You must enable MESSAGE CONTENT INTENT under Bot → Privileged Gateway Intents in the Discord Developer Portal. The bot will fail to start if this is disabled.
Backups and Migration
Section titled “Backups and Migration”You can download a backup at https://<your-railway-domain>/setup/export. This exports your OpenClaw state and your workspace so you can move to another host later without losing your configuration.
If you have questions about specific settings, use the AI Setup Assistant.
What’s Next
Section titled “What’s Next”OpenClaw Expert
Still stuck?
If this page didn't answer your case, ask OpenClaw Expert for step-by-step guidance.