OpenClaw如何部署?2026年腾讯云AI自动化代理引擎教程
OpenClaw is an open-source, local-first AI automation agent engine that enables task execution via natural language commands. This guide provides a comprehensive, step-by-step tutorial for deploying OpenClaw on Tencent Cloud, covering three main deployment methods (one-click script, Docker Compose, and source code), along with configuration, security hardening, and ecosystem integration.
原文翻译: OpenClaw是一款开源、本地优先的AI自动化代理引擎,可通过自然语言指令执行任务。本指南提供了在腾讯云上部署OpenClaw的全面分步教程,涵盖三种主要部署方法(一键脚本、Docker Compose和源码部署),以及配置、安全加固和生态集成。
1. 什么是 OpenClaw一个开源的个人AI助手平台,支持跨平台部署和多种通讯渠道集成,能够执行自动化任务如邮件处理、日历管理等。?
OpenClaw一个开源的个人AI助手平台,支持跨平台部署和多种通讯渠道集成,能够执行自动化任务如邮件处理、日历管理等。(前身为 Clawdbot/Moltbot)是一款开源、本地优先、可执行任务的 AI 自动化代理引擎,遵循 MIT 协议。它以自然语言指令为驱动,在本地或私有云环境中完成文件操作、流程编排、浏览器自动化、多 IM 平台交互等任务,实现从 “对话式建议” 到 “自动化执行” 的跨越,是面向个人与企业的自托管式 AI 数字员工。
OpenClaw一个开源的个人AI助手平台,支持跨平台部署和多种通讯渠道集成,能够执行自动化任务如邮件处理、日历管理等。 (formerly known as Clawdbot/Moltbot) is an open-source, local-first, task-executing AI automation agent engine released under the MIT license. Driven by natural language instructions, it performs tasks such as file operations, workflow orchestration, browser automation, and multi-IM platform interactions within local or private cloud environments. It bridges the gap from "conversational suggestions" to "automated execution," serving as a self-hosted AI digital assistant for both individuals and enterprises.
1.1 核心定义
OpenClaw一个开源的个人AI助手平台,支持跨平台部署和多种通讯渠道集成,能够执行自动化任务如邮件处理、日历管理等。(前身为 Clawdbot/Moltbot)是一款开源、本地优先、可执行任务的 AI 自动化代理引擎,遵循 MIT 协议。它以自然语言指令为驱动,在本地或私有云环境中完成文件操作、流程编排、浏览器自动化、多 IM 平台交互等任务,实现从 “对话式建议” 到 “自动化执行” 的跨越,是面向个人与企业的自托管式 AI 数字员工。
OpenClaw一个开源的个人AI助手平台,支持跨平台部署和多种通讯渠道集成,能够执行自动化任务如邮件处理、日历管理等。 (formerly known as Clawdbot/Moltbot) is an open-source, local-first, task-executing AI automation agent engine released under the MIT license. Driven by natural language instructions, it performs tasks such as file operations, workflow orchestration, browser automation, and multi-IM platform interactions within local or private cloud environments. It bridges the gap from "conversational suggestions" to "automated execution," serving as a self-hosted AI digital assistant for both individuals and enterprises.
1.2 核心特性
| 特性 | 描述 |
|---|---|
| 本地优先与隐私可控 | 引擎、数据、日志均存储于自有服务器,敏感数据不出内网,满足企业合规要求 |
| 强执行能力 | 支持文件读写、脚本执行、浏览器自动化、API 调用、多步骤任务链编排 |
| 多入口无缝接入 | 兼容 WebUI、CLI、HTTP API,以及飞书、钉钉、Telegram、Discord 等 IM 机器人 |
| 模型灵活适配 | 支持对接 OpenAI、Anthropic、通义千问等云端模型,也可通过 OllamaA tool for running and managing AI models locally, supporting DeepSeek and other models. 接入本地大模型 |
| 开源可扩展 | 插件热加载、自定义工具注册、支持二次开发与商业落地 |
Feature Description Local-First & Privacy Control Engine, data, and logs are stored on your own servers. Sensitive data stays within the internal network, meeting enterprise compliance requirements. Strong Execution Capability Supports file read/write, script execution, browser automation, API calls, and multi-step task chain orchestration. Seamless Multi-Entry Access Compatible with WebUI, CLI, HTTP API, and IM bots like Feishu, DingTalk, Telegram, Discord, etc. Flexible Model Adaptation Supports integration with cloud models like OpenAI, Anthropic, Qwen, and local large models via OllamaA tool for running and managing AI models locally, supporting DeepSeek and other models.. Open Source & Extensible Plugin hot-loading, custom tool registration, supports secondary development and commercial deployment.
1.3 与传统对话式 AI 的区别
传统大模型以 “生成内容” 为核心,仅提供建议;OpenClaw一个开源的个人AI助手平台,支持跨平台部署和多种通讯渠道集成,能够执行自动化任务如邮件处理、日历管理等。 以 “任务执行” 为核心,通过 “意图解析 → 任务规划 → 工具调用 → 结果反馈” 的闭环,直接完成真实操作,且全程在用户可控的腾讯云环境中运行,兼顾弹性与安全性。
Traditional large language models focus on "content generation," offering only suggestions. In contrast, OpenClaw一个开源的个人AI助手平台,支持跨平台部署和多种通讯渠道集成,能够执行自动化任务如邮件处理、日历管理等。 centers on "task execution." It operates through a closed loop of "intent parsing → task planning → tool invocation → result feedback" to directly perform real-world operations. The entire process runs within a user-controlled Tencent Cloud environment, balancing scalability and security.
2. OpenClaw一个开源的个人AI助手平台,支持跨平台部署和多种通讯渠道集成,能够执行自动化任务如邮件处理、日历管理等。 能做什么
OpenClaw一个开源的个人AI助手平台,支持跨平台部署和多种通讯渠道集成,能够执行自动化任务如邮件处理、日历管理等。 拥有 “双眼和双手”,可直接操作电脑、浏览器、调用 API,完成各类真实任务。
OpenClaw一个开源的个人AI助手平台,支持跨平台部署和多种通讯渠道集成,能够执行自动化任务如邮件处理、日历管理等。 possesses "eyes and hands," enabling it to directly operate computers, browsers, and invoke APIs to complete various real-world tasks.
2.1 系统级操作(强执行能力)
- 文件管理:读写文件、整理文件夹、批量处理文档。
File Management: Read/write files, organize folders, batch process documents.
- 终端执行:运行 Shell 命令、执行脚本、管理进程。
Terminal Execution: Run shell commands, execute scripts, manage processes.
- 设备监控:监控电脑电量、网络连接、系统状态。
Device Monitoring: Monitor computer battery, network connections, system status.
- 代码开发:本地写代码、调试、生成测试用例、管理项目依赖。
Code Development: Write code locally, debug, generate test cases, manage project dependencies.
2.2 浏览器自动化
- 控制 Chrome 浏览器,自动浏览网页、填写表单、提取数据。
Control Chrome browser to automatically browse web pages, fill out forms, and extract data.
- 自动办理登机、查找预约、处理医疗报销等网络事务。
Automate online tasks like check-in, appointment booking, and medical reimbursement processing.
- 配置 API 令牌、OAuth,对接云服务。
Configure API tokens, OAuth, and integrate with cloud services.
2.3 办公自动化
- 邮件处理:清理收件箱、发送邮件、自动回复。
Email Processing: Clean inbox, send emails, auto-reply.
- 日程管理:管理日历、会议提醒、生成周报。
Schedule Management: Manage calendars, meeting reminders, generate weekly reports.
- 文档处理:生成工作总结、会议纪要、格式转换。
Document Processing: Generate work summaries, meeting minutes, format conversion.
- 表格处理:自动处理 Excel、数据统计。
Spreadsheet Processing: Automate Excel operations, data statistics.
2.4 多渠道交互
- 无需专用 App,通过 WhatsApp、Telegram、Discord、Slack、iMessage 等聊天软件即可控制。
No dedicated app required. Control via chat software like WhatsApp, Telegram, Discord, Slack, iMessage.
- 支持语音唤醒与对话(macOS、iOS、Android)。
Supports voice wake-up and conversation (macOS, iOS, Android).
2.5 持久记忆与规划
- 记住你的偏好、历史任务,自动拆解复杂目标并分步执行。
Remembers your preferences and historical tasks, automatically breaks down complex goals and executes them step-by-step.
- 24 小时上下文持续,提供个性化服务。
24-hour context persistence, providing personalized services.
2.6 可扩展技能生态
- 支持插件(Skills)扩展,社区已有数百种技能(办公、开发、生活等)。
Supports plugin (Skills) extensions, with hundreds of community-developed skills (office, development, life, etc.).
- 官方技能市场有 100 + 预置技能,支持用户自定义技能。
The official skill marketplace offers 100+ preset skills and supports user-defined skills.
2.7 模型灵活适配
- 支持 Claude、GPT 系列,也可通过 OllamaA tool for running and managing AI models locally, supporting DeepSeek and other models. 接入本地模型。
Supports Claude, GPT series, and local models via OllamaA tool for running and managing AI models locally, supporting DeepSeek and other models..
- 适配不同算力与隐私需求。
Adapts to different computing power and privacy requirements.
3. 部署前准备(腾讯云专属)
结合腾讯云官方教程最佳实践,优先选择轻量应用服务器(Lighthouse),开箱即用、运维成本低,完美适配 OpenClaw一个开源的个人AI助手平台,支持跨平台部署和多种通讯渠道集成,能够执行自动化任务如邮件处理、日历管理等。 私有化部署需求。
Based on Tencent Cloud's official tutorial best practices, it is recommended to prioritize Lighthouse (Lightweight Application Server). It is ready-to-use, has low operational costs, and perfectly fits OpenClaw一个开源的个人AI助手平台,支持跨平台部署和多种通讯渠道集成,能够执行自动化任务如邮件处理、日历管理等。's private deployment needs.
3.1 推荐云资源选型
| 配置 | 适用场景 | 推荐地域 | 推荐镜像 |
|---|---|---|---|
| 2 核 4GB 内存 50GB SSD | 个人测试、轻量自动化任务 | 广州、上海、北京(就近选择) | Ubuntu 22.04 LTS 64 位 |
| 4 核 8GB 内存 100GB SSD | 企业团队、本地模型运行、生产环境 | 广州、上海(低延迟) | Ubuntu 22.04 LTS 64 位 |
Configuration Use Case Recommended Region Recommended Image 2-core 4GB RAM 50GB SSD Personal testing, lightweight automation tasks Guangzhou, Shanghai, Beijing (choose nearest) Ubuntu 22.04 LTS 64-bit 4-core 8GB RAM 100GB SSD Enterprise teams, local model operation, production environment Guangzhou, Shanghai (low latency) Ubuntu 22.04 LTS 64-bit
3.2 环境依赖与前置配置
腾讯云控制台操作
Tencent Cloud Console Operations
- 购买轻量应用服务器后,在控制台开启防火墙,放行 22(SSH)、80(HTTP)、443(HTTPS)、18789(OpenClaw一个开源的个人AI助手平台,支持跨平台部署和多种通讯渠道集成,能够执行自动化任务如邮件处理、日历管理等。 网关)端口。
After purchasing the Lighthouse server, enable the firewall in the console and open ports 22 (SSH), 80 (HTTP), 443 (HTTPS), and 18789 (OpenClaw一个开源的个人AI助手平台,支持跨平台部署和多种通讯渠道集成,能够执行自动化任务如邮件处理、日历管理等。 gateway).
- 获取服务器公网 IP、登录密码(或配置 SSH 密钥),确保能通过 SSH 远程连接。
Obtain the server's public IP and login password (or configure SSH keys) to ensure remote SSH connection is possible.
- 购买轻量应用服务器后,在控制台开启防火墙,放行 22(SSH)、80(HTTP)、443(HTTPS)、18789(OpenClaw一个开源的个人AI助手平台,支持跨平台部署和多种通讯渠道集成,能够执行自动化任务如邮件处理、日历管理等。 网关)端口。
核心依赖项
Core Dependencies
- Node.js 24.x(LTS)、npm/pnpm、Git
Node.js 24.x (LTS), npm/pnpm, Git
- Docker/Docker Compose一个用于定义和运行多容器Docker应用程序的工具。在OpenClaw部署中,用于实现环境隔离、数据持久化与快速升级,是生产环境部署的首选方案。(容器化部署,推荐)
Docker/Docker Compose一个用于定义和运行多容器Docker应用程序的工具。在OpenClaw部署中,用于实现环境隔离、数据持久化与快速升级,是生产环境部署的首选方案。 (containerized deployment, recommended)
- OllamaA tool for running and managing AI models locally, supporting DeepSeek and other models.(可选,用于本地模型部署)
OllamaA tool for running and managing AI models locally, supporting DeepSeek and other models. (optional, for local model deployment)
- 腾讯云 API 密钥(可选,用于对接 COS 存储等云服务)
Tencent Cloud API keys (optional, for integrating with cloud services like COS storage)
- Node.js 24.x(LTS)、npm/pnpm、Git
4. 腾讯云部署方案(三种主流,兼容官方教程)
结合腾讯云开发者社区教程规范,以下方案均基于轻量应用服务器 Ubuntu 22.04 编写,兼顾便捷性与生产稳定性。
Following Tencent Cloud Developer Community tutorial standards, the following deployment plans are all written based on Lighthouse Ubuntu 22.04, balancing convenience and production stability.
4.1 方案一:腾讯云一键脚本部署(新手首选,5 分钟完成)
适配腾讯云轻量应用服务器特性,脚本自动优化系统配置、安装依赖并启动服务,无需手动干预。
Adapted to the characteristics of Tencent Cloud Lighthouse, the script automatically optimizes system configuration, installs dependencies, and starts the service without manual intervention.
4.1.1 远程连接服务器
# 通过 SSH 连接腾讯云轻量应用服务器
ssh root@你的服务器公网IP
# Connect to Tencent Cloud Lighthouse via SSH ssh root@your_server_public_ip
4.1.2 执行腾讯云专属安装脚本
# 下载并执行 OpenClaw 腾讯云一键部署脚本
curl -fsSL https://openclaw.ai/tencent-cloud-install.sh | bash
# Download and execute the OpenClaw Tencent Cloud one-click deployment script curl -fsSL https://openclaw.ai/tencent-cloud-install.sh | bash
4.1.3 新手引导与核心配置
脚本执行完成后,自动启动 OpenClaw一个开源的个人AI助手平台,支持跨平台部署和多种通讯渠道集成,能够执行自动化任务如邮件处理、日历管理等。 配置向导,按以下步骤操作:
After the script execution completes, the OpenClaw一个开源的个人AI助手平台,支持跨平台部署和多种通讯渠道集成,能够执行自动化任务如邮件处理、日历管理等。 configuration wizard will automatically start. Follow these steps:
- 网关配置:选择 remote(远程访问模式),绑定 0.0.0.0:18789。
Gateway Configuration: Select
remote(remote access mode), bind to0.0.0.0:18789. - 模型配置:输入云端模型 API Key,或选择 “OllamaA tool for running and managing AI models locally, supporting DeepSeek and other models. 本地模型”(推荐 4 核 8GB 以上配置)。
Model Configuration: Enter your cloud model API Key, or select "OllamaA tool for running and managing AI models locally, supporting DeepSeek and other models. Local Model" (recommended for configurations with 4 cores and 8GB RAM or above).
- 腾讯云集成:可选配置 COS 存储(用于持久化任务日志)。
Tencent Cloud Integration: Optionally configure COS storage (for persisting task logs).
- 认证设置:生成高强度访问令牌(gateway.auth.token),防止未授权访问。
Authentication Setup: Generate a strong access token (
gateway.auth.token) to prevent unauthorized access.
4.1.4 验证部署与开机自启
# 查看 OpenClaw 服务状态
systemctl status openclaw
# 启用开机自启(腾讯云服务器重启后自动恢复服务)
systemctl enable openclaw
# 健康检查(返回 healthy 即为成功)
curl http://127.0.0.1:18789/api/v1/health
# Check OpenClaw service status systemctl status openclaw # Enable auto-start on boot (service automatically recovers after Tencent Cloud server reboot) systemctl enable openclaw # Health check (successful if it returns 'healthy') curl http://127.0.0.1:18789/api/v1/health
4.1.5 远程访问 WebUI
在本地浏览器访问:http://你的服务器公网IP:18789,输入配置向导生成的令牌,即可进入 OpenClaw一个开源的个人AI助手平台,支持跨平台部署和多种通讯渠道集成,能够执行自动化任务如邮件处理、日历管理等。 可视化控制台。
Access the WebUI remotely via your local browser:
http://your_server_public_ip:18789. Enter the token generated by the configuration wizard to access the OpenClaw一个开源的个人AI助手平台,支持跨平台部署和多种通讯渠道集成,能够执行自动化任务如邮件处理、日历管理等。 visual console.
4.2 方案二:腾讯云 Docker Compose一个用于定义和运行多容器Docker应用程序的工具。在OpenClaw部署中,用于实现环境隔离、数据持久化与快速升级,是生产环境部署的首选方案。 部署(生产环境首选,稳定隔离)
遵循腾讯云容器化部署最佳实践,通过 Docker Compose一个用于定义和运行多容器Docker应用程序的工具。在OpenClaw部署中,用于实现环境隔离、数据持久化与快速升级,是生产环境部署的首选方案。 实现环境隔离、数据持久化与快速升级,适配企业级生产需求。
Following Tencent Cloud containerization deployment best practices, Docker Compose一个用于定义和运行多容器Docker应用程序的工具。在OpenClaw部署中,用于实现环境隔离、数据持久化与快速升级,是生产环境部署的首选方案。 is used to achieve environment isolation, data persistence, and rapid upgrades, meeting enterprise-level production requirements.
4.2.1 安装 Docker/Docker Compose一个用于定义和运行多容器Docker应用程序的工具。在OpenClaw部署中,用于实现环境隔离、数据持久化与快速升级,是生产环境部署的首选方案。
# 更新系统源
apt update && apt upgrade -y
# 安装 Docker
curl -fsSL https://get.docker.com | bash
# 安装 Docker Compose
apt install docker-compose-plugin -y
# 验证安装
docker --version && docker compose version
# Update system packages apt update && apt upgrade -y # Install Docker curl -fsSL https://get.docker.com | bash # Install Docker Compose apt install docker-compose-plugin -y # Verify installation docker --version && docker compose version
4.2.2 创建配置文件与启动服务
创建项目目录
Create Project Directory
mkdir -p /opt/openclaw && cd /opt/openclaw编写 docker-compose.yml(腾讯云优化版)
Write docker-compose.yml (Tencent Cloud Optimized Version)
version: "3.8" services: openclaw: image: openclaw/openclaw:latest container_name: openclaw ports: - "18789:18789" volumes: - openclaw-data:/root/.openclaw - /var/log/openclaw:/var/log/openclaw # 日志持久化 Log persistence restart: unless-stopped command: ["openclaw", "gateway", "run"] network_mode: bridge environment: - TZ=Asia/Shanghai # 腾讯云地域时区适配 Tencent Cloud region timezone adaptation - GATEWAY_MODE=remote - GATEWAY_BIND=0.0.0.0:18789 volumes: openclaw-data:启动服务并初始化
Start Service and Initialize
# 启动容器 Start container docker compose up -d # 初始化配置(设置访问令牌) Initialize configuration (set access token) docker compose exec openclaw openclaw config set gateway.auth.token 你的高强度令牌 # 查看日志 View logs docker compose logs -f
4.2.3 腾讯云安全加固
- 在腾讯云轻量应用服务器控制台,将 18789 端口的访问来源限制为企业内网 IP 或个人常用 IP。
In the Tencent Cloud Lighthouse console, restrict the source IPs for port 18789 to your enterprise intranet IP or personal frequently used IPs.
- 配置 HTTPS 反向代理(可选):通过腾讯云 SSL 证书服务 申请免费证书,配合 Nginx 实现 HTTPS 访问,提升安全性。
Configure HTTPS reverse proxy (optional): Apply for a free certificate via Tencent Cloud SSL Certificate Service and use Nginx to enable HTTPS access for enhanced security.
4.3 方案三:腾讯云源码部署(开发者首选,支持二次开发)
适用于需要基于 OpenClaw一个开源的个人AI助手平台,支持跨平台部署和多种通讯渠道集成,能够执行自动化任务如邮件处理、日历管理等。 进行二次开发、自定义插件的技术团队,结合腾讯云 Git 镜像加速与云开发工具,提升开发效率。
Suitable for
版权与免责声明:本文仅用于信息分享与交流,不构成任何形式的法律、投资、医疗或其他专业建议,也不构成对任何结果的承诺或保证。
文中提及的商标、品牌、Logo、产品名称及相关图片/素材,其权利归各自合法权利人所有。本站内容可能基于公开资料整理,亦可能使用 AI 辅助生成或润色;我们尽力确保准确与合规,但不保证完整性、时效性与适用性,请读者自行甄别并以官方信息为准。
若本文内容或素材涉嫌侵权、隐私不当或存在错误,请相关权利人/当事人联系本站,我们将及时核实并采取删除、修正或下架等处理措施。 也请勿在评论或联系信息中提交身份证号、手机号、住址等个人敏感信息。