在Ubuntu上快速部署OpenClaw并接入飛書的完整過程
前言
本文記錄我在 Ubuntu 22.04 服務(wù)器上從零部署 OpenClaw 并接入飛書的完整過程,包括遇到的坑和解決方法。
環(huán)境信息
- 系統(tǒng): Ubuntu 22.04 LTS
- 配置: 4核 8GB 內(nèi)存,100M 帶寬
- 類型 CPU
一、安裝依賴
1.1 更新系統(tǒng)包索引
sudo apt update
1.2 安裝 curl
sudo apt install -y curl
1.3 通過 NodeSource 安裝最新穩(wěn)定 LTS 版本
# 添加 NodeSource 倉庫并安裝 curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - sudo apt-get install -y nodejs # 安裝完成后,驗證版本 node -v npm -v
實際輸出:
ubuntu@gt-ubuntu22-04-cmd-v3-0-8gb-100m:~$ node -v v24.14.0 ubuntu@gt-ubuntu22-04-cmd-v3-0-8gb-100m:~$ npm -v 11.9.0
1.4 設(shè)置淘寶鏡像(最常用)
npm config set registry https://registry.npmmirror.com # 查詢是否配置成功 npm config get registry
驗證輸出:
ubuntu@gt-ubuntu22-04-cmd-v3-0-8gb-100m:~$ npm config get registry https://registry.npmmirror.com
二、安裝 OpenClaw
執(zhí)行安裝腳本(注意:安裝過程中要勾選 yes):
curl -fsSL https://openclaw.ai/install.sh | bash
完整安裝日志:
ubuntu@gt-ubuntu22-04-cmd-v3-0-8gb-100m:~$ curl -fsSL https://openclaw.ai/install.sh | bash
?? OpenClaw Installer
The only crab in your contacts you actually want to hear from. ??
? Detected: linux
Install plan
OS: linux
Install method: npm
Requested version: latest
[1/3] Preparing environment
? Node.js v24.14.0 found
· Active Node.js: v24.14.0 (/usr/bin/node)
· Active npm: 11.9.0 (/usr/bin/npm)
[2/3] Installing OpenClaw
? Git already installed
· Configuring npm for user-local installs
? npm configured for user installs
· Installing OpenClaw v2026.2.26
? OpenClaw npm package installed
? OpenClaw installed
[3/3] Finalizing setup
! PATH missing npm global bin dir: /home/ubuntu/.npm-global/bin
This can make openclaw show as "command not found" in new terminals.
Fix (zsh: ~/.zshrc, bash: ~/.bashrc):
export PATH="/home/ubuntu/.npm-global/bin:$PATH"
?? OpenClaw installed successfully (2026.2.26)!
All done! I promise to only judge your code a little bit.
· Starting setup
?? OpenClaw 2026.2.26 (bc50708) — Ship fast, log faster.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
██?▄▄▄?██?▄▄?██?▄▄▄██??██?██?▄▄?██?████?▄▄?██?███?██
██?███?██????██?▄▄▄██?█?█?██?█████?████????██?█?█?██
██?????██?█████????██?██▄?██???▄██????█?██?██▄?▄?▄██
????????????????????????????????????????????????????
?? OPENCLAW ??
┌ OpenClaw onboarding
│
◇ Security ─────────────────────────────────────────────────────────────────────────────────╮
│ │
│ Security warning — please read. │
│ │
│ OpenClaw is a hobby project and still in beta. Expect sharp edges. │
│ By default, OpenClaw is a personal agent: one trusted operator boundary. │
│ This bot can read files and run actions if tools are enabled. │
│ A bad prompt can trick it into doing unsafe things. │
│ │
│ OpenClaw is not a hostile multi-tenant boundary by default. │
│ If multiple users can message one tool-enabled agent, they share that delegated tool │
│ authority. │
│ │
│ If you’re not comfortable with security hardening and access control, don’t run │
│ OpenClaw. │
│ Ask someone experienced to help before enabling tools or exposing it to the internet. │
│ │
│ Recommended baseline: │
│ - Pairing/allowlists + mention gating. │
│ - Multi-user/shared inbox: split trust boundaries (separate gateway/credentials, ideally │
│ separate OS users/hosts). │
│ - Sandbox + least-privilege tools. │
│ - Shared inboxes: isolate DM sessions (`session.dmScope: per-channel-peer`) and keep │
│ tool access minimal. │
│ - Keep secrets out of the agent’s reachable filesystem. │
│ - Use the strongest available model for any bot with tools or untrusted inboxes. │
│ │
│ Run regularly: │
│ openclaw security audit --deep │
│ openclaw security audit --fix │
│ │
│ Must read: https://docs.openclaw.ai/gateway/security │
│ │
├────────────────────────────────────────────────────────────────────────────────────────────╯
│
◇ I understand this is personal-by-default and shared/multi-user use requires lock-down. Continue?
│ Yes
│
◇ Onboarding mode
│ QuickStart
│
◇ QuickStart ─────────────────────────╮
│ │
│ Gateway port: 18789 │
│ Gateway bind: Loopback (127.0.0.1) │
│ Gateway auth: Token (default) │
│ Tailscale exposure: Off │
│ Direct to chat channels. │
│ │
├──────────────────────────────────────╯
│
◇ Model/auth provider
│ Z.AI
│
◇ Z.AI auth method
│ CN
│
◇ How do you want to provide this API key?
│ Paste API key now
│
◇ Enter Z.AI API key
│ xxx.xxxx
│
◇ Model configured ───────────────╮
│ │
│ Default model set to zai/glm-5 │
│ │
├──────────────────────────────────╯
│
◇ Default model
│ zai/glm-4.7
│
◇ Channel status ────────────────────────────╮
│ │
│ Telegram: needs token │
│ WhatsApp (default): not linked │
│ Discord: needs token │
│ Slack: needs tokens │
│ Signal: needs setup │
│ signal-cli: missing (signal-cli) │
│ iMessage: needs setup │
│ imsg: missing (imsg) │
│ IRC: not configured │
│ Google Chat: not configured │
│ Feishu: install plugin to enable │
│ Google Chat: install plugin to enable │
│ Nostr: install plugin to enable │
│ Microsoft Teams: install plugin to enable │
│ Mattermost: install plugin to enable │
│ Nextcloud Talk: install plugin to enable │
│ Matrix: install plugin to enable │
│ BlueBubbles: install plugin to enable │
│ LINE: install plugin to enable │
│ Zalo: install plugin to enable │
│ Zalo Personal: install plugin to enable │
│ Synology Chat: install plugin to enable │
│ Tlon: install plugin to enable │
│ │
├─────────────────────────────────────────────╯
│
◇ How channels work ───────────────────────────────────────────────────────────────────────╮
│ │
│ DM security: default is pairing; unknown DMs get a pairing code. │
│ Approve with: openclaw pairing approve <channel> <code> │
│ Public DMs require dmPolicy="open" + allowFrom=["*"]. │
│ Multi-user DMs: run: openclaw config set session.dmScope "per-channel-peer" (or │
│ "per-account-channel-peer" for multi-account channels) to isolate sessions. │
│ Docs: channels/pairing │
│ │
│ Telegram: simplest way to get started — register a bot with @BotFather and get going. │
│ WhatsApp: works with your own number; recommend a separate phone + eSIM. │
│ Discord: very well supported right now. │
│ IRC: classic IRC networks with DM/channel routing and pairing controls. │
│ Google Chat: Google Workspace Chat app with HTTP webhook. │
│ Slack: supported (Socket Mode). │
│ Signal: signal-cli linked device; more setup (David Reagans: "Hop on Discord."). │
│ iMessage: this is still a work in progress. │
│ Feishu: 飛書/Lark enterprise messaging with doc/wiki/drive tools. │
│ Nostr: Decentralized protocol; encrypted DMs via NIP-04. │
│ Microsoft Teams: Bot Framework; enterprise support. │
│ Mattermost: self-hosted Slack-style chat; install the plugin to enable. │
│ Nextcloud Talk: Self-hosted chat via Nextcloud Talk webhook bots. │
│ Matrix: open protocol; install the plugin to enable. │
│ BlueBubbles: iMessage via the BlueBubbles mac app + REST API. │
│ LINE: LINE Messaging API bot for Japan/Taiwan/Thailand markets. │
│ Zalo: Vietnam-focused messaging platform with Bot API. │
│ Zalo Personal: Zalo personal account via QR code login. │
│ Synology Chat: Connect your Synology NAS Chat to OpenClaw with full agent capabilities. │
│ Tlon: decentralized messaging on Urbit; install the plugin to enable. │
│ │
├───────────────────────────────────────────────────────────────────────────────────────────╯
│
◇ Select channel (QuickStart)
│ Skip for now
Updated ~/.openclaw/openclaw.json
Workspace OK: ~/.openclaw/workspace
Sessions OK: ~/.openclaw/agents/main/sessions
│
◇ Skills status ─────────────╮
│ │
│ Eligible: 4 │
│ Missing requirements: 40 │
│ Unsupported on this OS: 7 │
│ Blocked by allowlist: 0 │
│ │
├─────────────────────────────╯
│
◇ Configure skills now? (recommended)
│ No
│
◇ Hooks ──────────────────────────────────────────────────────────────────╮
│ │
│ Hooks let you automate actions when agent commands are issued. │
│ Example: Save session context to memory when you issue /new or /reset. │
│ │
│ Learn more: https://docs.openclaw.ai/automation/hooks │
│ │
├──────────────────────────────────────────────────────────────────────────╯
│
◇ Enable hooks?
│ Skip for now
Config overwrite: /home/ubuntu/.openclaw/openclaw.json (sha256 f763f7d577aba2ed75a863a91e3e9a116eab6ecc856e7731972988b006426453 -> 8eac9ee80087618bf88b5f7a2f1f6bdb4b5abf5dfa646c22bf65f64e92063204, backup=/home/ubuntu/.openclaw/openclaw.json.bak)
│
◇ Systemd ────────────────────────────────────────────────────────────────────────────────╮
│ │
│ Linux installs use a systemd user service by default. Without lingering, systemd stops │
│ the user session on logout/idle and kills the Gateway. │
│ Enabling lingering now (may require sudo; writes /var/lib/systemd/linger). │
│ │
├──────────────────────────────────────────────────────────────────────────────────────────╯
│
◇ Systemd ───────────────────────────────╮
│ │
│ Enabled systemd lingering for ubuntu. │
│ │
├─────────────────────────────────────────╯
│
◇ Gateway service runtime ────────────────────────────────────────────╮
│ │
│ QuickStart uses Node for the Gateway service (stable + supported). │
│ │
├──────────────────────────────────────────────────────────────────────╯
│
? Installing Gateway service…
Installed systemd service: /home/ubuntu/.config/systemd/user/openclaw-gateway.service
◇ Gateway service installed.
│
◇
Agents: main (default)
Heartbeat interval: 30m (main)
Session store (main): /home/ubuntu/.openclaw/agents/main/sessions/sessions.json (0 entries)
│
◇ Optional apps ────────────────────────╮
│ │
│ Add nodes for extra features: │
│ - macOS app (system + notifications) │
│ - iOS app (camera/canvas) │
│ - Android app (camera/canvas) │
│ │
├────────────────────────────────────────╯
│
◇ Control UI ─────────────────────────────────────────────────────────────────────╮
│ │
│ Web UI: http://127.0.0.1:18789/ │
│ Web UI (with token): │
│ http://127.0.0.1:18789/#token=2962e8f5116c63d86ea9c8224bc8d6445cce2e806ed1e183 │
│ Gateway WS: ws://127.0.0.1:18789 │
│ Gateway: reachable │
│ Docs: https://docs.openclaw.ai/web/control-ui │
│ │
├──────────────────────────────────────────────────────────────────────────────────╯
│
◇ Start TUI (best option!) ─────────────────────────────────╮
│ │
│ This is the defining action that makes your agent you. │
│ Please take your time. │
│ The more you tell it, the better the experience will be. │
│ We will send: "Wake up, my friend!" │
│ │
├────────────────────────────────────────────────────────────╯
│
◇ Token ─────────────────────────────────────────────────────────────────────────────────╮
│ │
│ Gateway token: shared auth for the Gateway + Control UI. │
│ Stored in: ~/.openclaw/openclaw.json (gateway.auth.token) or OPENCLAW_GATEWAY_TOKEN. │
│ View token: openclaw config get gateway.auth.token │
│ Generate token: openclaw doctor --generate-gateway-token │
│ Web UI stores a copy in this browser's localStorage (openclaw.control.settings.v1). │
│ Open the dashboard anytime: openclaw dashboard --no-open │
│ If prompted: paste the token into Control UI settings (or use the tokenized dashboard │
│ URL). │
│ │
├─────────────────────────────────────────────────────────────────────────────────────────╯
│
◇ How do you want to hatch your bot?
│ Open the Web UI
│
◇ Dashboard ready ────────────────────────────────────────────────────────────────╮
│ │
│ Dashboard link (with token): │
│ http://127.0.0.1:18789/#token=2962e8f5116c63d86ea9c8224bc8d6445cce2e806ed1e183 │
│ Copy/paste this URL in a browser on this machine to control OpenClaw. │
│ No GUI detected. Open from your computer: │
│ ssh -N -L 18789:127.0.0.1:18789 ubuntu@10.0.20.195 │
│ Then open: │
│ http://localhost:18789/ │
│ http://localhost:18789/#token=2962e8f5116c63d86ea9c8224bc8d6445cce2e806ed1e183 │
│ Docs: │
│ https://docs.openclaw.ai/gateway/remote │
│ https://docs.openclaw.ai/web/control-ui │
│ │
├──────────────────────────────────────────────────────────────────────────────────╯
│
◇ Workspace backup ────────────────────────────────────────╮
│ │
│ Back up your agent workspace. │
│ Docs: https://docs.openclaw.ai/concepts/agent-workspace │
│ │
├───────────────────────────────────────────────────────────╯
│
◇ Security ──────────────────────────────────────────────────────╮
│ │
│ Running agents on your computer is risky — harden your setup: │
│ https://docs.openclaw.ai/security │
│ │
├─────────────────────────────────────────────────────────────────╯
│
◇ Shell completion ────────────────────────────────────────────────────────╮
│ │
│ Shell completion installed. Restart your shell or run: source ~/.bashrc │
│ │
├───────────────────────────────────────────────────────────────────────────╯
│
◇ Web search (optional) ─────────────────────────────────────────────────────────────────╮
│ │
│ If you want your agent to be able to search the web, you’ll need an API key. │
│ │
│ OpenClaw uses Brave Search for the `web_search` tool. Without a Brave Search API key, │
│ web search won’t work. │
│ │
│ Set it up interactively: │
│ - Run: openclaw configure --section web │
│ - Enable web_search and paste your Brave Search API key │
│ │
│ Alternative: set BRAVE_API_KEY in the Gateway environment (no config changes). │
│ Docs: https://docs.openclaw.ai/tools/web │
│ │
├─────────────────────────────────────────────────────────────────────────────────────────╯
│
◇ What now ─────────────────────────────────────────────────────────────╮
│ │
│ What now: https://openclaw.ai/showcase ("What People Are Building"). │
│ │
├────────────────────────────────────────────────────────────────────────╯
│
└ Onboarding complete. Use the dashboard link above to control OpenClaw.
ubuntu@gt-ubuntu22-04-cmd-v3-0-8gb-100m:~$ 三、解決 PATH 問題
安裝完成后,如果執(zhí)行 which openclaw 找不到命令,需要手動配置 PATH:
# 檢查 openclaw 是否在 PATH 中 which openclaw # 如果找不到,查看 npm 全局安裝目錄 npm prefix -g # 查看當(dāng)前 shell echo $SHELL # 如果輸出 /bin/bash,使用 ~/.bashrc # 如果輸出 /bin/zsh,使用 ~/.zshrc # 將 npm 全局 bin 目錄添加到 PATH echo 'export PATH="$(npm prefix -g)/bin:$PATH"' >> ~/.bashrc # 重新加載配置文件 source ~/.bashrc # 驗證添加是否成功 echo $PATH | grep npm
四、訪問控制界面
4.1 本地ssh連接服務(wù)器
在本地電腦執(zhí)行,按提示輸入遠(yuǎn)程linux云主機(jī)密碼即可:
ssh -N -L 18789:127.0.0.1:18789 ubuntu@你的云主機(jī)IP

