Skip to content

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.

  • A Railway account.
  • A Telegram or Discord bot token.

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.

  1. Click the Deploy on Railway button below.
  2. Add a Volume and mount it at /data.
  3. Set the required environment variables like SETUP_PASSWORD.
  4. Enable the HTTP Proxy on port 8080.
  5. Open https://<your-railway-domain>/setup to finish the wizard.

Deploy on Railway

To ensure the service runs correctly, you must apply these specific configurations in the Railway dashboard.

Go to your service settings and enable the HTTP Proxy.

  • Port: 8080

You need a volume so your config and workspace data survive redeploys. Attach a volume mounted at:

  • /data

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/.openclaw
  • OPENCLAW_WORKSPACE_DIR: /data/workspace
  • OPENCLAW_GATEWAY_TOKEN: An admin secret for your gateway.

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.

Once the service is live, follow these steps to finish the configuration:

  1. Visit https://<your-railway-domain>/setup and enter your SETUP_PASSWORD.
  2. Choose a model or auth provider and enter your API key.
  3. Add your Telegram, Discord, Slack, or other platform tokens.
  4. Click Run setup.

If your Telegram DMs are set to pairing, the setup wizard can approve the pairing code for you during this process.

  1. Message @BotFather in Telegram.
  2. Run the /newbot command.
  3. Copy the token (it looks like 123456789:AA...).
  4. Paste it into the /setup page.
  1. Go to the Discord Developer Portal.
  2. Create a New Application and select Bot to add a bot to the project.
  3. Copy the Bot Token and paste it into the /setup page.
  4. Invite the bot to your server using the OAuth2 URL Generator with the bot and applications.commands scopes.

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.

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.

OpenClaw

OpenClaw Expert

Still stuck?

If this page didn't answer your case, ask OpenClaw Expert for step-by-step guidance.