OpenClaw—制作离线安装包(Linux)

官网地址

https://github.com/openclaw/openclaw

克隆openclaw源代码

#设置代理,解决GITHUB无法下载代码的问题
export http_proxy="http://127.0.0.1:7897" 
export https_proxy="http://127.0.0.1:7897" 

git clone https://github.com/openclaw/openclaw.git
cd openclaw
git fetch --tags
git tag 
git tag -l --sort=-creatordate

#切换到最新分支
git checkout v2026.3.13-1

克隆openclaw源代码并且安装依赖

#下载node安装文件到openclaw源码中
cd openclaw
mkdir node

apt install -y xz-utils

#amd64
wget https://nodejs.org/dist/v22.22.1/node-v22.22.1-linux-x64.tar.xz
tar xvf node-v22.22.1-linux-x64.tar.xz -C openclaw/node/ --strip-components=1

#arm64
wget https://nodejs.org/dist/v22.22.1/node-v22.22.1-linux-arm64.tar.xz
tar xvf node-v22.22.1-linux-arm64.tar.xz -C openclaw/node/ --strip-components=1

#安装pnpm
cd openclaw
#需要设置环境变量,否则会找不到node
export PATH=$PATH:/home/cloud/openclaw/openclaw/node/bin/
npm install --prefix ./node/ pnpm -g

#安装依赖,如果无法从github中下载相应的文件,需设置代理
pnpm install --registry=https://registry.npmmirror.com

#编译
npx pnpm build

初始化配置

#交互性配置使用这个命令
node openclaw.mjs onboard

创建启动脚本如下

#!/bin/bash

BASE_DIR=$(cd "$(dirname "$0")"; pwd)

echo "$BASE_DIR"

export PATH=$BASE_DIR/node/bin:$PATH

echo "Starting OpenClaw..."

#node scripts/run-node.mjs

if [ ! -d "$HOME/.openclaw" ]; then
  echo "~/.openclaw 不存在,执行 setup..."
  node openclaw.mjs setup
else
  echo "~/.openclaw 已存在,跳过 setup"
fi

# 运行原始命令
#exec node openclaw.mjs setup
export OPENCLAW_GATEWAY_TOKEN=my-secret-token
exec node openclaw.mjs gateway --port 18789 --allow-unconfigured

其他局域网客户端访问

ssh -L 18789:localhost:18789 cloud@192.168.88.66

打开浏览器

http://localhost:18789/chat?session=main&token=my-secret-token

配置模型

./node/bin/node openclaw.mjs config set model.default deepseek-chat