mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-15 20:10:42 +00:00
* docs: restructure Get Started tab and improve onboarding flow - Flatten nested Onboarding group into linear First Steps flow - Add 'What is OpenClaw?' narrative section to landing page - Split wizard.md into streamlined overview + full reference (reference/wizard.md) - Move Pairing to Channels > Configuration - Move Bootstrapping to Agents > Fundamentals - Move macOS app onboarding to Platforms > macOS companion app - Move Lore to Help > Community - Remove duplicate install instructions from openclaw.md - Mirror navigation changes in zh-CN tabs - No content deleted — all detail preserved or relocated * docs: move deployment pages to install/, fix Platforms tab routing, clarify onboarding paths - Move deployment guides (fly, hetzner, gcp, macos-vm, exe-dev, railway, render, northflank) from platforms/ and root to install/ - Add 'Hosting and deployment' group to Install tab - Slim Gateway & Ops 'Remote access and deployment' down to 'Remote access' - Swap Platforms tab before Gateway & Ops to fix path-prefix routing - Move macOS app onboarding into First steps (parallel to CLI wizard) - Rename sidebar titles to 'Onboarding: CLI' / 'Onboarding: macOS App' - Add redirects for all moved paths - Update all internal links (en + zh-CN) - Fix img tag syntax in onboarding.md
107 lines
3.3 KiB
Plaintext
107 lines
3.3 KiB
Plaintext
---
|
||
title: 在 Railway 上部署
|
||
x-i18n:
|
||
generated_at: "2026-02-01T21:36:21Z"
|
||
model: claude-opus-4-5
|
||
provider: pi
|
||
source_hash: 6d5c2ec2f779bb240e778b5e18ffb8138ce175c4bbdf58b2064a6ad200bf4d1b
|
||
source_path: railway.mdx
|
||
workflow: 15
|
||
---
|
||
|
||
通过一键模板在 Railway 上部署 OpenClaw,并在浏览器中完成设置。
|
||
这是最简单的"无需在服务器上使用终端"的方式:Railway 为你运行 Gateway网关,
|
||
你只需通过 `/setup` 网页向导完成所有配置。
|
||
|
||
## 快速检查清单(新用户)
|
||
|
||
1. 点击下方的 **Deploy on Railway**。
|
||
2. 添加一个挂载到 `/data` 的 **Volume**。
|
||
3. 设置必需的**变量**(至少需要 `SETUP_PASSWORD`)。
|
||
4. 在端口 `8080` 上启用 **HTTP Proxy**。
|
||
5. 打开 `https://<your-railway-domain>/setup` 并完成向导。
|
||
|
||
## 一键部署
|
||
|
||
<a href="https://railway.com/deploy/clawdbot-railway-template" target="_blank" rel="noreferrer">
|
||
Deploy on Railway
|
||
</a>
|
||
|
||
部署完成后,在 **Railway → 你的服务 → Settings → Domains** 中找到你的公开 URL。
|
||
|
||
Railway 会:
|
||
|
||
- 为你生成一个域名(通常是 `https://<something>.up.railway.app`),或者
|
||
- 使用你绑定的自定义域名。
|
||
|
||
然后打开:
|
||
|
||
- `https://<your-railway-domain>/setup` — 设置向导(需密码保护)
|
||
- `https://<your-railway-domain>/openclaw` — 控制面板 UI
|
||
|
||
## 你将获得
|
||
|
||
- 托管的 OpenClaw Gateway网关 + 控制面板 UI
|
||
- `/setup` 网页设置向导(无需终端命令)
|
||
- 通过 Railway Volume(`/data`)实现持久化存储,配置/凭证/工作区在重新部署后不会丢失
|
||
- 在 `/setup/export` 导出备份,方便日后从 Railway 迁移
|
||
|
||
## 必需的 Railway 设置
|
||
|
||
### 公共网络
|
||
|
||
为服务启用 **HTTP Proxy**。
|
||
|
||
- 端口:`8080`
|
||
|
||
### Volume(必需)
|
||
|
||
挂载一个 Volume 到:
|
||
|
||
- `/data`
|
||
|
||
### 变量
|
||
|
||
在服务上设置以下变量:
|
||
|
||
- `SETUP_PASSWORD`(必需)
|
||
- `PORT=8080`(必需 — 必须与公共网络中的端口一致)
|
||
- `OPENCLAW_STATE_DIR=/data/.openclaw`(推荐)
|
||
- `OPENCLAW_WORKSPACE_DIR=/data/workspace`(推荐)
|
||
- `OPENCLAW_GATEWAY_TOKEN`(推荐;请视为管理员密钥)
|
||
|
||
## 设置流程
|
||
|
||
1. 访问 `https://<your-railway-domain>/setup` 并输入你的 `SETUP_PASSWORD`。
|
||
2. 选择模型/认证提供商并粘贴你的密钥。
|
||
3. (可选)添加 Telegram/Discord/Slack 令牌。
|
||
4. 点击 **Run setup**。
|
||
|
||
如果 Telegram 私信设置为配对模式,设置向导可以批准配对码。
|
||
|
||
## 获取聊天令牌
|
||
|
||
### Telegram 机器人令牌
|
||
|
||
1. 在 Telegram 中给 `@BotFather` 发消息
|
||
2. 执行 `/newbot`
|
||
3. 复制令牌(格式类似 `123456789:AA...`)
|
||
4. 将其粘贴到 `/setup` 中
|
||
|
||
### Discord 机器人令牌
|
||
|
||
1. 前往 https://discord.com/developers/applications
|
||
2. **New Application** → 选择一个名称
|
||
3. **Bot** → **Add Bot**
|
||
4. 在 Bot → Privileged Gateway Intents 下**启用 MESSAGE CONTENT INTENT**(必需,否则机器人启动时会崩溃)
|
||
5. 复制 **Bot Token** 并粘贴到 `/setup` 中
|
||
6. 邀请机器人加入你的服务器(OAuth2 URL Generator;scopes:`bot`、`applications.commands`)
|
||
|
||
## 备份与迁移
|
||
|
||
在以下地址下载备份:
|
||
|
||
- `https://<your-railway-domain>/setup/export`
|
||
|
||
这会导出你的 OpenClaw 状态和工作区,方便你迁移到其他主机而不丢失配置或记忆。
|