๐ŸŽ Limited Offer

Deploy OpenClaw on Railway
Get $20 in Free Credits

Sign up through our link and receive $20 in Railway credits. Follow this step-by-step guide to get your OpenClaw agent live in under 10 minutes โ€” no CLI required.

Sign Up & Get $20 in Credits โ†’

Running an OpenClaw agent locally is great, but hosting it in the cloud means your assistant is always online, ready to handle tasks across Telegram, Discord, or Slack. Railway makes this incredibly simple with their 1-click deployment templates. You won't need to touch the terminal once.

๐Ÿ› ๏ธ What You Will Need

Before starting, gather these essentials:

A Railway Account

Upgrading to the Hobby plan ($5/month) is highly recommended. OpenClaw builds from source and usually needs 2GB+ of memory to avoid "Out of Memory" (OOM) errors during the build phase. Use our link below to get $20 in credits โ€” that covers your first 4 months.

An LLM API Key

Grab your API key for a modern model like Gemini 3, Claude Opus 4.5, or Codex 5.1.

A Messaging Token (Optional)

If you want your bot on Telegram, message @BotFather to generate a Bot Token.

Sign Up for Railway โ€” $20 Free Credits โ†’

Step 1: Deploy the 1-Click Template

We are using the community-standard OpenClaw template, which automatically provisions the Gateway, the Control UI, and persistent storage so your bot doesn't lose its memory when the server restarts.

  1. Navigate to the official Railway template: Deploy OpenClaw on Railway.
  2. Click the Deploy on Railway button.
Open Railway Template โ†’

Step 2: Configure Your Environment Variables

Railway will prompt you to set up a few vital environment variables before building the container.

Variable What It Does What to Enter
SETUP_PASSWORD Secures your web-based setup wizard. Create a strong, memorable password.
OPENCLAW_STATE_DIR Defines where to save persistent config data. Use the default: /data/.openclaw
OPENCLAW_WORKSPACE_DIR Defines where to save workspace files. Use the default: /data/workspace
๐Ÿ’ก Note: The template automatically attaches a Railway Volume mounted at /data to keep your bot's state intact across redeploys.

Click Deploy and give Railway about 3โ€“5 minutes to build the image.


Step 3: Generate Your Public Domain

Once the deployment shows a green "Success" badge, you need to expose your gateway to the web:

  1. Click on your OpenClaw service in the Railway dashboard.
  2. Navigate to Settings, then scroll down to Networking.
  3. Under Public Networking, click Generate Domain.
  4. Copy this newly generated URL (it will look something like your-app-xyz.up.railway.app).

Step 4: Access the Web Setup Wizard

Now we configure the actual brain of your agent.

  1. Open your browser and visit your new domain followed by /setup
    (e.g., https://your-app-xyz.up.railway.app/setup).
  2. A login prompt will appear. Leave the username blank, and enter the SETUP_PASSWORD you created in Step 2.

Step 5: Connect the Brain and the Channels

Inside the Setup Wizard, you will configure how your OpenClaw agent thinks and communicates:

  1. AI Provider: Select your provider, set the Auth Method to "API Key", and paste your model's API key.
  2. Messaging Connection: Scroll down to the "Optional: Channels" section and paste your token (like the Telegram token from the prerequisites) into the corresponding field.
  3. Run: Click "Run Setup" and wait about 30โ€“60 seconds for the wizard to write the configuration to your persistent volume.

Step 6: Connect to the Gateway UI

To monitor your agent and manage advanced skills:

  1. At the top of the setup page, click Open OpenClaw UI.
  2. In your Railway dashboard Variables tab, locate the auto-generated OPENCLAW_GATEWAY_TOKEN (it is a 64-character string) and copy it.
  3. In the OpenClaw UI, navigate to the Overview sidebar.
  4. Paste the OPENCLAW_GATEWAY_TOKEN into the gateway access field and click Connect.
  5. The status should turn to a green ๐ŸŸข Connected.

๐ŸŽ‰ You're Live!

Your self-hosted AI assistant is now running 24/7. Open your connected chat app, send your first message, and watch it respond!

Sign Up for Railway โ€” Get $20 in Free Credits โ†’

You'll receive $20 in credits when you sign up through our partner link above.

Affiliate disclosure: We may earn a commission when you sign up through our Railway link at no extra cost to you. Learn more