Setup Guide

OpenClaw on Mac M4

Your Mac M4 is powerful enough to run your own AI agent. Here is how to set it up in a few minutes.

10 min read
Mar 26, 2026
Ampere Team

If you have a Mac M4, you already have one of the best machines for running your own AI agent. OpenClaw installs in minutes and connects to Telegram, Discord, or WhatsApp so you can chat with your agent from your phone anytime.

This guide walks you through the full setup step by step. No experience needed. Prefer not to manage it yourself? Ampere.sh hosts your agent in the cloud so you never have to touch a Terminal.

  • Get OpenClaw running on any M4 Mac with one install command
  • Connect your agent to Telegram, Discord, or WhatsApp
  • Set up automatic start so it runs every time your Mac boots
  • Handle the most common issues if something does not work

What You Need Before You Start

Check this list before running anything. You need all of these to complete the setup:

What You NeedDetails
A Mac with M4 chipMacBook Pro 14 or 16 inch, Mac mini, or iMac — all late 2024 models. M4 Pro and M4 Max are also supported.
macOS 15 SequoiaEvery M4 Mac ships with Sequoia pre-installed. You do not need to update or change anything.
An AI provider API keyGet a free key from Anthropic (Claude), OpenAI (GPT-4o), or Google (Gemini). Free tier available on all three.
Telegram, Discord, or WhatsAppInstall whichever you use most on your phone. You will connect it to your agent during setup.
Stable internet connectionRequired during installation and whenever your agent is active.

Node.js is required but you do not need to install it manually. The OpenClaw install script takes care of it automatically.

How to Install OpenClaw on Mac M4

Step 1: Open Terminal

Terminal is a built-in Mac app that lets you run commands. You only need it for two commands in this guide. To open it:

  • Hold Command and press Space
  • Type Terminal into the search bar that appears
  • Press Enter

A window opens with a text cursor. Leave it open and move to the next step.

Step 2: Install OpenClaw

Paste the command below into Terminal and hit Enter. Do not modify it — copy and paste it as-is.

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

A stream of text will appear — this is the installer working. Wait until it stops completely and a fresh cursor line appears. On Mac M4 this usually takes under a minute.

Step 3: Run the Setup Wizard

Run this command next. The --install-daemon part registers OpenClaw as a system service so it launches automatically each time your Mac starts up.

openclaw onboard --install-daemon

The wizard walks you through setup one question at a time:

  • Disclaimer — press Enter to agree and continue
  • AI provider — arrow keys to highlight your choice (Anthropic, OpenAI, Google, or others), then Enter
  • API key — paste your key and press Enter. The characters are hidden while you type — this is by design
  • Port — press Enter to accept the default (18789)
  • Messaging app — chooseTelegram,Discord, or WhatsApp and follow the connection steps shown on screen

Once the wizard completes, open your messaging app and send your agent a message. A reply confirms the setup worked.

How to Keep Your Agent Running 24/7

OpenClaw launches on startup automatically. The one issue is macOS Sequoia's default sleep behavior. When your display turns off and your Mac goes idle, macOS will sleep the system and suspend OpenClaw. One setting change prevents this:

  • Open System Settings from the Apple menu
  • Scroll down to Battery and click it
  • Click Options
  • Enable Prevent automatic sleeping when the display is off
  • Click Done

If you are on a MacBook Pro M4, there is one extra consideration: closing the laptop lid triggers sleep even with this setting active. To run with the lid closed, connect an external monitor — your Mac stays fully awake in clamshell mode.

If you are on a Mac mini M4, none of this is an issue. The Mac mini has no lid and was designed for continuous operation. Change the sleep setting once and your agent stays online without any further attention.

How to Check Your Agent is Working

To confirm OpenClaw is active, open Terminal and run:

openclaw gateway status

A running status means your agent is live. You can also view the full dashboard in your browser — it shows connected channels, agent activity, and configuration options:

http://127.0.0.1:18789/

If you are new to OpenClaw and want to understand what it is and what it can do, this guide explains everything.