4.2 訪問openclaw web ui
攜帶部署過程中生成的Dashboard link在本地進(jìn)行訪問,如下圖:
http://localhost:18789/#token=你的token

4.3 測試
- 詢問背后模型,如下圖告知是glm4.7,與配置的一致
- 給AI助手起名為“大衍AI”,如下圖,可切換界面等待其生效


五、總結(jié)
本文詳細(xì)記錄了在 Ubuntu 22.04 服務(wù)器上從零部署 OpenClaw 的完整流程,包括:
- 環(huán)境準(zhǔn)備:Node.js LTS 安裝與 npm 鏡像配置
- OpenClaw 安裝:通過官方腳本一鍵安裝,處理 PATH 配置問題
- 初始化配置:QuickStart 模式、Z.AI 模型接入
- 遠(yuǎn)程訪問:通過 SSH 隧道訪問 Web 控制界面進(jìn)行問答
六、后續(xù)內(nèi)容預(yù)告
OpenClaw 的功能遠(yuǎn)不止于此,接下來我將在博客和B站頻道推出更多深度內(nèi)容,包括:
- ?? 進(jìn)階配置:自定義 Skills 技能、Hooks 自動化、多 Agent 管理
- ?? 安全加固:生產(chǎn)環(huán)境部署、訪問控制、審計日志配置
- ??? 插件開發(fā):自定義飛書工具插件、接入企業(yè)內(nèi)部系統(tǒng)
- ?? 模型調(diào)優(yōu):Prompt 工程、多模型切換、上下文管理
- ?? 實戰(zhàn)案例:搭建團(tuán)隊知識庫助手、自動化工作流機(jī)器人
到此這篇關(guān)于在Ubuntu上快速部署OpenClaw并接入飛書的文章就介紹到這了,更多相關(guān)Ubuntu部署OpenClaw接入飛書內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持腳本之家!
相關(guān)文章
OpenClaw 是一個個人 AI 代理框架,支持連接多種聊天平臺(如飛書、Telegram 等)并集成多種模型,這篇文章主要介紹了OpenClaw飛書官方插件安裝教程的相關(guān)資料,文中通過代碼2026-03-27
ubuntu (V100)中 部署openclaw并鏈接飛書的操作方法
本文介紹了在Ubuntu上部署Ollama的大模型推理框架及OpenClaw的方法,包括編譯安裝Ollama、使用OpenClaw的安裝腳本和配置文件等步驟,并簡要介紹了OpenClaw的工作流程,感興趣2026-03-26
OpenClaw飛書渠道ACP功能啟動的實現(xiàn)步驟
OpenClaw 的 ACP機(jī)制允許將 Codex、Claude Code、Gemini CLI 等外部編程工具納入 OpenClaw 的 Agent 編排體系,很多讀者在飛書渠道部署 OpenClaw 后,想知道如何在這個環(huán)境2026-03-26
當(dāng)你的 AI 助手突然聾了——能發(fā)消息卻收不到回復(fù),問題可能藏在一個你根本不會去看的 .ts 文件里,下面小編就和大家詳細(xì)介紹一下OpenClaw飛書插件加載失敗的問題排查與解決2026-03-25
OpenClaw多渠道接入WhatsApp、Telegram、飛書的實戰(zhàn)指南
OpenClaw的Channels多渠道接入系統(tǒng)是其六層架構(gòu)的第一層,負(fù)責(zé)連接外部消息平臺與AI Agent系統(tǒng),本文深入剖析Channels的核心概念、架構(gòu)設(shè)計、與Gateway的交互機(jī)制,詳細(xì)介紹2026-03-23
OpenClaw飛書插件沖突導(dǎo)致的配對失敗問題的解決方案
最近在使用 OpenClaw 進(jìn)行飛書機(jī)器人配對時,執(zhí)行命令時遇到了錯誤,同時啟動日志中反復(fù)出現(xiàn)警告這個問題的根本原因是 OpenClaw 環(huán)境中存在兩個 ID 相同的飛書插件,本文借2026-03-19
OpenClaw解決飛書 duplicate plugin id detected 問題
文章介紹了OpenClaw在啟動過程中檢測到重復(fù)的feishu插件ID并導(dǎo)致沖突的問題,通過查找和刪除全局插件文件并調(diào)整配置文件,成功解決了這個問題,感興趣的朋友跟隨小編一起看看2026-03-17
本文詳細(xì)介紹如何將OpenClaw AI 智能體網(wǎng)關(guān)與飛書(Feishu)集成,實現(xiàn)企業(yè)內(nèi)部的 AI 助手功能,涵蓋飛書應(yīng)用創(chuàng)建、權(quán)限配置、OpenClaw 連接和高級功能設(shè)置,本文給大家介紹2026-03-17
OpenClaw 從零配置指南并接入飛書 + 常用命令 + 原理全解析
本文介紹了如何從零配置OpenClaw并接入飛書,包括安裝、配置、權(quán)限設(shè)置、模型切換、技能管理等步驟,以及常用命令和配置文件說明,感興趣的朋友跟隨小編一起看看吧2026-03-12
2026年OpenClaw(前身為Moltbot)憑借輕量化部署、強(qiáng)大的AI任務(wù)執(zhí)行能力與靈活的生態(tài)集成特性,成為企業(yè)智能化辦公的核心工具,這篇文章主要介紹了OpenClaw連接飛書插件安裝、2026-03-10











