
RackNerd VPS 部署 OpenClaw + Tailscale Serve 完整指南
方案概述
在 RackNerd 的廉价 VPS($20/年)上部署 OpenClaw,配合 Tailscale Serve 实现安全的 HTTPS 远程访问。
第一步:VPS 基础配置
# 更新系统
apt update && apt upgrade -y
# 安装 Node.js 20
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
apt install -y nodejs
# 安装 OpenClaw
npm install -g openclaw
第二步:安装 Tailscale
curl -fsSL https://tailscale.com/install.sh | sh
tailscale up --ssh
第三步:启用 Tailscale HTTPS
# 启用 HTTPS 证书
tailscale cert $(tailscale status --json | jq -r '.Self.DNSName' | sed 's/\.$//')
# 配置 Tailscale Serve 转发到 OpenClaw
tailscale serve https / http://127.0.0.1:3000
tailscale serve status
第四步:持久化运行
# 使用 systemd 管理 OpenClaw 进程
cat > /etc/systemd/system/openclaw.service << 'EOF'
[Unit]
Description=OpenClaw Agent
After=network.target
[Service]
Type=simple
User=ubuntu
WorkingDirectory=/home/ubuntu/projects
ExecStart=/usr/bin/openclaw serve --port 3000
Restart=always
Environment=ANTHROPIC_API_KEY=sk-xxx
[Install]
WantedBy=multi-user.target
EOF
systemctl enable --now openclaw
效果
从任何设备通过 https://your-vps.tail1234.ts.net 安全访问你的 OpenClaw 实例,延迟通常在 50ms 以内。
来源: @seekjourney 的部署实践