Work through each phase in order. Do not skip the security verification.
SSH into your Pi and verify the environment is clean:
# Node.js — 22.x is fine, script will upgrade to 24
node --version
# iptables OUTPUT chain — should be clean (no DROP rules yet)
sudo iptables -L OUTPUT
# openclaw user — should not exist yet
cat /etc/passwd | grep openclaw
# fan_control.py — should already be deployed if fan is set up
ls /usr/local/bin/fan_control.py
# Tailscale — Pi and Mac both must be connected
tailscale statusIf fan_control.py is missing, the script will deploy it from fan/fan_control.py.
If openclaw user exists, the script will warn and skip creation (idempotent).
bash scripts/setup-openclaw.shThe script will pause before applying services and ask for confirmation.
Read the summary carefully before typing y.
These steps cannot be automated. They require browser interaction or secret entry.
If ANTHROPIC_API_KEY was left blank in .env, a dummy token was written.
You must run both of these commands:
# Step 1: get a subscription token via the Claude CLI browser flow
as-openclaw claude setup-token
# Step 2: register that token with OpenClaw (will prompt you to paste it)
as-openclaw openclaw models auth paste-token --provider anthropic
# Verify it worked
as-openclaw openclaw models status
as-openclawis a helper installed by the setup script. It runs any command as theopenclawuser with the correct environment.
claude setup-token prints a URL. Open it in a browser, log in with your Anthropic account,
approve access, and copy the long-lived token it gives you. Then paste it when
paste-token prompts you.
Note: if you prefer a plain API key, set ANTHROPIC_API_KEY in
/etc/openclaw/secrets.env (mode 600) and restart the gateway instead.
sudo nano /etc/openclaw/secrets.env
# Confirm TELEGRAM_BOT_TOKEN is correctly setsudo systemctl restart openclaw-gateway
sleep 5
sudo systemctl status openclaw-gateway # must show: active (running)If it shows active (running) but then fails shortly after, check the logs:
sudo journalctl -u openclaw-gateway -n 30 --no-pagerCommon issues seen during real installs:
| Error in log | Fix |
|---|---|
Unable to create fallback OpenClaw temp dir |
/tmp not writable — check ReadWritePaths in service override includes /tmp |
Gateway start blocked: set gateway.mode=local |
Run as-openclaw openclaw config set gateway.mode local then restart |
Invalid config … Unrecognized key |
Run as-openclaw openclaw doctor --fix then restart |
- Open Telegram and send any message to your bot.
- The bot replies with a pairing code.
- Back on the Pi, approve it:
as-openclaw openclaw pairing list telegram
as-openclaw openclaw pairing approve telegram <code># LAN block is active
sudo iptables -L OUTPUT | grep DROP
# openclaw cannot reach LAN (must fail/timeout)
as-openclaw curl -m 3 http://192.168.0.1
# openclaw CAN reach internet (must connect)
as-openclaw curl -m 5 https://api.anthropic.com
# fan control service is running
sudo systemctl status fan-control
# openclaw cannot touch fan controller directly (must be denied)
as-openclaw python3 /usr/local/bin/fan_control.py
# fan status read-only wrapper works (must print temp and fan speed)
as-openclaw sudo /usr/local/bin/fan-status
# OpenClaw gateway status
as-openclaw openclaw gateway status
# Model and auth verification
as-openclaw openclaw models statusAll checks must pass before you proceed.
- Ensure Tailscale is running on your Mac.
- Open in browser:
https://${TAILSCALE_HOSTNAME} - You should see the OpenClaw Control UI.
If it does not load, check:
sudo systemctl status openclaw-gatewayon the Pitailscale statuson both devices- Tailscale Serve is configured (the script sets this up)
| Task | Command |
|---|---|
| View OpenClaw logs | sudo journalctl -u openclaw-gateway -f |
| View fan logs | sudo journalctl -u fan-control -f |
| Update OpenClaw | as-openclaw openclaw update --channel stable |
| Renew Anthropic token | as-openclaw claude setup-token then as-openclaw openclaw models auth paste-token --provider anthropic |
| Gateway status | as-openclaw openclaw gateway status |
| Model/auth status | as-openclaw openclaw models status |
| Health check | as-openclaw openclaw doctor |
| Token usage | Send /status to your Telegram bot |
| Compact session | Send /compact to your Telegram bot |
| Verify iptables survived reboot | sudo iptables -L OUTPUT | grep DROP |
Stop and investigate if you observe any of the following:
openclawprocess using >500MB RAM consistentlyfan-controlservice shown as inactive or failedas-openclaw openclaw doctorreporting auth errors- DROP rule missing from iptables OUTPUT after reboot
- Bot responding with model errors (run
as-openclaw claude setup-tokenagain) /etc/openclaw/secrets.envpermissions are not 600