You want OpenClaw — the personal AI agent that actually does things (openclaw.ai) — running on your own Mac instead of trusting a hosted control plane with your shell, your browser, and your private notes. You read the one-line installer, you ran it, and now you have an openclaw binary on your PATH and a half-configured gateway that dies the moment you close the Terminal window. This walks the install end to end on a clean macOS install — Node toolchain, persistent config under ~/.openclaw/, launchd auto-start, log routing, and the doctor checks that tell you whether the agent actually has the permissions it claims.
Scenario
You’re an operator, a developer, or someone who lives in a terminal and you want a persistent personal agent on your daily-driver Mac. The Mac is on most of the day, occasionally goes to sleep, sometimes reboots after an update. You want the agent to come back up automatically, keep its memory across reboots, and run as your user (not root), because everything it does — open Safari, write to ~/Documents, send a Telegram message — has to map to your existing macOS permission model.
Outcome and prereqs
When this is done you’ll have:
- OpenClaw installed globally from npm, pinned to a known Node version.
- A populated
~/.openclaw/directory:openclaw.json,.envfor API keys,workspace/, and alogs/directory. - A launchd user agent at
~/Library/LaunchAgents/ai.openclaw.gateway.plistthat runsopenclaw gateway --port 18789at login, restarts on crash, and writes stdout/stderr to~/.openclaw/logs/. - A passing
openclaw doctorrun that confirms model access, daemon health, and chat-channel pairings.
Prereqs:
- macOS 13 Ventura or newer. The optional companion app needs macOS 15+.
- Admin (
sudo) rights for one Homebrew step. - An API key for at least one of Anthropic Claude or OpenAI, or a working local model server (Ollama at
http://127.0.0.1:11434). - ~2 GB of free disk for Node, the global npm tree, and a typical first-month workspace.
Time and resource footprint
About 20 minutes of attended time. Steady-state on an M-series Mac, the gateway sits under 200 MB resident memory and uses negligible CPU when idle. Each agent turn drives CPU during the model round trip; the model itself either runs in your cloud account (Anthropic/OpenAI) or in Ollama next to it.
Step 1 — Install Node 24 with Homebrew (or nvm)
OpenClaw recommends Node 24 with Node 22.16+ as the supported floor (openclaw README). Pick one of the two paths below.
Homebrew (simple, system-wide):
# Install Homebrew if you don't have it
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install Node 24
brew install node@24
brew link --overwrite --force node@24
node --version # v24.x.x
npm --version
nvm (per-user, version-pinnable):
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
# Reload your shell or:
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
nvm install 24
nvm alias default 24
node --version # v24.x.x
Prefer nvm if your machine already serves multiple Node-based projects on older versions. Mixing system Homebrew Node with project-level nvm Node ends in EACCES errors against /usr/local/lib/node_modules — pick one and stay there.
Step 2 — Install OpenClaw
Run the one-liner from openclaw.ai, then the global package:
curl -fsSL https://openclaw.ai/install.sh | bash
npm i -g openclaw
openclaw --version
The installer probes your system, ensures the toolchain is sane, and prepares ~/.openclaw/. npm i -g openclaw is the official global install path (openclaw GitHub README); on a fresh Mac with Homebrew Node you may not need sudo because Homebrew puts the global prefix under /opt/homebrew.
Step 3 — Onboard
openclaw onboard
The onboarding flow asks for your default model (anthropic/claude-sonnet-4-5, openai/gpt-5, ollama/llama3.1:70b, etc.), the API key for that provider, and whether to install the user daemon. Pick yes to the daemon — it creates the launchd plist for you in ~/Library/LaunchAgents/. You can also do the daemon step manually (Step 5 below) if you want to control the plist content.
After onboarding, the layout under ~/.openclaw/ looks like:
~/.openclaw/
├── openclaw.json # model config, workspace path, defaults
├── .env # API keys, never world-readable
├── workspace/
│ ├── AGENTS.md # injected agent system prompt
│ ├── SOUL.md # personality/values
│ ├── TOOLS.md # tool inventory
│ └── skills/ # custom skills
├── memory/ # persistent agent memory
└── logs/ # stdout/stderr per process
Lock down .env:
chmod 600 ~/.openclaw/.env
A minimal ~/.openclaw/openclaw.json looks like (openclaw README):
{
"agent": {
"model": "anthropic/claude-sonnet-4-5"
}
}
Step 4 — First run
openclaw gateway --port 18789 --verbose
This is the foreground run. You should see lines like gateway listening on 127.0.0.1:18789 and a model-handshake confirmation. In another terminal, talk to the agent:
openclaw agent --message "What is my hostname?" --thinking high
You should get a real shell-executed answer. Ctrl-C to stop the gateway — the next step makes it persistent.
Step 5 — Install the launchd user agent
If openclaw onboard --install-daemon already wrote ~/Library/LaunchAgents/ai.openclaw.gateway.plist, you can skip ahead to load it. Otherwise, write your own. Save the following at ~/Library/LaunchAgents/ai.openclaw.gateway.plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>ai.openclaw.gateway</string>
<key>ProgramArguments</key>
<array>
<string>/opt/homebrew/bin/openclaw</string>
<string>gateway</string>
<string>--port</string>
<string>18789</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<dict>
<key>SuccessfulExit</key>
<false/>
<key>Crashed</key>
<true/>
</dict>
<key>EnvironmentVariables</key>
<dict>
<key>HOME</key>
<string>/Users/your-username</string>
<key>PATH</key>
<string>/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin</string>
</dict>
<key>WorkingDirectory</key>
<string>/Users/your-username</string>
<key>StandardOutPath</key>
<string>/Users/your-username/.openclaw/logs/gateway.out.log</string>
<key>StandardErrorPath</key>
<string>/Users/your-username/.openclaw/logs/gateway.err.log</string>
<key>ProcessType</key>
<string>Interactive</string>
</dict>
</plist>
Replace /Users/your-username with your actual home path and adjust the binary path if you used nvm (something like /Users/your-username/.nvm/versions/node/v24.x.x/bin/openclaw — which openclaw tells you). The KeepAlive dictionary asks launchd to restart the process when it crashes but not when you stop it cleanly (launchctl unload), so you can do maintenance without fighting the supervisor. The plist key semantics are documented in the launchd.plist(5) man page.
Load it:
mkdir -p ~/.openclaw/logs
launchctl unload ~/Library/LaunchAgents/ai.openclaw.gateway.plist 2>/dev/null
launchctl load ~/Library/LaunchAgents/ai.openclaw.gateway.plist
launchctl list | grep ai.openclaw.gateway
# Output: PID 0 ai.openclaw.gateway
Verify the listener:
lsof -nP -iTCP:18789 -sTCP:LISTEN
# COMMAND PID USER ... NAME
# node ### you ... TCP 127.0.0.1:18789 (LISTEN)
The gateway binds on 127.0.0.1 by default — local-only. If you need access from other devices on your home network, use Tailscale rather than rebinding to 0.0.0.0 (see the OpenClaw + Tailscale guide).
Verification
openclaw doctor
openclaw doctor checks Node version, gateway reachability, configured providers, API-key validity, chat-channel pairings, and DM policy. It’s the canonical “is this Mac actually serving the agent” command. A healthy report ends with a row of green checks; anything red points you at the specific subsystem.
A quick smoke test that exercises the whole stack:
openclaw agent --message "List the three largest files under ~/Downloads and summarize their types"
You should see the agent run a real du/find-style command, capture the output, and produce a written summary. If it returns a textual guess without ever executing a shell command, the shell-tool permission isn’t wired — re-run openclaw onboard and grant shell access.
Tail the log to confirm launchd is keeping it alive:
tail -f ~/.openclaw/logs/gateway.err.log
Kill the process by PID, watch launchd respawn it within a second.
Rollback
To uninstall cleanly:
launchctl unload ~/Library/LaunchAgents/ai.openclaw.gateway.plist
rm ~/Library/LaunchAgents/ai.openclaw.gateway.plist
npm uninstall -g openclaw
# Optional: keep your config in case you want to come back
mv ~/.openclaw ~/.openclaw.disabled.$(date +%F)
The ~/.openclaw.disabled.<date> directory holds your memory store, skills, and openclaw.json — that’s the entire stateful surface to back up before doing anything destructive.
Troubleshooting
“command not found: openclaw” after npm i -g openclaw. The global prefix isn’t on your shell PATH. npm config get prefix shows where global binaries land — add <prefix>/bin to your ~/.zshrc.
Gateway dies immediately under launchd, runs fine in a Terminal. The launchd environment is minimal; in particular, PATH and HOME default to almost nothing. Either set them explicitly in EnvironmentVariables (as in the plist above) or invoke a wrapper script that sources your shell profile first. The launchd.plist(5) man page is explicit that environment is not inherited from your login session.
Gatekeeper prompts when the agent opens Safari or runs an AppleScript. This is expected — System Settings → Privacy & Security → Automation will list node (or the wrapper) as requesting control of Safari, Mail, Calendar, etc. Approve only the apps you want the agent to touch. Don’t blanket-approve node; the agent has been known to test the edges.
openclaw doctor reports “Node version 22.16.x — minimum supported.” It runs, but you’re below the recommended Node 24 floor. Upgrade with brew install node@24 or nvm install 24 and re-link.
Two Node installs colliding. which -a openclaw may show both /opt/homebrew/bin/openclaw and ~/.nvm/versions/node/v24.x.x/bin/openclaw. Pick one. The launchd plist will run whichever path is hard-coded in ProgramArguments, regardless of what your interactive shell resolves.
Plist syntax error. plutil -lint ~/Library/LaunchAgents/ai.openclaw.gateway.plist parses the file and reports the exact offset of any malformed XML.
Production-readiness
For a personal Mac, “production” means: the gateway survives sleep/wake, you have your config and memory store backed up, and openclaw doctor runs green after every macOS point release. A short checklist:
~/.openclaw/included in your Time Machine or restic backup target. Don’t back uplogs/— it churns and contains conversation excerpts.- A monthly
openclaw doctorreminder; macOS auto-updates ofnodeor shifts in Homebrew prefix paths are the single most common cause of a silently-degraded agent. - Telegram/WhatsApp/Signal pairings re-verified after each major OpenClaw release.
- API-key rotation calendar — Anthropic and OpenAI both let you set expiry dates; use them.
For teams that want this hardened, monitored, and on-call covered without owning the Mac yourself, talk to a senior operator at Stack Harbor about your self-hosted OpenClaw setup.
Related
- Running OpenClaw as a launchd service on macOS — the deep dive on the plist itself.
Sources
- OpenClaw home and one-liner installer —
https://openclaw.ai. - OpenClaw README, install commands, daemon flags, config schema —
https://github.com/openclaw/openclaw. launchd.plist(5)man page — Apple developer documentation onKeepAlive,RunAtLoad,EnvironmentVariables.- Homebrew Node formula —
https://formulae.brew.sh/formula/node. - nvm —
https://github.com/nvm-sh/nvm.
Last verified on OpenClaw current (May 2026).