---
title: "Deploy OpenClaw"
description: "Self-hosted AI agent gateway: Control UI, chat apps, persistent volume"
category: "AI/ML"
url: https://railway.com/deploy/openclaw-9
---

# Deploy OpenClaw

Self-hosted AI agent gateway: Control UI, chat apps, persistent volume

**[Deploy OpenClaw on Railway](https://railway.com/template/openclaw-9)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/openclaw-9/manifest.json

- **Creator:** Agaz Self-Host
- **Category:** AI/ML

## Template content

### OpenClaw https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/openclaw.png

- **Source:** https://github.com/aalfath/openclaw-railway-template
- **Health check:** /healthz
- **Public domain:** Yes

## Documentation

# Deploy and Host OpenClaw on Railway

OpenClaw is an open-source (MIT) personal AI agent that you run yourself. Its gateway connects AI models from Anthropic, OpenAI, OpenRouter and other providers to a web Control UI and to chat apps such as Telegram, Discord, Slack and WhatsApp. The agent keeps memory, runs scheduled jobs and uses tools: shell, files, browser and GitHub.

## About Hosting OpenClaw

This template runs one OpenClaw gateway built from the official image (version 2026.11.3, pinned by digest) through a small public wrapper repo, so Railway can offer you updates. Config, credentials, SQLite state, sessions and the agent workspace live on a volume at `/data`, so they survive redeploys. A gateway token is generated at deploy, and every new browser also needs a one-time approval from the service shell. On each boot, OpenClaw's own doctor checks and migrates the state before the gateway starts. You add your AI provider and chat channels after the first login.

## Common Use Cases

* A personal assistant on Telegram, Discord, Slack or WhatsApp that keeps working when your laptop is closed
* Scheduled agent jobs: daily briefings, monitoring and reports delivered to chat
* One always-on gateway for the OpenClaw web, desktop and mobile apps

## Dependencies for OpenClaw Hosting

* An API key or account for an AI provider (Anthropic, OpenAI, OpenRouter, Google and others), added after deploy
* Optional: chat channel credentials, such as a Telegram bot token from @BotFather

### Deployment Dependencies

* [OpenClaw on GitHub](https://github.com/openclaw/openclaw) and its [releases](https://github.com/openclaw/openclaw/releases)
* [OpenClaw documentation](https://docs.openclaw.ai/) and [security guide](https://docs.openclaw.ai/gateway/security)
* [Template source and changelog](https://github.com/aalfath/openclaw-railway-template)

### Implementation Details

**First login**

1. Open the service's Railway domain. Paste `OPENCLAW_GATEWAY_TOKEN` (service, then Variables) into **Gateway secret** and click **Connect**.
2. The page shows **Approve this browser** with a command like `openclaw devices approve REQUEST-ID`.
3. Open the service shell (`railway ssh`, or right-click the service and choose SSH) and run that command. The page connects by itself.

**Connect a model:** in the Control UI, open **Settings, then Models, then Connect provider**, or run `openclaw onboard` in the shell. Add chat apps under **Settings, then Channels**.

**Custom domain:** add it in Railway, set the variable `OPENCLAW_PUBLIC_ORIGIN` to `https://YOUR-DOMAIN` and redeploy.

**Updates:** new OpenClaw versions arrive as template updates, listed in the repo's CHANGELOG. Back up first with `openclaw backup create` in the shell.

**Notes**

* Give the service 2 GB of memory (Hobby plan or higher). The gateway uses about 1 to 1.3 GB.
* The gateway runs as an unprivileged user, and `openclaw` in the shell does too. The agent's shell and file tools run inside this container, with `/data/workspace` as their workspace.
* The token is an admin credential for an agent that can run commands. Keep it secret; to rotate it, change the variable and redeploy.
* Keep one replica: one gateway per volume.

## 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.



## Similar templates

- [Chat Chat](https://railway.com/deploy/-WWW5r) — Chat Chat, your own unified chat and search to AI platform.
- [Weaviate](https://railway.com/deploy/weaviate-1) — Vector database with hybrid search and an API key-protected API
- [Möbius Personal AI OS](https://railway.com/deploy/mobius-v01-personal-ai-os) — Self-hosted AI agent that builds and runs apps for you, with memory.

Open this page in a browser: https://railway.com/deploy/openclaw-9
