快速吃上大龙虾OpenClaw

创建容器

1
docker run -dit --name debian13_openclaw_tun -v $(pwd):/root -v /etc/localtime:/etc/localtime --cap-add=NET_ADMIN --cap-add=NET_RAW --device=/dev/net/tun debian:trixie /bin/bash -c "/root/run.sh"

后面几个参数是用来在容器里创建tun设备用的

换源+装依赖

保存为.sh脚本,运行就行。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# source
tee /etc/apt/sources.list.d/debian.sources > /dev/null << 'EOF'
Types: deb deb-src
URIs: http://mirrors.tencent.com/debian/
Suites: trixie trixie-updates trixie-backports
Components: main contrib non-free non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

Types: deb deb-src
URIs: http://mirrors.tencent.com/debian-security
Suites: trixie-security
Components: main contrib non-free non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
EOF

apt update && apt upgrade

# base system
apt install -y curl wget git vim openssh-server iproute2 net-tools cron

ln -sf /usr/share/zoneinfo/Asia/Hong_Kong /etc/localtime
apt install -y locales
sed -i '/zh_CN.UTF-8/s/^# //g' /etc/locale.gen
sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen
locale-gen

# bash init
tee ~/.bash_profile > /dev/null << 'EOF'
proxyon() {
export mixed_proxy="127.0.0.1:10801"
export http_proxy="http://${mixed_proxy}"
export https_proxy=$http_proxy
export socks5_proxy="socks5://${mixed_proxy}"
export all_proxy=$socks5_proxy
}
proxyoff () {
unset http_proxy
unset https_proxy
unset HTTP_PROXY
unset HTTPS_PROXY
unset socks5_proxy
unset all_proxy
unset SOCKS5_PROXY
unset ALL_PROXY
}
# OpenClaw Completion
source "/root/.openclaw/completions/openclaw.bash"
# LinuxBrew
export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git"
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"
export HOMEBREW_API_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/api"
export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles"
export HOMEBREW_PIP_INDEX_URL="https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple"
#export HOMEBREW_INSTALL_FROM_API=1
export HOMEBREW_NO_INSTALL_FROM_API=1
eval "$(~/tools/homebrew/bin/brew shellenv)"
EOF
proxyon

# npm config - dont install now 'cause openclaw will install it
# apt install -y npm
# npm config set registry http://mirrors.tencent.com/npm/
# npm config set strict-ssl false
tee /root/.npmrc > /dev/null << 'EOF'
registry=http://mirrors.tencent.com/npm/
strict-ssl=false
proxy=http://127.0.0.1:10801
https-proxy=http://127.0.0.1:10801
EOF

# openclaw
curl -sSL https://openclaw.ai/install.sh | bash

如何配置OpenAI Codex

在终端运行

1
openclaw onboard --auth-choice openai-codex

然后根据提示操作就行,openai的oauth回调在1455端口,用f12或者别的方法把回调链接找到,填进大龙虾就行。

认证相关的文件存放在/root/.openclaw/agents/main/agent/auth-profiles.json,别删了。

几个要注意的配置

俄服高德的配对文件在~/.openclaw/credentials/telegram-default-allowFrom.json里。如果你的机器可以直接访问api.telegram.org,那么就不用配置channels.telegram.proxy了,直接删了这行就行。

后面的配置都在~/.openclaw/openclaw.json里。

agents.defaults.heartbeat

最好改一下,不然一直在后台轮询,吃你token

1
2
3
4
5
6
7
8
9
10
"heartbeat": {
"every": "30m",
"activeHours": {
"start": "07:10",
"end": "07:45"
},
"includeReasoning": false,
"target": "last",
"directPolicy": "allow"
}

gateway

如果你把bind设置成loopback的话,必须要用端口转发到本机或者反代进去,我是设置成lan了然后在后面加白就能访问。
controlUI.allowedOrigins就是要加白的地址,这个是你访问大龙虾的地址。