Common Problems and How to Fix Them

openclaw: command not found right after install

macOS Sequoia needs to reload its PATH before it can find newly installed tools. This is one of the most common things people run into on a brand new M4 Mac and it takes seconds to fix.

Fix

Quit Terminal completely using Command + Q, then open it again. Run the openclaw command once more. If it still fails, paste the line below to reload your profile manually.

source ~/.zprofile

Agent was working but stopped after a few hours

macOS Sequoia put your Mac to sleep. Even with the daemon installed, if your Mac goes to sleep OpenClaw pauses until it wakes up. The Battery setting needs to be changed to prevent this.

Fix

Follow the steps in the Keep Running section above to disable automatic sleep. Then run the command below to bring your agent back online.

openclaw gateway status

Sent a message but got no reply from the agent

Your agent is running but the AI provider is not responding. This usually means the API key you entered during setup has expired, was typed incorrectly, or the account has used up its credits.

Fix

Open your AI provider dashboard, generate a new API key, then run setup again and paste the fresh key when it asks.

openclaw onboard --install-daemon

Not sure what is wrong — nothing obvious

The doctor command checks your entire setup in one go — Node version, shell PATH, config file, gateway connection, and API key. It tells you exactly what is broken and what to do next.

Fix

Run the command below in Terminal and read through what it reports.

openclaw doctor

Mac M4 Local vs Ampere.sh

Hosting OpenClaw on your own Mac M4 costs nothing extra and keeps everything under your control. The limitation is availability — if your Mac is off, asleep, or the lid is closed, your agent goes offline. For a setup that is always reachable, Ampere.sh runs your agent in the cloud with zero maintenance on your end.

FeatureMac M4 (Local)Ampere.sh
Setup time10 to 15 minutesUnder 2 minutes
Online when Mac is offNoYes — always
Online when Mac sleepsNoYes — always
MacBook lid closedGoes offline — needs external monitorStays online
Updates and maintenanceManual — you handle itAutomatic — fully managed
Starting costFree — API fees onlyFree credits on sign up

Frequently Asked Questions

Does OpenClaw work on Mac M4?
Yes. OpenClaw works on all M4 Macs including MacBook Pro, Mac mini, and iMac. The M4 chip is fully supported and runs natively on macOS 15 Sequoia which every M4 Mac ships with.
Does OpenClaw work on M4 Pro and M4 Max too?
Yes. All three M4 tiers work. M4 Pro gives you up to 64 GB unified memory and M4 Max up to 128 GB. More memory is helpful if you want to run multiple agents or connect several channels at once.
Is Mac M4 better than M3 for running OpenClaw?
Yes. The M4 chip uses a more efficient process than M3, which means less battery drain and less heat when running OpenClaw in the background. The performance difference is noticeable on long sessions.
Can I run OpenClaw 24/7 on Mac mini M4?
Yes. The Mac mini M4 is one of the best machines for always-on OpenClaw. It has no lid, no battery concerns, and runs silently. Once you disable automatic sleep in System Settings, your agent stays online non-stop.
What happens if I close my MacBook M4 lid?
Closing the lid puts your MacBook into sleep mode which pauses OpenClaw. To avoid this, connect an external display. Your MacBook will stay awake in clamshell mode even with the lid shut. The Mac mini M4 does not have this issue.
Do I need to know coding to install OpenClaw on Mac M4?
No. The whole install is two commands you copy and paste into Terminal. This guide walks you through every single step from opening Terminal to testing your first message.
Does OpenClaw conflict with Apple Intelligence on Mac M4?
No. Apple Intelligence handles on-device features like summarization and writing tools. OpenClaw connects to external AI providers like Anthropic or OpenAI for your agent. They run independently and do not interfere with each other.
What is the difference between Mac M4 and using Ampere.sh?
Running locally on your Mac M4 means your agent is only online while your Mac is on and awake. Ampere.sh hosts your agent in the cloud so it is always available even when your Mac is off, sleeping, or the lid is closed.