部署教程 中等 30-60分钟

云服务器部署 OpenClaw

在云服务器上部署,实现 7×24 小时运行

#Cloud Deploy #VPS #24/7

准备工作

  • A cloud server or VPS
  • Basic command line knowledge
  • Stable internet connection

操作步骤

1

连接服务器

使用 SSH 连接到你的云服务器。

命令 / 操作

Mac/Linux
ssh root@你的服务器IP
Windows
使用 PuTTY 或 Windows Terminal 连接

小提示

  • Type 'yes' to confirm when connecting for the first time
2

安装 Docker

在服务器上安装 Docker。

命令 / 操作

Linux
curl -fsSL https://get.docker.com | sh && systemctl start docker && systemctl enable docker

小提示

  • After installation, run 'docker --version' to verify
3

部署 OpenClaw

运行 OpenClaw 容器。

命令 / 操作

Linux
docker run -d --name openclaw --restart always -p 80:8080 -v /root/openclaw/data:/app/data openclaw/openclaw:latest

小提示

  • --restart always ensures automatic restart after server reboot
  • Port 80 allows direct access via IP
4

配置防火墙

开放服务器防火墙端口。

命令 / 操作

Aliyun
在控制台「安全组」中添加入方向规则,开放 80 端口
Tencent Cloud
在控制台「安全组」中添加入站规则,开放 80 端口

小提示

  • If using other ports, remember to open them as well
5

访问测试

通过浏览器访问你的 OpenClaw。

命令 / 操作

All Systems
浏览器访问 http://你的服务器IP

小提示

  • Recommended: configure domain name and HTTPS certificate (using Nginx + Let's Encrypt)

常见问题

无法通过 IP 访问?
检查云服务商的安全组设置,确保对应端口已开放
如何绑定域名?
安装 Nginx 作为反向代理,配置域名解析到服务器 IP,然后申请 SSL 证书