惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

月光博客
月光博客
人人都是产品经理
人人都是产品经理
博客园 - 聂微东
WordPress大学
WordPress大学
S
SegmentFault 最新的问题
博客园 - Franky
V
V2EX
Y
Y Combinator Blog
Google DeepMind News
Google DeepMind News
J
Java Code Geeks
T
The Blog of Author Tim Ferriss
罗磊的独立博客
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Jina AI
Jina AI
博客园 - 叶小钗
F
Fortinet All Blogs
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
A
About on SuperTechFans
M
MIT News - Artificial intelligence
云风的 BLOG
云风的 BLOG
Last Week in AI
Last Week in AI
D
Docker
博客园 - 【当耐特】
阮一峰的网络日志
阮一峰的网络日志

博客园 - xgqfrms

xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs Remotion Video Maker All In One git worktree All In One Tesla 的车机使用什么技术来渲染汽车模型的? 宜家 VEVELSTAD 维维斯托床架 All In One macOS sysmond bug All In One Three.js All In One The COF of LCD Monitor All In One Dell 显示器 S2419HM 灰屏 &花屏 All In One AI Harness Engineering All In One 电脑外接显示器天梯榜 All In One
如何在 Raspberry Pi 安装 OpenClaw All In One
xgqfrms · 2026-03-27 · via 博客园 - xgqfrms

如何在 Raspberry Pi 安装 OpenClaw All In One

树莓派 4B / 5B 养龙虾🦞

前置条件(Raspberry Pi 软硬件推荐配置)

  • Raspberry Pi 5 with 4 GB+ RAM
  • USB SSD (USB 移动固态硬盘)
  • Raspberry Pi 官方电源
  • WiFi (写入系统时候,添加到配置文件)
  • 64-bit Raspberry Pi OS

image

https://docs.openclaw.ai/install/raspberry-pi#prerequisites

Raspberry Pi 5 / Raspberry Pi 4B

https://www.raspberrypi.com/products/raspberry-pi-5/

https://www.raspberrypi.com/products/raspberry-pi-5-model-b/

https://www.raspberrypi.com/products/raspberry-pi-4-model-b/

Raspberry Pi 5 compute module

https://www.raspberrypi.com/products/compute-module-5/?variant=cm5-104032

Raspberry Pi Imager

使用 Raspberry Pi OS Lite (64-bit) 制作 headless 服务器系统,设置必要启动配置项目

  • 设置 hostname
  • 开启 SSH
  • 设置 username & password
  • 配置 WiFi (wifi name & wifi password)
  • 静态 ip ?
$ sudo apt install rpi-imager

https://www.raspberrypi.com/software/

https://www.raspberrypi.com/software/operating-systems/

SSH 远程连接

# ssh username@hostname
$ ssh pi@192.168.1.7
# 更新
$ sudo apt update && sudo apt upgrade -y

# 安装必要的 OpenClaw 依赖软件包 (git, curl, build-essential)
$ sudo apt install -y git curl build-essential

# 设置 timezone (用于准确触发 cron & reminders)
$ sudo timedatectl set-timezone Asia/Shanghai

# 安装 nvm
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.4/install.sh | bash
$ nvm -h

$ nvm ls-remote | grep "Latest LTS"
# 安装 node.js 24+
$ nvm install 24.14.0
$ nvm use 24.14.0
$ nvm alias default 24.14.0

$ node --version
$ npm -v
$ npx -v

https://github.com/nvm-sh/nvm?tab=readme-ov-file#install--update-script

设置 swap, 内存性能优化

$ sudo fallocate -l 2G /swapfile

$ sudo chmod 600 /swapfile
$ sudo mkswap /swapfile
$ sudo swapon /swapfile
$ echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab

# Reduce swappiness for low-RAM devices
$ echo 'vm.swappiness=10' | sudo tee -a /etc/sysctl.conf
$ sudo sysctl -p

安装 OpenClaw

$ curl -fsSL https://openclaw.ai/install.sh | bash
$ openclaw onboard --install-daemon

$ openclaw status

$ sudo systemctl status openclaw

$ journalctl -u openclaw -f
# 获取 dashboard URL (username@hostname)
$ ssh pi@192.168.1.7  'openclaw dashboard --no-open'
# 在新 Terminal 开启 SSH tunnel (username@hostname)
$ ssh -N -L 18789:127.0.0.1:18789 pi@192.168.1.7

一直可以远程访问,需要使用Tailscale integration (内网穿透 VPN)

# Tailnet-only (Serve)

{
  gateway: {
    bind: "loopback",
    tailscale: { mode: "serve" },
  },
}
#Tailnet-only (bind to Tailnet IP)

{
  gateway: {
    bind: "tailnet",
    auth: { mode: "token", token: "your-token" },
  },
}

https://docs.openclaw.ai/gateway/tailscale

The best secure connectivity platform for devs, IT, and security

A Zero Trust identity-based connectivity platform that replaces your legacy VPN, SASE, and PAM and connects remote teams, multi-cloud environments, CI/CD pipelines, Edge & IoT devices, and AI workloads.

https://tailscale.com/

demos

image

性能优化

  1. 使用 USB SSD 启动 Raspberry Pi

https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#usb-mass-storage-boot

  1. 开启 module compile cache
$ grep -q 'NODE_COMPILE_CACHE=/var/tmp/openclaw-compile-cache' ~/.bashrc || cat >> ~/.bashrc <<'EOF' # pragma: allowlist secret
export NODE_COMPILE_CACHE=/var/tmp/openclaw-compile-cache
mkdir -p /var/tmp/openclaw-compile-cache
export OPENCLAW_NO_RESPAWN=1
EOF

$ source ~/.bashrc
  1. 减少 memory 使用
$ echo 'gpu_mem=16' | sudo tee -a /boot/config.txt

# 禁用蓝牙 💩
$ sudo systemctl disable bluetooth

https://docs.openclaw.ai/install/raspberry-pi#performance-tips

OpenClaw 配置

$ cat ~/.openclaw/openclaw.json
# 🚀 直接修改配置文件
$ sudo vim ~/.openclaw/openclaw.json

# ⚠️ 直接 CLI 命令行修改
$ openclaw config get agents.defaults.workspace
$ openclaw config set agents.defaults.heartbeat.every "2h"
$ openclaw config unset plugins.entries.brave.config.webSearch.apiKey

# 💩 命令行交互式修改
# full onboarding flow
$ openclaw onboard

# config wizard
$ openclaw configure

https://docs.openclaw.ai/gateway/configuration

feishu bot

https://docs.openclaw.ai/gateway/configuration

$ openclaw plugins install @openclaw/feishu

https://docs.openclaw.ai/channels/feishu

timezone

Ubuntu Linux 通过命令查看时区 timezone

xgqfms@ai2026:~$ timedatectl
               Local time: 五 2026-03-27 14:08:57 CST
           Universal time: 五 2026-03-27 06:08:57 UTC
                 RTC time: 五 2026-03-27 06:08:57
                Time zone: Asia/Shanghai (CST, +0800)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no
xgqfms@ai2026:~$ cat /etc/timezone
Asia/Shanghai
xgqfms@ai2026:~$ ls -l /etc/localtime
lrwxrwxrwx 1 root root 33  3月 11 21:38 /etc/localtime -> /usr/share/zoneinfo/Asia/Shanghai

xgqfms@ai2026:~$ date
2026年 03月 27日 星期五 14:08:46 CST
xgqfms@ai2026:~$ date -R
Fri, 27 Mar 2026 14:08:49 +0800

image

refs

©xgqfrms 2012-2021

www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!

原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!