---
title: "Deploy OpenClaw — Private AI Agent"
description: "Self-host OpenClaw: private AI agent for ~$1/month. No ChatGPT subscription"
category: "AI/ML"
url: https://railway.com/deploy/openclaw-private-agent
---

# Deploy OpenClaw — Private AI Agent

Self-host OpenClaw: private AI agent for ~$1/month. No ChatGPT subscription

**[Deploy OpenClaw — Private AI Agent on Railway](https://railway.com/template/openclaw-private-agent)**

- **Creator:** SilverBanana
- **Category:** AI/ML
- **Total deploys:** 9

## Template content

### Openclaw https://d1dm0o5huagnd6.cloudfront.net/static/openclaw.jpeg

- **Source:** sahilrupani/openclaw-railway-template
- **Public domain:** Yes

## Documentation

# Deploy and Host OpenClaw on Railway

![OpenClaw AI Agent](https://opengraph.githubassets.com/027231e34679f13d043884e2d69bd69e052e500e3bf7b5b03c72101eda21b724/openclaw/openclaw)

OpenClaw (formerly Clawdbot and Moltbot) is the open-source AI agent with 328k+ GitHub stars
that goes beyond chat — it browses the web, manages files, runs commands, handles email, and
works autonomously on your behalf, accessible from WhatsApp, Telegram, Discord, Slack, iMessage,
and 20+ other messaging platforms.

**Self-host a personal AI agent for ~$1–3/month** — compared to $20/month for ChatGPT Plus,
$20/month for Claude Pro, or Manus AI which is cloud-only with no self-host option. Full data
ownership. No usage caps. No subscription.

---

## What This Template Deploys

| Service | Purpose |
|---|---|
| **OpenClaw Gateway** | Core agent runtime — LLM routing, channel connections, autonomous task execution, and Control UI at `/openclaw` |
| **Persistent Volume (5 GB)** | Railway volume at `/data` — config, credentials, memory, and workspace files survive every redeploy |

No database. No Redis. No inter-service networking. State lives entirely on the persistent
volume — the simplest production OpenClaw stack on Railway.

---

## About Hosting OpenClaw

Running OpenClaw in production means keeping a persistent Node.js gateway alive 24/7, managing
secure credentials for your LLM provider and messaging platforms, handling HTTPS termination, and
ensuring config and memory survive redeploys. Without a managed host, you're looking at VPS
setup, Nginx config, SSL certificates, process managers, and manual Docker maintenance.

Railway handles all of it. This template mounts a **5 GB persistent volume** at `/data`,
provisions the gateway with automatic HTTPS, and injects secrets as environment variables.
OpenClaw's memory, channel auth, and workspace survive every redeploy without manual
intervention. The browser-based `/setup` wizard configures everything after deploy — no SSH,
no terminal, no config files.

Typical cost: **~$1–3/month** on Railway's Hobby plan. ChatGPT Plus costs $20/month. Claude
Pro costs $20/month. Manus AI is cloud-only with no self-host option. OpenClaw on Railway
gives you an autonomous AI agent at a fraction of the cost with full data ownership.

---

## Deploy in Under 5 Minutes

1. Click **Deploy on Railway** and let the initial build complete (~3–5 minutes)
2. Open your Railway URL and complete the `/setup` wizard — pick your AI provider and paste
   your API key
3. Optionally connect a messaging channel — Telegram bot token, Discord bot token, or Slack app
4. Start chatting from your browser or messaging app

No SSH. No command line. No server administration.

![OpenClaw setup wizard — configure your AI provider and messaging channels](https://res.cloudinary.com/asset-cloudinary/image/upload/v1774088297/openclaw_setup_page_rxowv8.png)

---

## Common Use Cases

- **Self-hosted alternative to ChatGPT Plus and Claude Pro** — your conversations stay on your
  Railway instance, not OpenAI or Anthropic servers; swap providers freely without losing
  memory or configuration
- **Self-hosted alternative to Manus AI** — get autonomous agent capability on infrastructure
  you control without a cloud-only dependency or third-party data exposure
- **Personal AI assistant via WhatsApp or Telegram** — message your agent to browse the web,
  summarize documents, draft emails, or run scheduled tasks from any messaging app you use
- **Autonomous task scheduling** — configure the heartbeat daemon to run recurring tasks (daily
  briefings, price monitoring, data pipelines) on a schedule without manual prompting
- **Multi-platform bot** — connect one agent to Telegram, Discord, and Slack simultaneously
  with shared memory and session context across all channels
- **Private LLM switching** — test Anthropic, OpenAI, Gemini, and OpenRouter behind a
  consistent interface without reconfiguring your setup each time you switch providers

---

## Configuration

| Variable | Required | Description |
|---|---|---|
| `ANTHROPIC_API_KEY` | Recommended | API key for Anthropic Claude — best results for autonomous tasks and long-context reasoning |
| `OPENAI_API_KEY` | Alternative | API key for OpenAI GPT models |
| `GEMINI_API_KEY` | Alternative | API key for Google Gemini |
| `OPENROUTER_API_KEY` | Alternative | Single key for multiple providers — useful for fallback routing |
| `SETUP_PASSWORD` | Recommended | Protects the `/setup` wizard — set before sharing your Railway URL |
| `OPENCLAW_GATEWAY_TOKEN` | Auto-generated | Secure UI-to-gateway token — generated at deploy time |
| `TELEGRAM_BOT_TOKEN` | Optional | From BotFather — enables Telegram channel |
| `DISCORD_BOT_TOKEN` | Optional | From Discord Developer Portal — enables Discord channel |
| `SLACK_BOT_TOKEN` | Optional | From Slack API — enables Slack channel |
| `OPENCLAW_STATE_DIR` | Pre-set | Defaults to `/data/.openclaw` — do not change unless migrating |
| `OPENCLAW_VERSION` | Optional | Pin to a specific release e.g. `v2026.2.16` — omit for latest |

> `PORT` is injected automatically by Railway. Do not set it manually.

You only need **one API key** to get started. Everything else is configurable through the
`/setup` wizard after deploy.

---

## OpenClaw vs. Alternatives

| | OpenClaw (self-hosted) | ChatGPT Plus | Claude Pro | Manus AI |
|---|---|---|---|---|
| **Monthly cost** | ~$1–3 (Railway) | $20/month | $20/month | Cloud-only |
| **Self-hostable** | ✅ Yes | ❌ No | ❌ No | ❌ No |
| **Data ownership** | ✅ Your instance | ❌ OpenAI servers | ❌ Anthropic servers | ❌ Cloud servers |
| **Usage caps** | ✅ None | ❌ Rate limited | ❌ Rate limited | ❌ Yes |
| **LLM provider choice** | ✅ Any provider | ❌ OpenAI only | ❌ Anthropic only | ❌ Fixed |
| **Messaging platforms** | ✅ 20+ platforms | ❌ Web only | ❌ Web only | ❌ Web only |
| **Autonomous scheduling** | ✅ Heartbeat daemon | ❌ No | ❌ No | ✅ Limited |
| **Open source** | ✅ Yes | ❌ No | ❌ No | ❌ No |

---

## Dependencies for OpenClaw Hosting

- API key from at least one LLM provider — Anthropic Claude recommended
- Railway account (Hobby plan — ~$5/month base, template itself ~$1–3/month)
- Optional: bot tokens for Telegram, Discord, or Slack

### Deployment Dependencies

- [Official OpenClaw GitHub Repository](https://github.com/openclaw-ai/openclaw)
- [OpenClaw Documentation](https://docs.openclaw.ai/)
- [Railway Volumes Documentation](https://docs.railway.com/volumes)
- [Anthropic API Keys](https://console.anthropic.com/)
- [Telegram BotFather](https://t.me/BotFather)
- [Discord Developer Portal](https://discord.com/developers/applications)

### Implementation Details

This template deploys OpenClaw's gateway as a persistent container with a **5 GB Railway
volume** at `/data` — larger than most competing OpenClaw templates on Railway. All agent
state lives on the volume: LLM provider config, channel auth tokens, persistent memory, and
workspace files. The container is fully stateless — redeploy, version update, or restart
without losing anything.

The gateway exposes a Control UI at `/openclaw` and a setup wizard at `/setup`, both
protected by token-based authentication. No database or Redis instance required — all state
is filesystem-based on the persistent volume, keeping the stack simple and the cost low.

---

## Frequently Asked Questions

**Is OpenClaw the same as Clawdbot or Moltbot?**
Yes. OpenClaw was previously known as Clawdbot and before that as Moltbot. The project was
rebranded to OpenClaw — same team, same codebase, continued development. Existing Clawdbot
or Moltbot users can migrate data by moving the `/data` volume contents to the new instance.

**How much does OpenClaw cost on Railway vs ChatGPT or Claude?**
The Railway container costs ~$1–3/month on the Hobby plan. ChatGPT Plus is $20/month with
rate limits. Claude Pro is $20/month with usage caps. LLM API costs are separate and depend
on usage — Claude Haiku or GPT-4o-mini keep inference costs low for personal use.

**What makes this template different from other OpenClaw Railway templates?**
This template ships with a **5 GB persistent volume** — larger than the standard 1–2 GB most
competing templates configure. The `/setup` wizard handles all channel configuration,
provider selection, and credential management in the browser. No SSH, no config files,
no token generation required.

**Is my data private?**
Yes. OpenClaw is fully self-hosted. Conversations stay on your Railway instance. API keys
are stored as encrypted Railway environment variables. No data is sent to third-party
analytics services.

**Do I lose config and memory when Railway redeploys?**
No. All state is stored on the persistent volume at `/data`, not inside the container.
Redeploys, version updates, and restarts do not affect your data.

**How do I update OpenClaw to a newer version?**
Set `OPENCLAW_VERSION` to the target release (e.g. `v2026.2.16`) in Railway Variables and
redeploy. Omit it or set to `latest` to always pull the newest release on each deploy.

---

## Why Deploy and Host 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.

At ~$1–3/month, OpenClaw on Railway is the cheapest persistent AI agent stack available —
own your data, control your LLM provider, and run 24/7 autonomous tasks without a
subscription or usage cap.

## Similar templates

- [Chat Chat](https://railway.com/deploy/-WWW5r) — Chat Chat, your own unified chat and search to AI platform.
- [stella](https://railway.com/deploy/stella) — Self-host stella with web, API, Postgres, Redis, and object storage.
- [Hermes Agent | OpenClaw Alternative with Dashboard](https://railway.com/deploy/hermes-agent-or-openclaw-alternative-wit) — Self-Hosted Hermes AI Agent for Telegram, Discord & Slack

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