跳到正文

科技·工程

服务器搭建 Openclaw

FlyHappily约 3 分钟
原文

这是 2026年2月27日 存档的第 1 版,不是当前版本。查看当前版本

文章信息与版本

文章信息

发布
2026年1月27日
收录
2026年2月27日
更新
2026年11月14日
篇幅
约 3 分钟

版本

  1. v2当前
  2. v1

上一篇

0. 前言

看见很火就来了

你需要开通 github 学生卡。

1. 部署

运行 curl -fsSL https://openclaw.ai/install.sh | bash ,稍等片刻。
依次选择:

代码
Yes
QuickStart
Copilot

去 github 登录。

选一个不用额度的模型。
channel 和 skills 可以后序设置。 然后再等会就结束了。(存下你 Dashboard Ready 块的值)

2.设置公网连接

需要先安装 nginx。
编辑 /etc/nginx/nginx.conf,在 html 块加入以下内容:

代码
server {
  listen 80;
  listen [::]:80;
  server_name ai.flyhappily.dpdns.org;
  location /{
    proxy_pass http://127.0.0.1:18789;
    proxy_read_timeout 200s;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
  }
}


去 Cloudflare 添加子域名:

运行命令:

代码
openclaw gateway stop
openclaw gateway start

等等再看你的域名大概就是这个样子了:

打开你的 ~/.openclaw/openclaw.json,复制 gateway 块中的 auth 块中的 Token,粘贴到网站 Overview -> Gateway Token 中,点击 connect,就成功了!

尽情享用吧!

下一篇