我的完整openclaw.json

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
{
"meta": {
"lastTouchedVersion": "2026.2.26",
"lastTouchedAt": "2026-03-01T12:18:21.808Z"
},
"wizard": {
"lastRunAt": "2026-03-01T12:18:21.776Z",
"lastRunVersion": "2026.2.26",
"lastRunCommand": "onboard",
"lastRunMode": "local"
},
"auth": {
"profiles": {
"zai:default": {
"provider": "zai",
"mode": "api_key"
},
"openai-codex:default": {
"provider": "openai-codex",
"mode": "oauth"
}
}
},
"models": {
"providers": {
"siliconflow": {
"baseUrl": "https://api.siliconflow.cn/v1",
"apiKey": "sk-114514",
"api": "openai-completions",
"models": [
{
"id": "zai-org/GLM-4.6V",
"name": "GLM-4.6V",
"reasoning": false,
"input": [
"text",
"image"
],
"cost": {
"input": 0,
"output": 0,
"cacheRead": 0,
"cacheWrite": 0
},
"contextWindow": 200000,
"maxTokens": 8192
},
{
"id": "Pro/MiniMaxAI/MiniMax-M2.5",
"name": "MiniMax-M2.5",
"reasoning": false,
"input": [
"text"
],
"cost": {
"input": 0,
"output": 0,
"cacheRead": 0,
"cacheWrite": 0
},
"contextWindow": 200000,
"maxTokens": 8192
}
]
},
"bailian": {
"baseUrl": "https://dashscope.aliyuncs.com/compatible-mode/v1",
"apiKey": "sk-114514",
"api": "openai-completions",
"models": [
{
"id": "qwen3.5-plus",
"name": "qwen3.5-plus",
"reasoning": false,
"input": [
"text",
"image"
],
"contextWindow": 262144,
"maxTokens": 65536
}
]
},
"deepseek": {
"baseUrl": "https://api.deepseek.com/chat/completions",
"apiKey": "sk-114514",
"api": "openai-completions",
"models": [
{
"id": "deepseek-chat",
"name": "deepseek-chat",
"reasoning": false,
"input": [
"text",
"image"
],
"contextWindow": 262144,
"maxTokens": 65536
}
]
}
}
},
"agents": {
"defaults": {
"model": {
"primary": "openai-codex/gpt-5.3-codex",
"fallbacks": [
"siliconflow/Pro/MiniMaxAI/MiniMax-M2.5",
"siliconflow/zai-org/GLM-4.6V",
"openai-codex/gpt-5.3-codex",
"bailian/qwen3.5-plus",
"deepseek/deepseek-chat"
]
},
"workspace": "/root/.openclaw/workspace",
"compaction": {
"reserveTokensFloor": 20000,
"memoryFlush": {
"enabled": true,
"softThresholdTokens": 4000,
"prompt": "Write any lasting notes to memory/YYYY-MM-DD.md; reply with NO_REPLY if nothing to store.",
"systemPrompt": "Session nearing compaction. Store durable memories now."
}
},
"heartbeat": {
"every": "30m",
"activeHours": {
"start": "07:10",
"end": "07:45"
},
"includeReasoning": false,
"target": "last",
"directPolicy": "allow"
}
}
},
"tools": {
"web": {
"search": {
"enabled": true
},
"fetch": {
"enabled": true
}
}
},
"messages": {
"ackReactionScope": "group-mentions"
},
"commands": {
"native": "auto",
"nativeSkills": "auto",
"restart": true,
"ownerDisplay": "raw"
},
"session": {
"dmScope": "per-channel-peer"
},
"hooks": {
"internal": {
"enabled": true,
"entries": {
"session-memory": {
"enabled": true
}
}
}
},
"channels": {
"telegram": {
"enabled": true,
"dmPolicy": "pairing",
"botToken": "114514:1919810",
"replyToMode": "first",
"groups": {
"-114514": {
"requireMention": true,
"groupPolicy": "open",
"tools": {}
},
"-1919810": {
"requireMention": true,
"groupPolicy": "open",
"tools": {
"deny": [
"exec"
]
}
}
},
"groupPolicy": "allowlist",
"streaming": "block",
"proxy": "http://127.0.0.1:10801",
"actions": {
"sticker": true
},
"reactionNotifications": "all",
"reactionLevel": "extensive"
}
},
"gateway": {
"port": 18789,
"mode": "local",
"bind": "lan",
"controlUi": {
"enabled": true,
"allowedOrigins": [
"http://172.16.0.114:18789",
],
"allowInsecureAuth": true,
"dangerouslyDisableDeviceAuth": true
},
"auth": {
"mode": "token",
"token": "1145141919810henghengaaaa"
},
"trustedProxies": [
"127.0.0.1"
],
"tailscale": {
"mode": "off",
"resetOnExit": false
}
},
"skills": {
"allowBundled": [
"multi-search-engine"
]
},
"plugins": {
"entries": {
"telegram": {
"enabled": true
}
}
}
}

快速吃上大龙虾OpenClaw
http://blog.coolenoch.ink/2026/03/02/Linux/36-快速吃上大龙虾OpenClaw-260302/
作者
CoolestEnoch
发布于
2026年3月2日
许可协议