
Deploy OpenClaw Claude
Run OpenClaw on Claude with your Anthropic API key
Just deployed
/data
Deploy and Host self hosted OpenClaw Claude (Self-Hosted AI Assistant on Anthropic Claude) on Railway
This template runs a self-hosted OpenClaw gateway wired to Anthropic Claude models, using your own Anthropic API key with usage billing.
About Hosting OpenClaw Claude open-source software on Railway (self hosted OpenClaw on Anthropic Claude template)
OpenClaw is MIT licensed, so the gateway, sessions, and channel plumbing are code you can read and change, and the state it keeps lives on a volume you control.
Why Deploy OpenClaw Claude, the Claude.ai alternative on Railway (Railway Free Trial)
Claude.ai is easier if you just want to chat with Claude in a browser. Railway's $5 free trial is enough to test it before you commit.
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 Claude 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.
Railway vs Other Hosting Providers and VPS for OpenClaw Claude self hosting
An always-on OpenClaw box needs a host, and the choice is how much setup you want to own.
| Provider | What You Get with Railway | What You Get with the Other Provider |
|---|---|---|
| DigitalOcean | A deploy from this template with the gateway, volume, and token wired up, plus HTTPS. | A Droplet you manage, with the install script, Caddy, and firewall all on you. |
| AWS | One service with a persistent volume and env vars set in the dashboard. | EC2, EBS, and networking to configure before OpenClaw answers. |
| Hetzner | A managed deploy that handles the container, restarts, and proxy trust. | Low compute prices, with you handling OS updates and keeping the gateway up. |
Railway trades a little raw price for less setup and fewer things to babysit.
Common Use Cases for hosted OpenClaw Claude
- Always-on Telegram or Slack assistant: Connect a chat channel to the gateway and message your Claude assistant from your phone, even with your laptop closed.
- Haiku 5.5 for quick replies, a bigger model for long work: Set anthropic/claude-haiku-5-5 as the fast default, then switch to a larger Claude model for research or multi-step tasks.
- Browser automation driven by Claude: Use the browser-enabled image so Claude can open pages, fill forms, and pull data on the server.
- Keeping the key on the server: Store ANTHROPIC_API_KEY as a Railway variable so it never sits in a dotfile on your laptop. Rotating it means changing one value and redeploying.
- Cost tracking per session: OpenClaw shows usage per session, so you can spot a runaway loop before it hits the Anthropic invoice.
Dependencies for OpenClaw Claude Docker hosted on Railway
This section lists what the OpenClaw Claude template needs before it can answer you: one service, one volume, and one Anthropic API key.
Deployment Dependencies for Managed OpenClaw Claude Service (Claude Model Provider)
The template runs as one Railway service built from the official OpenClaw Docker image.
For the model layer, set ANTHROPIC_API_KEY on the service. The API key route bills by usage and suits an always-on server.
Implementation Details for OpenClaw Claude (Using OpenClaw official docker image)
The start command fixes volume ownership, applies OPENCLAW_RAILWAY_CONFIG, then runs openclaw gateway --bind lan --port 18789 --allow-unconfigured as the node user.
How does OpenClaw Claude compare against other ways to run a personal assistant on Claude
OpenClaw vs Claude.ai (Anthropic's Hosted App)
- Where OpenClaw wins: It runs on your own server and reaches you through chat channels like Telegram, Slack, and Discord.
- Where OpenClaw wins: Tools and browser automation run on your box, so the assistant can act on things rather than only answer questions.
- Where Claude.ai wins: Nothing to deploy or maintain. Sign in and it works, with no gateway token or volume to manage.
OpenClaw vs Hermes Agent (Another Self-Hosted Agent)
- Where OpenClaw wins: The gateway is built around channels, sessions, and a Control UI, which suits one always-on assistant with several chat surfaces.
- Where Hermes Agent wins: If its agent design or workflow fits your habits better, it may be the right pick. Try both on a small task first.
- Honest note: Both can use Claude as the model, so the real difference is the agent architecture and tooling, not the model layer.
OpenClaw vs Open WebUI (Self-Hosted Chat UI)
- Where Open WebUI wins: It is a chat interface first, so a clean web chat over several models is simpler to set up.
- Where OpenClaw wins: It keeps working when you are away from the browser, because messages from chat apps flow into the same session.
API Key vs Claude CLI Login (Two Anthropic Auth Routes)
- API key route: Set ANTHROPIC_API_KEY on the Railway service and OpenClaw bills usage directly to your Anthropic account. The key is just an environment variable, which suits a server.
- Claude CLI route: Reuses a Claude Code login through the claude executable on the same host. It needs the executable inside the container and an interactive login, which is awkward on Railway.
- Practical take: On Railway the API key route is the simplest and most predictable, and the model picker labels each route so you can tell which one you are using.
How to use OpenClaw Claude (the OSS personal AI assistant)?
Here's the first-day path after deploy. Go in order, since the Control UI won't connect until the key and token are set.
- Create an API key in the Anthropic Console and set a monthly spend limit, because usage is billed per token.
- On the OpenClaw service, add
ANTHROPIC_API_KEYwith that key and redeploy. The template ships it empty. - Open the Control UI on your Railway domain and paste
OPENCLAW_GATEWAY_TOKEN. Approve the browser device once withopenclaw devices approvein the service shell. - Set an
anthropic/model as the default. A small one likeanthropic/claude-haiku-5-5suits quick replies:
{
"agents": {
"defaults": {
"model": { "primary": "anthropic/claude-haiku-5-5" }
}
}
}
- Send a test message and confirm you get a reply and a usage entry.
- Connect a chat channel such as Telegram, then approve your sender with
openclaw pairing approve, since unknown senders are paired by default.
How to self host OpenClaw Claude on other VPS Services (OpenClaw self hosting guide)
You can run OpenClaw on any Linux box with Node and a persistent disk. The steps below use the same Anthropic setup as the template.
Clone the Repository
Grab the upstream OpenClaw source for its docs and move into the folder.
git clone https://github.com/openclaw/openclaw.git
cd openclaw
Install Dependencies
OpenClaw needs Node 24.16 or newer (or 26.1+). Install it globally, then run onboarding with your key.
npm install -g openclaw@latest
openclaw onboard --install-daemon --anthropic-api-key "$ANTHROPIC_API_KEY"
Configure Environment Variables
Set your Anthropic key and gateway token, then point the default model at an anthropic/ ID.
export ANTHROPIC_API_KEY=your-anthropic-key
export OPENCLAW_GATEWAY_TOKEN=your-long-random-token
export OPENCLAW_GATEWAY_PORT=18789
Set agents.defaults.model.primary to anthropic/claude-haiku-5-5 for quick replies, or a larger Claude model for long tasks.
Start the OpenClaw Claude Application
Start the gateway on port 18789, then open your server address and paste the gateway token into the Control UI.
openclaw gateway --bind lan --port 18789
On a VPS you handle restarts, backups, and TLS yourself. Railway handles the volume, public domain, and restarts for you.
Official Pricing of OpenClaw Claude (OpenClaw pricing)
OpenClaw is free and open source under the MIT license, so there is no OpenClaw subscription to buy. Railway's $5 trial credit covers early testing.
The model bill is separate and usually the larger one. An ANTHROPIC_API_KEY is billed per token through your Anthropic Console account.
OpenClaw Claude cloud vs self hosted comparison (Pricing, features, costs, and more)
Running OpenClaw on Railway trades a bit of setup for an always-on gateway you control.
Monthly cost of self hosting OpenClaw Claude on Railway
Expect roughly $10-25 per month on Railway for the service, since the browser variant with Chromium needs 1-2 GB of RAM. OpenClaw itself is free software.
System Requirements for Hosting OpenClaw Claude on a VPS
A VPS needs enough RAM for the Node gateway plus any browser tooling, so 1-2 GB is the practical floor if you run Chromium.
Frequently Asked Questions (FAQs)
Should I use an API key or a Claude subscription login?
Use the API key route on Railway. Set ANTHROPIC_API_KEY on the service and billing runs through usage.
Which Claude model should I pick?
Use anthropic/claude-haiku-5-5 for quick replies and cheap background work. Set a larger Claude model as primary for long or tricky tasks.
What does Haiku 5.5 cost per token?
OpenClaw's docs list 0.10 USD per million input tokens and 0.50 USD per million output tokens for prompts up to 100K tokens.
Does prompt caching apply?
Yes, caching can cut repeated input costs on long system prompts and tool definitions.
Why does the model picker show two routes?
The picker lists each model once per route and labels the API route apart from the Claude CLI route.
Can I fall back to another provider?
Yes, model providers are plugins, so you can add another key and configure it as a fallback. Keep Anthropic as primary so default behavior stays predictable.
Template Content

