[{"data":1,"prerenderedAt":694},["ShallowReactive",2],{"blog-/blog/openclaw-vps-tutorial":3},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"author":10,"date":11,"tags":12,"body":17,"_type":688,"_id":689,"_source":690,"_file":691,"_stem":692,"_extension":693},"/blog/openclaw-vps-tutorial","blog",false,"","热门开源 AI Agent：OpenClaw 自动化部署与硬件避坑指南","手把手教你在海外 VPS 上使用 Docker 部署近期热门的开源 AI Agent 项目 OpenClaw。涵盖服务器配置要求、Telegram 渠道接入以及常见权限报错排查。","VPS Hunter","2026-03-15",[13,14,15,16],"OpenClaw","AI部署","Docker","VPS实战",{"type":18,"children":19,"toc":673},"root",[20,35,47,52,59,71,76,97,109,113,119,124,182,187,214,217,223,243,250,313,319,340,404,407,413,418,430,455,524,536,559,565,578,623,626,667],{"type":21,"tag":22,"props":23,"children":24},"element","p",{},[25,28,33],{"type":26,"value":27},"text","近期，开源社区备受关注的 AI Agent 项目 ",{"type":21,"tag":29,"props":30,"children":31},"strong",{},[32],{"type":26,"value":13},{"type":26,"value":34}," 热度持续攀升。它支持高度自定义的本地工作流，可以直接挂载服务器目录作为其工作空间，并且能够无缝接入 Telegram 进行远程指令控制。",{"type":21,"tag":22,"props":36,"children":37},{},[38,40,45],{"type":26,"value":39},"但需要注意的是，跑这类挂载了长期记忆（Memory）和复杂环境交互插件（MCP Skills）的 AI 代理，对服务器的硬件配置有硬性门槛。官方给出的推荐起步配置是 ",{"type":21,"tag":29,"props":41,"children":42},{},[43],{"type":26,"value":44},"2核 4G 内存",{"type":26,"value":46},"。如果内存过小，在处理复杂逻辑或并发 API 请求时，极其容易触发 OOM（内存溢出）导致 Docker 容器意外崩溃。",{"type":21,"tag":22,"props":48,"children":49},{},[50],{"type":26,"value":51},"在正式动手部署前，我们需要先准备一台网络连通性良好（能够顺畅调用 OpenAI/Claude 等大模型 API）且内存达标的海外 VPS。",{"type":21,"tag":53,"props":54,"children":56},"h2",{"id":55},"一-运行环境与-vps-推荐",[57],{"type":26,"value":58},"一、 运行环境与 VPS 推荐",{"type":21,"tag":22,"props":60,"children":61},{},[62,64,69],{"type":26,"value":63},"结合 OpenClaw 需要高频请求海外大模型接口以及 Telegram 服务的特性，",{"type":21,"tag":29,"props":65,"children":66},{},[67],{"type":26,"value":68},"海外 VPS + 顶级模型 API",{"type":26,"value":70}," 是目前的最佳实践组合。",{"type":21,"tag":22,"props":72,"children":73},{},[74],{"type":26,"value":75},"如果手头没有合适的闲置机器，这里推荐两款完美契合 OpenClaw 性能需求的 4GB 内存高配主机：",{"type":21,"tag":77,"props":78,"children":79},"plan-grid",{},[80,89],{"type":21,"tag":81,"props":82,"children":88},"plan-card",{":specs":83,"buttonText":84,"color":85,"link":86,"title":87},"[\"CPU：4 核 (4.5GHz Ryzen 7950X)\",\"内存：4096 MB DDR5 (极速响应)\",\"硬盘：100 GB NVMe SSD\",\"网络：AS9929-CMIN2 高端优化线路\",\"价格：$24.00 美元 / 月\"]","直达购买 (斯巴达 4G 方案)","purple","/go/spartan-426","斯巴达 4096MB SEAKVM (算力首选)",[],{"type":21,"tag":81,"props":90,"children":96},{":specs":91,"buttonText":92,"color":93,"link":94,"title":95},"[\"CPU：4 核 Intel Xeon\",\"内存：4096 MB\",\"硬盘：80 GB RAID-10\",\"流量：3 TB / 月\",\"特点：极速的 API 互联网络\",\"价格：$19.99 美元 / 月\"]","直达购买 (搬瓦工 GIA 80G 方案)","green","/go/bwh-89","搬瓦工 80G KVM PROMO (网络首选)",[],{"type":21,"tag":22,"props":98,"children":99},{},[100,102,107],{"type":26,"value":101},"机器开通后，建议重装为干净的 ",{"type":21,"tag":29,"props":103,"children":104},{},[105],{"type":26,"value":106},"Debian 12",{"type":26,"value":108}," 或 Ubuntu 22.04 系统，通过 SSH 登录并提前安装好 Docker 与 Docker Compose 环境。",{"type":21,"tag":110,"props":111,"children":112},"hr",{},[],{"type":21,"tag":53,"props":114,"children":116},{"id":115},"二-核心部署与初始化",[117],{"type":26,"value":118},"二、 核心部署与初始化",{"type":21,"tag":22,"props":120,"children":121},{},[122],{"type":26,"value":123},"OpenClaw 官方提供了非常完善的 Docker 部署脚本，只需执行以下命令即可克隆项目并完成初始化：",{"type":21,"tag":125,"props":126,"children":130},"pre",{"className":127,"code":128,"language":129,"meta":7,"style":7},"language-bash shiki shiki-themes github-dark","git clone https://github.com/openclaw/openclaw.git\ncd openclaw\n./docker-setup.sh\n","bash",[131],{"type":21,"tag":132,"props":133,"children":134},"code",{"__ignoreMap":7},[135,158,173],{"type":21,"tag":136,"props":137,"children":140},"span",{"class":138,"line":139},"line",1,[141,147,153],{"type":21,"tag":136,"props":142,"children":144},{"style":143},"--shiki-default:#B392F0",[145],{"type":26,"value":146},"git",{"type":21,"tag":136,"props":148,"children":150},{"style":149},"--shiki-default:#9ECBFF",[151],{"type":26,"value":152}," clone",{"type":21,"tag":136,"props":154,"children":155},{"style":149},[156],{"type":26,"value":157}," https://github.com/openclaw/openclaw.git\n",{"type":21,"tag":136,"props":159,"children":161},{"class":138,"line":160},2,[162,168],{"type":21,"tag":136,"props":163,"children":165},{"style":164},"--shiki-default:#79B8FF",[166],{"type":26,"value":167},"cd",{"type":21,"tag":136,"props":169,"children":170},{"style":149},[171],{"type":26,"value":172}," openclaw\n",{"type":21,"tag":136,"props":174,"children":176},{"class":138,"line":175},3,[177],{"type":21,"tag":136,"props":178,"children":179},{"style":143},[180],{"type":26,"value":181},"./docker-setup.sh\n",{"type":21,"tag":22,"props":183,"children":184},{},[185],{"type":26,"value":186},"运行脚本后，系统会在宿主机的用户目录下自动创建两个核心文件夹，并安全挂载到 Docker 容器中：",{"type":21,"tag":188,"props":189,"children":190},"ul",{},[191,203],{"type":21,"tag":192,"props":193,"children":194},"li",{},[195,201],{"type":21,"tag":132,"props":196,"children":198},{"className":197},[],[199],{"type":26,"value":200},"~/.openclaw",{"type":26,"value":202},"：核心配置目录，用于存储 AI 的记忆数据、各类配置文件以及你绑定的第三方 API 密钥。",{"type":21,"tag":192,"props":204,"children":205},{},[206,212],{"type":21,"tag":132,"props":207,"children":209},{"className":208},[],[210],{"type":26,"value":211},"~/openclaw/workspace",{"type":26,"value":213},"：工作空间目录，Agent 可以直接访问、读写及保存文件的隔离沙箱区域。",{"type":21,"tag":110,"props":215,"children":216},{},[],{"type":21,"tag":53,"props":218,"children":220},{"id":219},"三-telegram-渠道接入与配对",[221],{"type":26,"value":222},"三、 Telegram 渠道接入与配对",{"type":21,"tag":22,"props":224,"children":225},{},[226,228,234,236,241],{"type":26,"value":227},"Docker 容器启动后，默认会在 ",{"type":21,"tag":132,"props":229,"children":231},{"className":230},[],[232],{"type":26,"value":233},"18789",{"type":26,"value":235}," 端口开放配置引导的 Web 界面。你可以先选择 ",{"type":21,"tag":29,"props":237,"children":238},{},[239],{"type":26,"value":240},"Skip for now",{"type":26,"value":242}," 跳过网页配置，直接在终端进行更高效的命令行配对。",{"type":21,"tag":244,"props":245,"children":247},"h3",{"id":246},"_1-准备-telegram-bot",[248],{"type":26,"value":249},"1. 准备 Telegram Bot",{"type":21,"tag":251,"props":252,"children":253},"ol",{},[254,274,293],{"type":21,"tag":192,"props":255,"children":256},{},[257,259,265,267,272],{"type":26,"value":258},"在 Telegram 搜索 ",{"type":21,"tag":132,"props":260,"children":262},{"className":261},[],[263],{"type":26,"value":264},"@userinfobot",{"type":26,"value":266}," 获取你个人的 ",{"type":21,"tag":29,"props":268,"children":269},{},[270],{"type":26,"value":271},"User ID",{"type":26,"value":273},"。",{"type":21,"tag":192,"props":275,"children":276},{},[277,279,285,287,292],{"type":26,"value":278},"搜索 ",{"type":21,"tag":132,"props":280,"children":282},{"className":281},[],[283],{"type":26,"value":284},"@BotFather",{"type":26,"value":286}," 创建一个新的机器人，并保存好生成的 ",{"type":21,"tag":29,"props":288,"children":289},{},[290],{"type":26,"value":291},"Bot API Token",{"type":26,"value":273},{"type":21,"tag":192,"props":294,"children":295},{},[296,298,304,306,312],{"type":26,"value":297},"将 Token 填入 OpenClaw 配置中的 ",{"type":21,"tag":132,"props":299,"children":301},{"className":300},[],[302],{"type":26,"value":303},"Telegram (Bot API)",{"type":26,"value":305}," 字段，Hooks 模式建议选择 ",{"type":21,"tag":132,"props":307,"children":309},{"className":308},[],[310],{"type":26,"value":311},"session-memory",{"type":26,"value":273},{"type":21,"tag":244,"props":314,"children":316},{"id":315},"_2-激活设备配对",[317],{"type":26,"value":318},"2. 激活设备配对",{"type":21,"tag":22,"props":320,"children":321},{},[322,324,330,332,338],{"type":26,"value":323},"当你在 Telegram 端向刚创建的机器人发送 ",{"type":21,"tag":132,"props":325,"children":327},{"className":326},[],[328],{"type":26,"value":329},"/start",{"type":26,"value":331}," 后，它会返回一个配对码（例如 ",{"type":21,"tag":132,"props":333,"children":335},{"className":334},[],[336],{"type":26,"value":337},"YKEY9974",{"type":26,"value":339},"，有效期为 1 小时）。此时返回宿主机服务器终端，执行以下命令完成配对授权：",{"type":21,"tag":125,"props":341,"children":343},{"className":127,"code":342,"language":129,"meta":7,"style":7},"# Docker 环境下的设备批准命令\ndocker compose run --rm openclaw-cli pairing approve telegram YKEY9974\n",[344],{"type":21,"tag":132,"props":345,"children":346},{"__ignoreMap":7},[347,356],{"type":21,"tag":136,"props":348,"children":349},{"class":138,"line":139},[350],{"type":21,"tag":136,"props":351,"children":353},{"style":352},"--shiki-default:#6A737D",[354],{"type":26,"value":355},"# Docker 环境下的设备批准命令\n",{"type":21,"tag":136,"props":357,"children":358},{"class":138,"line":160},[359,364,369,374,379,384,389,394,399],{"type":21,"tag":136,"props":360,"children":361},{"style":143},[362],{"type":26,"value":363},"docker",{"type":21,"tag":136,"props":365,"children":366},{"style":149},[367],{"type":26,"value":368}," compose",{"type":21,"tag":136,"props":370,"children":371},{"style":149},[372],{"type":26,"value":373}," run",{"type":21,"tag":136,"props":375,"children":376},{"style":164},[377],{"type":26,"value":378}," --rm",{"type":21,"tag":136,"props":380,"children":381},{"style":149},[382],{"type":26,"value":383}," openclaw-cli",{"type":21,"tag":136,"props":385,"children":386},{"style":149},[387],{"type":26,"value":388}," pairing",{"type":21,"tag":136,"props":390,"children":391},{"style":149},[392],{"type":26,"value":393}," approve",{"type":21,"tag":136,"props":395,"children":396},{"style":149},[397],{"type":26,"value":398}," telegram",{"type":21,"tag":136,"props":400,"children":401},{"style":149},[402],{"type":26,"value":403}," YKEY9974\n",{"type":21,"tag":110,"props":405,"children":406},{},[],{"type":21,"tag":53,"props":408,"children":410},{"id":409},"四-常见问题排查-faq",[411],{"type":26,"value":412},"四、 常见问题排查 (FAQ)",{"type":21,"tag":22,"props":414,"children":415},{},[416],{"type":26,"value":417},"在实际部署过程中，初学者最容易在目录权限和网络安全配置上遇到阻碍。",{"type":21,"tag":244,"props":419,"children":421},{"id":420},"_1-启动报错-error-eacces-permission-denied",[422,424],{"type":26,"value":423},"1. 启动报错 ",{"type":21,"tag":132,"props":425,"children":427},{"className":426},[],[428],{"type":26,"value":429},"Error: EACCES: permission denied",{"type":21,"tag":22,"props":431,"children":432},{},[433,438,440,446,448,453],{"type":21,"tag":29,"props":434,"children":435},{},[436],{"type":26,"value":437},"原因",{"type":26,"value":439},"：Docker 容器内部的默认运行用户（",{"type":21,"tag":132,"props":441,"children":443},{"className":442},[],[444],{"type":26,"value":445},"uid=1000",{"type":26,"value":447},"）没有权限写入由 root 用户创建的宿主机挂载目录。\n",{"type":21,"tag":29,"props":449,"children":450},{},[451],{"type":26,"value":452},"解决方案",{"type":26,"value":454},"：手动修正目录的归属权，并重新执行初始化流程。",{"type":21,"tag":125,"props":456,"children":458},{"className":127,"code":457,"language":129,"meta":7,"style":7},"chown -R 1000:1000 \"$HOME/.openclaw\"\ndocker compose run --rm openclaw-cli onboard\n",[459],{"type":21,"tag":132,"props":460,"children":461},{"__ignoreMap":7},[462,496],{"type":21,"tag":136,"props":463,"children":464},{"class":138,"line":139},[465,470,475,480,485,491],{"type":21,"tag":136,"props":466,"children":467},{"style":143},[468],{"type":26,"value":469},"chown",{"type":21,"tag":136,"props":471,"children":472},{"style":164},[473],{"type":26,"value":474}," -R",{"type":21,"tag":136,"props":476,"children":477},{"style":149},[478],{"type":26,"value":479}," 1000:1000",{"type":21,"tag":136,"props":481,"children":482},{"style":149},[483],{"type":26,"value":484}," \"",{"type":21,"tag":136,"props":486,"children":488},{"style":487},"--shiki-default:#E1E4E8",[489],{"type":26,"value":490},"$HOME",{"type":21,"tag":136,"props":492,"children":493},{"style":149},[494],{"type":26,"value":495},"/.openclaw\"\n",{"type":21,"tag":136,"props":497,"children":498},{"class":138,"line":160},[499,503,507,511,515,519],{"type":21,"tag":136,"props":500,"children":501},{"style":143},[502],{"type":26,"value":363},{"type":21,"tag":136,"props":504,"children":505},{"style":149},[506],{"type":26,"value":368},{"type":21,"tag":136,"props":508,"children":509},{"style":149},[510],{"type":26,"value":373},{"type":21,"tag":136,"props":512,"children":513},{"style":164},[514],{"type":26,"value":378},{"type":21,"tag":136,"props":516,"children":517},{"style":149},[518],{"type":26,"value":383},{"type":21,"tag":136,"props":520,"children":521},{"style":149},[522],{"type":26,"value":523}," onboard\n",{"type":21,"tag":244,"props":525,"children":527},{"id":526},"_2-网页端报错-control-ui-requires-https-or-localhost",[528,530],{"type":26,"value":529},"2. 网页端报错 ",{"type":21,"tag":132,"props":531,"children":533},{"className":532},[],[534],{"type":26,"value":535},"control ui requires HTTPS or localhost",{"type":21,"tag":22,"props":537,"children":538},{},[539,543,545,549,551,557],{"type":21,"tag":29,"props":540,"children":541},{},[542],{"type":26,"value":437},{"type":26,"value":544},"：出于安全限制，OpenClaw 的 Web UI 拒绝在非本地局域网的纯 HTTP 环境下运行。\n",{"type":21,"tag":29,"props":546,"children":547},{},[548],{"type":26,"value":452},{"type":26,"value":550},"：请勿直接通过 ",{"type":21,"tag":132,"props":552,"children":554},{"className":553},[],[555],{"type":26,"value":556},"http://公网IP:18789",{"type":26,"value":558}," 访问。建议使用 Caddy 或 Nginx 配置反向代理，并绑定一个域名自动申请 SSL 证书，全程通过 HTTPS 访问控制面板。",{"type":21,"tag":244,"props":560,"children":562},{"id":561},"_3-如何修改-ai-的性格去除机器味",[563],{"type":26,"value":564},"3. 如何修改 AI 的“性格”去除机器味？",{"type":21,"tag":22,"props":566,"children":567},{},[568,570,576],{"type":26,"value":569},"进入你的工作空间目录 ",{"type":21,"tag":132,"props":571,"children":573},{"className":572},[],[574],{"type":26,"value":575},"~/.openclaw/workspace",{"type":26,"value":577},"，找到以下核心调教文件直接修改：",{"type":21,"tag":188,"props":579,"children":580},{},[581,595,609],{"type":21,"tag":192,"props":582,"children":583},{},[584,593],{"type":21,"tag":29,"props":585,"children":586},{},[587],{"type":21,"tag":132,"props":588,"children":590},{"className":589},[],[591],{"type":26,"value":592},"SOUL.md",{"type":26,"value":594},"：定义性格与底层逻辑（重点修改此处，可以让它的回复更具拟人化）。",{"type":21,"tag":192,"props":596,"children":597},{},[598,607],{"type":21,"tag":29,"props":599,"children":600},{},[601],{"type":21,"tag":132,"props":602,"children":604},{"className":603},[],[605],{"type":26,"value":606},"AGENTS.md",{"type":26,"value":608},"：定义它的行为准则。",{"type":21,"tag":192,"props":610,"children":611},{},[612,621],{"type":21,"tag":29,"props":613,"children":614},{},[615],{"type":21,"tag":132,"props":616,"children":618},{"className":617},[],[619],{"type":26,"value":620},"MEMORY.md",{"type":26,"value":622},"：它的长期记忆库。",{"type":21,"tag":110,"props":624,"children":625},{},[],{"type":21,"tag":627,"props":628,"children":629},"blockquote",{},[630],{"type":21,"tag":22,"props":631,"children":632},{},[633,638,640,649,651,657,659,665],{"type":21,"tag":29,"props":634,"children":635},{},[636],{"type":26,"value":637},"进阶提示",{"type":26,"value":639},"：如果需要为你的 Agent 扩展更多的能力插件，推荐访问 ",{"type":21,"tag":641,"props":642,"children":646},"a",{"href":643,"rel":644},"https://clawhub.com",[645],"nofollow",[647],{"type":26,"value":648},"ClawHub",{"type":26,"value":650}," 社区下载。例如 ",{"type":21,"tag":132,"props":652,"children":654},{"className":653},[],[655],{"type":26,"value":656},"Agent Browser",{"type":26,"value":658},"（联网能力）和 ",{"type":21,"tag":132,"props":660,"children":662},{"className":661},[],[663],{"type":26,"value":664},"DevTools MCP",{"type":26,"value":666},"（开发辅助）都是极度推荐的必装神器。",{"type":21,"tag":668,"props":669,"children":670},"style",{},[671],{"type":26,"value":672},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":7,"searchDepth":160,"depth":160,"links":674},[675,676,677,681],{"id":55,"depth":160,"text":58},{"id":115,"depth":160,"text":118},{"id":219,"depth":160,"text":222,"children":678},[679,680],{"id":246,"depth":175,"text":249},{"id":315,"depth":175,"text":318},{"id":409,"depth":160,"text":412,"children":682},[683,685,687],{"id":420,"depth":175,"text":684},"1. 启动报错 Error: EACCES: permission denied",{"id":526,"depth":175,"text":686},"2. 网页端报错 control ui requires HTTPS or localhost",{"id":561,"depth":175,"text":564},"markdown","content:blog:openclaw-vps-tutorial.md","content","blog/openclaw-vps-tutorial.md","blog/openclaw-vps-tutorial","md",1773633468236]