Browse guides
Back to Guides
BeginnerGetting StartedOpenClaw

OpenClaw on Mac Mini: Complete Setup Guide

A guide to setting up OpenClaw on a Mac Mini M4: hardware recommendations, macOS preparation, installation, daemon configuration, and headless operation.

Sam Okafor45 minutes

#Why Mac Mini M4 for OpenClaw?

The Mac Mini M4 has become the de facto standard hardware for running OpenClaw in production. With its compact form factor, low power consumption (as low as 5W idle), and Apple Silicon performance, it is the ideal always-on host for your autonomous AI agent. The community overwhelmingly recommends it, and Peter Steinberger (OpenClaw's creator) himself runs his primary agent on one.

OpenClaw does not run AI models locally: it connects to LLM providers like Anthropic and OpenAI via API keys. The Mac Mini serves as the always-on host that runs the Gateway engine, manages messaging channels, executes skills, and keeps your agent alive 24/7.

Use CaseModelRAMStorageEstimated Cost
Personal agentMac Mini M416 GB256 GB~$499
Power user / multi-agentMac Mini M4 Pro24 GB512 GB~$1,399
Heavy workloads / developmentMac Mini M4 Pro48 GB1 TB~$1,999

For most users, the base Mac Mini M4 with 16 GB of unified memory is more than sufficient. The heavier lifting happens on the LLM provider's servers, not on the Mini: the Gateway's job is to hold channel connections open, schedule automations, and shuttle turns to and from the model. OpenClaw's docs publish no RAM or CPU figure for the Gateway, so treat any number you see quoted in the community as a local measurement rather than a spec.

If you plan to run additional services alongside OpenClaw (Home Assistant, Plex, development servers), consider the M4 Pro with 24 GB. If you intend to run multiple OpenClaw agents simultaneously, 24 GB or more is recommended.


#Step 1: Prepare macOS for Always-On Operation

A Mac Mini running OpenClaw should never sleep. The agent needs to be available around the clock to respond to messages, execute scheduled tasks, and run heartbeat cycles.

#Disable Sleep and Energy Saver Settings

Open System Settings > Energy and configure the following:

  • Set Turn display off after to Never (or 1 minute if you have a display connected, because the display sleeping is fine)
  • Disable Put hard disks to sleep when possible
  • Enable Prevent automatic sleeping when the display is off
  • Enable Start up automatically after a power failure
  • Enable Wake for network access

You can also configure these settings from the terminal:

$sudo pmset -a sleep 0 disksleep 0 displaysleep 1 womp 1 autorestart 1

Verify your settings:

$pmset -g

#Enable Automatic Login

For headless operation (no monitor, keyboard, or mouse), you want the Mac Mini to boot straight to the desktop:

  1. Open System Settings > Users & Groups
  2. Click Automatic Login and select your user account
  3. Enter your password to confirm

Automatic login requires FileVault to be disabled. If you need FileVault encryption (recommended for security), you will need to enter the password on each reboot. A compromise is to use Tailscale for remote access and accept that a power failure requires physical access to unlock. See the Security Hardening guide for more details.

#Disable Software Update Auto-Restart

macOS can automatically install updates and restart your machine, which would take your agent offline:

  1. Open System Settings > General > Software Update
  2. Click Automatic Updates
  3. Disable Install macOS updates
  4. Keep Download new updates when available enabled so you can install them on your schedule

Running OpenClaw under a dedicated macOS user account provides better security isolation. This is optional but recommended.

  1. Create the account

    Open System Settings > Users & Groups. Click Add Account. Create a Standard user named 'openclaw' with a strong password.

  2. Enable automatic login for this account

    Set the 'openclaw' user as the automatic login account under System Settings > Users & Groups > Automatic Login.

  3. Log in as the new user

    Log out of your current account and log in as 'openclaw'. All subsequent steps should be performed as this user.

  4. Configure the home directory

    The user's home directory will be /Users/openclaw. All OpenClaw data, configuration, and skills will live here.


#Step 3: Install Prerequisites

#Install Homebrew

Homebrew is the package manager for macOS. If you do not already have it installed:

$/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

After installation, follow the instructions to add Homebrew to your PATH. For Apple Silicon Macs:

$echo "eval \"$(/opt/homebrew/bin/brew shellenv)\"" >> ~/.zprofile && eval "$(/opt/homebrew/bin/brew shellenv)"

#What Node.js Version Does OpenClaw Need?

The install docs list the supported runtimes as "Node 24.16+ or 26.1+", and recommend Node 26. Install a current Node via Homebrew:

$brew install node

Verify the installation:

$node --version

Anything below 24.16 is outside the supported range for the latest release listed as of September 19, 2026, so upgrade before you install OpenClaw rather than after.

#Install pnpm (Optional)

pnpm is one of the documented global install paths for OpenClaw, and it is handy for skill development:

$brew install pnpm

#Install Git

Git is required for skill management and updates:

$brew install git

#Step 4: Install OpenClaw

With prerequisites in place, use the documented installer script:

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

If you would rather install the package globally, the docs give an npm path and a pnpm path. On npm 12, the --allow-scripts flag is required because npm now blocks unapproved lifecycle scripts by default:

$npm install -g openclaw@latest --allow-scripts=openclaw
$pnpm add -g --allow-build=openclaw openclaw@latest

Either global install is followed by onboarding, which is also where the managed service gets installed:

$openclaw onboard --install-daemon

#What Does Onboarding Actually Ask?

openclaw onboard is documented as "Guided setup that establishes inference first: it detects existing AI access, waits for your provider choice, verifies that connection, persists only the working route, and then starts OpenClaw to configure the rest." The documented phases are:

  1. Security notice and agent naming
  2. Discovery access-level choice
  3. AI provider detection and selection: have an API key ready. See the API Key Setup Guide.
  4. Live connection verification: only a working route gets persisted.
  5. Memory import offer, if there is anything to import
  6. Standard setup application
  7. Plugin and skill recommendations
  8. Control UI dashboard handoff, or a terminal fallback

--install-daemon "starts the managed gateway install path first". Without a daemon flag, the docs note that a local gateway must already be running (for example openclaw gateway run). openclaw onboard --classic opens the full step-by-step wizard instead.

The docs do not name a default or recommended model for a new agent, so pick based on your own cost and capability trade-off rather than on a number quoted in a blog post. Messaging channels are configured after onboarding; see the Messaging Channels Guide.

#Where Does OpenClaw Put Its Files?

After installation, "Everything lives under $OPENCLAW_STATE_DIR (default: ~/.openclaw)", which the docs describe as holding "config, channel/provider state, auth profiles, sessions, logs". These are the paths the docs actually name:

text
~/.openclaw/
openclaw.json # Main configuration file
.env # Global environment fallback
secrets.json # Secret values referenced from config
credentials/oauth.json # OAuth credentials
state/openclaw.sqlite # Shared state database
skills/ # Shared managed skills
agents/<agentId>/agent/auth.json # Per-agent auth profile
agents/<agentId>/agent/openclaw-agent.sqlite
agents/<agentId>/sessions/ # Per-agent session records
workspace/ # Agent workspace (agents.defaults.workspace)

The agent workspace is a separate concept from the state directory, even though it sits inside it by default. Its documented default is OPENCLAW_WORKSPACE_DIR when set, otherwise <state-dir>/workspace, which is ~/.openclaw/workspace for a default install. Bootstrap writes these files:

text
~/.openclaw/workspace/
AGENTS.md # Operating rules, including a `## Tools` section
SOUL.md # Agent personality (optional bootstrap file)
IDENTITY.md # Name, role and avatar (optional bootstrap file)
USER.md # Context about you (optional bootstrap file)
BOOTSTRAP.md # First-run only
MEMORY.md # Curated long-term memory (optional)
BOOT.md # Optional
memory/YYYY-MM-DD.md # Daily memory files
skills/ # Optional workspace-local skills

A few things worth knowing, because older write-ups get them wrong:

  • There is no data/ or backups/ directory, and skills/ is not split into built-in, community and custom folders.
  • TOOLS.md and HEARTBEAT.md are retired. Local tool and environment notes "now live in the ## Tools section of AGENTS.md", and HEARTBEAT.md "is accepted but a no-op since heartbeat context moved to cron monitor scratch". See the Memory System Guide for the current heartbeat mechanism.
  • The .env at ~/.openclaw/.env is a global fallback: OpenClaw reads env vars from the parent process and additionally loads a .env from the current working directory plus that global fallback. Neither .env normally overrides an existing variable.
  • The optional bootstrap files (SOUL.md, USER.md, IDENTITY.md) can be skipped with agents.defaults.skipOptionalBootstrapFiles.

The persistent store is the shared SQLite database at ~/.openclaw/state/openclaw.sqlite.


#Step 5: Grant macOS Permissions

OpenClaw needs specific macOS permissions to function fully. Without these, certain skills and system interactions will fail silently.

#Full Disk Access

Full Disk Access allows OpenClaw to read and write files across your system, which is essential for file management skills.

  1. Open System Settings > Privacy & Security > Full Disk Access
  2. Click the + button
  3. Navigate to the OpenClaw binary (typically /usr/local/bin/openclaw or the path shown by which openclaw)
  4. Toggle it On

#Accessibility Access

Accessibility permissions enable OpenClaw to interact with the macOS UI, control applications, and use automation skills.

  1. Open System Settings > Privacy & Security > Accessibility
  2. Click the + button
  3. Add the OpenClaw binary
  4. Toggle it On

#Automation (Optional)

If you want OpenClaw to control other applications via AppleScript:

  1. Open System Settings > Privacy & Security > Automation
  2. Grant OpenClaw access to System Events and any specific applications

After granting permissions, you may need to restart the OpenClaw Gateway for the changes to take effect. Use openclaw gateway restart to do so.


#Step 6: Install the Daemon

The daemon ensures OpenClaw starts automatically when your Mac boots and stays running in the background. This is the critical step that makes your agent truly autonomous.

$openclaw gateway install

There is no bare openclaw --install-daemon. openclaw gateway install "installs and starts the service"; the --install-daemon flag belongs to onboarding, where it "starts the managed gateway install path first".

On macOS this installs a LaunchAgent. The documented label is ai.openclaw.gateway for the default profile (or ai.openclaw.<profile> for a named profile), and the plist lives at:

~/Library/LaunchAgents/ai.openclaw.gateway.plist

You can inspect it through launchd directly:

bash
launchctl print gui/$UID/ai.openclaw.gateway | grep -E "state|last exit|runs"

If restarts loop, check for a duplicate agent: the docs call out the case where both ~/Library/LaunchAgents/ai.openclaw.gateway.plist and ~/Library/LaunchAgents/ai.openclaw.node.plist are loaded at the same time.

#Verify the Daemon

Check that the Gateway is answering:

$openclaw health

openclaw health is documented as fetching "a health snapshot from the running Gateway over WebSocket RPC (no direct channel sockets from the CLI)". It takes --json for machine-readable output, --timeout <ms> (default 10000), and --verbose, which "forces a live probe and expands output across all configured accounts and agents". There is no --quiet flag, so scripts should parse --json rather than grep prose.

$openclaw health --json

#Managing the Daemon

Start, stop, or restart the service:

$openclaw gateway start
$openclaw gateway stop
$openclaw gateway restart

The Gateway runbook says to use openclaw gateway restart rather than chaining stop and start. gateway stop uses launchctl bootout by default; add --disable if you want the suppression to survive a reboot.

Check the service status:

$openclaw gateway status

openclaw gateway status --deep adds system-level service scanning, and openclaw doctor --fix audits and repairs service config drift.

View real-time logs. There is no openclaw gateway logs subcommand; openclaw logs tails "Gateway file logs over RPC" and follows with --follow:

$openclaw logs --follow

#Where Do the Log Files Live?

Not in ~/.openclaw/logs/, despite what a lot of setup posts claim. The documented default log file is /tmp/openclaw/openclaw-YYYY-MM-DD.log, with /tmp/openclaw/openclaw-<profile>-YYYY-MM-DD.log for named profiles. Point it somewhere durable in ~/.openclaw/openclaw.json if you want logs to survive a reboot:

json
{
"logging": {
"file": "/path/to/openclaw.log"
}
}

The state directory does get one log of its own: Gateway lifecycle mutations "append best-effort key-value audit records to <state-dir>/logs/gateway-restart.log".


#Step 7: Configure Headless Access with Tailscale

If your Mac Mini runs headless (no monitor or keyboard), you need a way to access it remotely. Tailscale is the recommended solution because it creates a secure, zero-config VPN mesh network.

#Install Tailscale

$brew install --cask tailscale

Open Tailscale from your Applications folder and sign in with your account. Your Mac Mini will appear on your Tailscale network with a stable IP address.

#Enable SSH Access

  1. Open System Settings > General > Sharing
  2. Enable Remote Login (SSH)
  3. Restrict access to Only these users and add your user account

Now you can SSH into your Mac Mini from any device on your Tailscale network:

bash
ssh openclaw@your-mac-mini.tailnet-name.ts.net

#Access the Control UI Remotely

OpenClaw serves its Control UI from the same port as the Gateway WebSocket: one port multiplexing "WebSocket + HTTP (Control UI, hooks, etc.)". The documented default is 18789, not 3420, and the precedence is --port > OPENCLAW_GATEWAY_PORT > gateway.port > 18789. The default bind mode is loopback.

Open it locally with:

$openclaw dashboard

That command is documented as opening "the Control UI with a short-lived, one-time owner pairing link. A successful handoff gives that signed browser a durable administrator device credential." Pass --no-open to print the URL without launching a browser.

Option A: SSH tunnel (keeps the bind on loopback)

bash
ssh -L 18789:localhost:18789 openclaw@your-mac-mini.tailnet-name.ts.net

Option B: Bind to the tailnet

There is no gateway.host key. Binding is controlled by gateway.bind, whose documented values are auto, loopback (default), lan (0.0.0.0), tailnet, or custom (one IPv4 address). The docs specifically recommend the tailnet mode here: "Use gateway.bind: \"tailnet\" to limit non-loopback exposure to the Tailnet while retaining the required same-host 127.0.0.1 listener."

Edit ~/.openclaw/openclaw.json and set:

json
{
"gateway": {
"bind": "tailnet",
"port": 18789
}
}

Gateway auth is required by default: "with no valid auth path configured, the Gateway refuses WebSocket connections (fail-closed)." The gateway.auth.mode values are token ("shared bearer token (recommended for most setups)"), password, and trusted-proxy. The docs warn that lan, tailnet and custom "expand the attack surface. Only use with gateway auth ... and a real firewall", advise preferring Tailscale Serve over LAN binds, and say to "never expose the Gateway unauthenticated on 0.0.0.0". Non-loopback Control UI deployments also require gateway.controlUi.allowedOrigins. See the Security Hardening guide.


#Step 8: Your First Interaction

With everything set up, it is time to talk to your agent. Open your configured messaging channel (e.g., Telegram) and send a message:

Hey, are you there?

Your agent should respond within a few seconds, drawing on its SOUL.md personality and any installed skills. Try a few things:

  • Ask a question: "What's the weather forecast for today?"
  • Give a task: "Remind me to call the dentist tomorrow at 2pm"
  • Test a skill: "Summarize the top stories on Hacker News"

If your agent does not respond, run openclaw doctor to diagnose the issue. This command checks API connectivity, messaging channel status, daemon health, and common configuration problems.


#Essential CLI Commands Reference

Here is a quick reference of the most important openclaw commands you will use day to day:

CommandDescription
openclaw healthShow agent health status
openclaw doctorDiagnose and report issues
openclaw doctor --fixDiagnose and attempt automatic fixes
openclaw gateway startStart the Gateway engine
openclaw gateway stopStop the Gateway engine
openclaw gateway restartRestart the Gateway engine
openclaw logs --followStream live Gateway logs
openclaw skills listList all installed skills
openclaw skills install <name>Install a skill from ClawHub
openclaw dashboardOpen the web dashboard
openclaw config filePrint the active openclaw.json path for your editor
openclaw gateway installInstall and start the managed service
openclaw gateway uninstallRemove the managed service
openclaw automations list --allList automation jobs, including disabled ones and the heartbeat monitor
openclaw automations scratch <jobId>Read or replace a job's private scratch (where heartbeat checklists live)
openclaw updateUpdate OpenClaw to the latest version

openclaw automations is an alias: the command "registers as openclaw cron with openclaw automations as an alias".


#Post-Installation Checklist

Before you consider your setup complete, verify each of these items:

  • macOS sleep is disabled and auto-restart on power failure is enabled
  • Node.js 24.16+ or 26.1+ is installed and on your PATH
  • OpenClaw is installed and the onboarding wizard is complete
  • At least one LLM provider API key is configured
  • At least one messaging channel is connected
  • macOS permissions (Full Disk Access, Accessibility) are granted
  • The daemon is installed and running (openclaw health shows healthy)
  • Remote access is configured (Tailscale + SSH)
  • You have successfully sent and received a message with your agent

#Next Steps

With your Mac Mini running OpenClaw, explore these guides to get the most out of your agent:


#Frequently Asked Questions

#Can I use an older Mac Mini?

The docs list macOS as a supported platform without naming a minimum OS version, so the binding constraint in practice is Node: the install docs require "Node 24.16+ or 26.1+". If your Mini can run a supported Node build, it can host the Gateway. The M4 still offers the best performance-per-watt for an always-on box.

#How much bandwidth does OpenClaw use?

The docs publish no bandwidth figure, so we will not invent one. The Gateway talks to LLM APIs over JSON, which is cheap; what actually moves the needle is skills that download or upload files. Measure your own host for a week rather than budgeting from a number you read somewhere.

#Can I run OpenClaw alongside other services?

Absolutely. The Mac Mini M4 has plenty of headroom. Many users run Home Assistant, Plex, Pi-hole, and development servers alongside OpenClaw without any issues.

#What happens during a power outage?

If you enabled Start up automatically after a power failure in System Settings and installed the managed service with openclaw gateway install, your Mac Mini will boot up and OpenClaw will start automatically when power returns. You may want to invest in a small UPS for graceful handling.

#How do I update OpenClaw?

Run openclaw update, documented as "Update OpenClaw and switch between stable/extended-stable/beta/dev channels." It restarts the Gateway service after a successful update unless you pass --no-restart, and package-manager updates that do restart "verify the restarted service reports the expected version before the command succeeds." Use --dry-run to preview the planned actions first. Always check the release notes before updating, as some versions may require configuration changes.

Sources

  1. OpenClaw: Where things live on disk
  2. OpenClaw: Agent workspace
  3. OpenClaw: Configuration: agent workspace and bootstrap
  4. OpenClaw: Config
  5. OpenClaw: Manage the Gateway service
  6. OpenClaw: Gateway
  7. OpenClaw: Onboard
  8. OpenClaw: Logs
  9. OpenClaw: Install
  10. OpenClaw: Env vars and .env loading
  11. OpenClaw: Configuration: gateway
  12. OpenClaw: Gateway ports, already running, and remote mode
  13. OpenClaw: Network exposure
  14. OpenClaw: Gateway service and process
  15. OpenClaw: Gateway runbook
  16. OpenClaw: Logging
  17. OpenClaw: Health
  18. OpenClaw: Dashboard
  19. OpenClaw: Heartbeat
  20. OpenClaw: Update

Skip the trial and error

ClawDocx members get 500+ tested prompts, ready-to-install SKILL.md files, SOUL.md and CLAUDE.md templates, and an MCP server so your agent can pull all of it directly while it works.