1. Why Run OpenClaw on a Mac Mini?
Cloud VPS providers charge by compute time and add GPU surcharges for AI inference. A Mac Mini M4 gives you dedicated Apple Silicon at a flat $85/month, no pay-per-call surprises, full SSH access, and the ability to run local LLMs alongside OpenClaw for near-zero inference cost.
| Feature | Cloud VPS (AI tier) | Mac Mini M4 (MyRemoteMac) |
|---|---|---|
| Monthly Cost | GPU-tier pricing (varies) | $85/mo (flat rate) |
| Local LLM Support | Extra cost / limited | Native (Ollama, llama.cpp) |
| Always-On Uptime | Yes | Yes (99.9% SLA) |
| Apple Integrations | None | iMessage, Shortcuts, Automator |
| Setup Complexity | Medium | Low (SSH access included) |
| Privacy | Shared datacenter | Dedicated hardware |
Key Advantage: Unlike a cloud VPS, your Mac Mini M4 runs Ollama or llama.cpp natively on Apple Silicon. You can route OpenClaw to a local LLM for sensitive tasks, then fall back to Claude for complex queries, all without paying per token.
2. Prerequisites
Before you begin, make sure you have the following:
- A Mac Mini M4 server (from $85/mo) or Mac mini M6 (from $149/mo) from MyRemoteMac
- SSH access to your Mac Mini (provided with your MyRemoteMac subscription)
- An Anthropic API key (for Claude), get one at console.anthropic.com
- A messaging account on Telegram, Discord, or WhatsApp to connect your agent
- Basic familiarity with terminal commands and editing a JSON5 config file (~/.openclaw/openclaw.json)
3. Step 1: Connect to Your Mac Mini and Install Node.js
First, SSH into your Mac Mini M4. You will have received your credentials when you set up your MyRemoteMac server.
Connect via SSH
# Connect to your Mac Mini M4
ssh admin@your-server-ip
# Verify you're on Apple Silicon
uname -m
# Expected output: arm64
# Check macOS version (official Node.js 24/26 macOS binaries need macOS 13.5+)
sw_vers
# ProductName: macOS
# ProductVersion: 15.4
Install Node.js with Homebrew
# Install Node.js 26 with Homebrew (documented method on macOS)
# Homebrew missing? /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install node
# Must print v26.x (or v24.16+). Node 22, 23 and 25 are unsupported.
node --version
# v26.x.x
npm --version
Install a Supported Node.js (26.1+ or 24.16+)
OpenClaw needs Node.js 26.1+ (recommended) or 24.16+, Node 22, 23 and 25 are unsupported since release 2026.9.3. Homebrew is the documented method on macOS. If you prefer nvm, install Node 26 (never --lts) and make sure nvm is initialised in ~/.zshrc, or openclaw will not be on your PATH:
# Prefer nvm? Target Node 26: never --lts
nvm install 26
nvm alias default 26
# nvm must be initialised in ~/.zshrc, otherwise `openclaw` is not on PATH in new sessions
echo 'export NVM_DIR="$HOME/.nvm"; [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"' >> ~/.zshrc
Verify the Installation
# Confirm Node.js is running on Apple Silicon
node -e "console.log(process.platform, process.arch)"
# darwin arm64
4. Step 2: Install OpenClaw and Configure Claude API Key
With Node.js ready, install the OpenClaw CLI globally, there is no project-local install. OpenClaw is distributed as the npm package openclaw; a one-line installer (openclaw.ai/install.sh) is also available and provisions Node 26 for you if it is missing.
Install OpenClaw
# Option A: one-line installer (provisions Node 26 if missing, then launches the wizard)
curl -fsSL https://openclaw.ai/install.sh | bash
# (append `-s -- --no-onboard` to skip the wizard)
# Option B: global npm install (you manage Node)
npm install -g openclaw@latest --allow-scripts=openclaw
# omit --allow-scripts on npm <= 11.15
openclaw --version
# 2026.9.6
Run the Onboarding Wizard
OpenClaw reads its settings from ~/.openclaw/openclaw.json (JSON5). Do not write it by hand: the onboarding wizard creates it, asks for your Anthropic API key, checks model access and registers the launchd service in one go:
# Onboarding wizard + launchd service in one go
openclaw onboard --install-daemon
# Non-interactive over SSH (key from console.anthropic.com):
export ANTHROPIC_API_KEY="sk-ant-YOUR_API_KEY_HERE"
openclaw onboard --anthropic-api-key "$ANTHROPIC_API_KEY" --install-daemon
# Choose the default Claude model (provider/model format)
openclaw models set anthropic/claude-sonnet-5
# cheaper: openclaw models set anthropic/claude-haiku-4-5
openclaw models status
# Settings now live in ~/.openclaw/openclaw.json (JSON5). After any hand edit:
openclaw doctor --fix
Paste your key from console.anthropic.com when the wizard asks (or pass it with --anthropic-api-key). Model ids need the provider prefix: use anthropic/claude-sonnet-5 for complex tasks or anthropic/claude-haiku-4-5 for faster, cheaper responses, OpenClaw's fresh-setup default is anthropic/claude-opus-5-5.
Verify the Gateway and Send a First Message
# Check the Gateway service installed by --install-daemon
openclaw gateway status
# Runtime: running
# Connectivity probe: ok
# Send a first message through the running Gateway
openclaw agent --agent main --message "Hello, are you alive?"
# Control UI from your laptop, the Gateway stays loopback-only on 127.0.0.1:18789
ssh -N -L 18789:127.0.0.1:18789 admin@your-server-ip
# then open http://127.0.0.1:18789 (or run `openclaw dashboard` over VNC)
5. Step 3: Connect Messaging Channels
OpenClaw supports Telegram, Discord, WhatsApp, iMessage, Slack, Signal, Microsoft Teams, Google Chat and 20+ more channels. Telegram is bundled and the fastest to get working, create a bot via @BotFather, add the token, then approve your first DM with the pairing code the bot sends back:
# Step 1: Open Telegram and search for @BotFather
# Step 2: Send /newbot and follow the prompts
# Step 3: Copy the token (format: 1234567890:AAF...)
# Test your bot token is valid:
curl -s "https://api.telegram.org/botYOUR_TOKEN/getMe"
# {"ok":true,"result":{"id":...,"first_name":"My Agent","username":"myagent_bot",...}}
# Add the channel (Telegram is bundled: nothing to install)
openclaw channels add --channel telegram --token YOUR_TELEGRAM_BOT_TOKEN
openclaw channels status --probe
# DM your bot once: it answers with a pairing code. Approve it:
openclaw pairing approve telegram <CODE>
# Groups: disable Privacy Mode via BotFather (/setprivacy) or make the bot a group admin
Connect Discord
To connect a Discord bot, create an application in the Discord Developer Portal, enable the Message Content Intent (required) and invite it with the bot + applications.commands scopes. Install the official plugin, reference the token from the DISCORD_BOT_TOKEN environment variable and approve your first DM:
# In Discord Developer Portal (https://discord.com/developers/applications):
# 1. Create a New Application and give it a name
# 2. Open the Bot page, click Reset Token and copy the token (despite the name, it creates your first token)
# 3. Enable "Message Content Intent" (required) and "Server Members Intent" (recommended)
# 4. Under OAuth2 > URL Generator select scopes bot + applications.commands,
# permissions View Channels, Send Messages, Read Message History, Embed Links, Attach Files
# 5. Use the generated URL to invite the bot to your server
# Install the official plugin and reference the token from an env var
openclaw plugins install @openclaw/discord
cat > ./discord.patch.json5 << 'EOF'
{ env: { vars: { DISCORD_BOT_TOKEN: "YOUR_DISCORD_BOT_TOKEN" } },
channels: { discord: { enabled: true, token: { source: "env", provider: "default", id: "DISCORD_BOT_TOKEN" } } } }
EOF
openclaw config patch --file ./discord.patch.json5
rm ./discord.patch.json5 # the token now lives in ~/.openclaw/openclaw.json: do not leave a copy behind
# Approve your first DM
openclaw pairing approve discord <CODE>
# WhatsApp (optional, QR login, do it over VNC, use a separate number):
# openclaw plugins install @openclaw/whatsapp && openclaw channels login --channel whatsapp
6. Step 4: Run as a Persistent launchd Service
For 24/7 operation, the OpenClaw Gateway must start automatically on boot and restart on failure. OpenClaw handles this itself: openclaw gateway install (or the --install-daemon flag from Step 2) registers a supervised launchd LaunchAgent named ai.openclaw.gateway in ~/Library/LaunchAgents/, never write the plist by hand.
Install the Gateway Service
If you skipped --install-daemon in Step 2, register the service now. Then disable macOS sleep so the Gateway survives maintenance-sleep network flaps (official recommendation):
# Register the supervised LaunchAgent ai.openclaw.gateway
# (skip if you already ran `openclaw onboard --install-daemon`)
openclaw gateway install
# The plist lives at ~/Library/LaunchAgents/ai.openclaw.gateway.plist: do not edit it by hand
# Keep the Mac awake: avoids maintenance-sleep network flaps (official recommendation)
sudo pmset -a sleep 0 disksleep 0 standby 0 powernap 0
Manage the Service
openclaw gateway status --deep # CLI vs service version, port, runtime
openclaw gateway restart # never chain `stop` + `start` as a restart
openclaw gateway stop # add --disable to keep it off across reboots
openclaw gateway install --runtime node --force # retarget the service after a Node.js change
Verify the Service is Running
openclaw gateway status
# Runtime: running
# Connectivity probe: ok
openclaw gateway health
# Live logs
openclaw logs --follow
# Files: /tmp/openclaw/openclaw-YYYY-MM-DD.log and ~/Library/Logs/openclaw/gateway.log
# Raw launchd view (troubleshooting only)
launchctl print gui/$UID/ai.openclaw.gateway
Update OpenClaw
# Back up your state first (automatic config copies are not a full backup)
cp -R ~/.openclaw ~/openclaw-backup-$(date +%F)
# Update: stages the package, validates config, runs doctor, restarts the Gateway
openclaw update
openclaw doctor
openclaw gateway restart
openclaw health
# Prefer the LTS-equivalent line (currently 2026.7.35):
# openclaw update --channel extended-stable
7. Troubleshooting Common Issues
Gateway refuses to start or shows a version mismatch
An invalid ~/.openclaw/openclaw.json (a single unknown key is enough) makes the Gateway refuse to start, and a Node.js change can leave the CLI and the service on different versions. Run the built-in diagnostics and repair the service:
# Validate and auto-repair the config
openclaw doctor --fix
# CLI vs service version skew
openclaw gateway status --deep
openclaw logs --follow
# Re-register the service on the new Node.js after a runtime change
openclaw gateway install --runtime node --force
Claude API returns 401 Unauthorized
Your API key is missing, incorrect, or your Anthropic account has no remaining credits. Check the provider status from OpenClaw first, then test the key directly if needed:
# Check provider auth from OpenClaw
openclaw models status
openclaw doctor
# Optional: test the key directly
curl https://api.anthropic.com/v1/messages \
-H "x-api-key: YOUR_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{"model":"claude-haiku-4-5","max_tokens":10,"messages":[{"role":"user","content":"Hi"}]}'
# Expected: {"id":"msg_...","type":"message",...}
# If you get 401: check your key at console.anthropic.com
Telegram bot stops responding
The bot token may have been revoked, your DM is still waiting for pairing approval, or the Gateway has stopped. Probe the channel, approve pending pairings and restart:
# Verify the bot token is still valid
curl -s "https://api.telegram.org/botYOUR_TOKEN/getMe"
# Probe the channel and approve any pending pairing
openclaw channels status --probe
openclaw pairing approve telegram <CODE>
# Restart the Gateway
openclaw gateway restart
# If the token was revoked, generate a new one via @BotFather (/mybots > API Token)
Bot goes quiet after a few hours on macOS
macOS maintenance sleep can drop the network (ENETDOWN) and silence channels until you touch the Mac. Disable sleep, check the stability logs, watch for memory-pressure warnings and add the official launchd watchdog:
# Disable macOS maintenance sleep (ENETDOWN network flaps)
sudo pmset -a sleep 0 disksleep 0 standby 0 powernap 0
# Stability logs and memory-pressure warnings
ls ~/.openclaw/logs/stability/
grep -i "memory pressure" /tmp/openclaw/openclaw-$(date +%F).log
# Official liveness watchdog: re-arm launchd's respawn gate
launchctl kickstart -k gui/$UID/ai.openclaw.gateway
8. Cost Analysis vs. Cloud VPS
Here is a realistic cost comparison for running an AI agent 24/7 at different usage levels:
| Use Case | AI Calls/Month | Cloud VPS Cost | MyRemoteMac Cost | Monthly Savings |
|---|---|---|---|---|
| Personal assistant | ~500 calls | $120/mo (basic GPU VPS) | $85/mo | $45/mo |
| Small team bot | ~5,000 calls | $200/mo | $85/mo | $125/mo |
| Local LLM + agent | Unlimited (local) | $350+/mo (GPU VPS) | $85/mo | $275+/mo |
| Multi-agent system | 10,000+ calls | $600+/mo | $229/mo (M4 Pro) | $371+/mo |
Bottom Line: Running OpenClaw on a Mac Mini M4 is significantly cheaper than a GPU cloud VPS. You also get native Apple Silicon for local LLMs via Ollama, route non-sensitive tasks to a local model (openclaw models set ollama/gemma4) and point the built-in 30-minute heartbeat at anthropic/claude-haiku-4-5 to keep the idle API bill low.
Sources (official OpenClaw documentation)
- docs.openclaw.ai/install
- docs.openclaw.ai/install/node
- docs.openclaw.ai/gateway/configuration
- docs.openclaw.ai/providers/anthropic
- docs.openclaw.ai/channels/telegram/setup
- docs.openclaw.ai/channels/discord/setup
- docs.openclaw.ai/cli/agent
- docs.openclaw.ai/cli/gateway/service
- docs.openclaw.ai/gateway/troubleshooting/gateway-service-and-process
- docs.openclaw.ai/cli/update
- docs.openclaw.ai/gateway/heartbeat
- platform.claude.com, Claude models overview
Related Guides
Run LLMs on Mac Mini M4
Run Ollama, llama.cpp, and local language models natively on Apple Silicon for zero-cost AI inference.
Mac Mini as AI & ML Server
Turn your Mac Mini into a private AI inference server for machine learning workloads.
Run Hermes Agent 24/7 on a Mac mini
Nous Research's self-improving open-source agent: one-line installer, Telegram/Discord gateway, launchd service, optional local Ollama.