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 Need | Details |
|---|---|
| A Mac with M4 chip | MacBook Pro 14 or 16 inch, Mac mini, or iMac — all late 2024 models. M4 Pro and M4 Max are also supported. |
| macOS 15 Sequoia | Every M4 Mac ships with Sequoia pre-installed. You do not need to update or change anything. |
| An AI provider API key | Get a free key from Anthropic (Claude), OpenAI (GPT-4o), or Google (Gemini). Free tier available on all three. |
| Telegram, Discord, or WhatsApp | Install whichever you use most on your phone. You will connect it to your agent during setup. |
| Stable internet connection | Required 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 | bashA 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-daemonThe 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 statusA 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.
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 ~/.zprofileAgent 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.
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 statusSent 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.
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-daemonNot 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.
Run the command below in Terminal and read through what it reports.
openclaw doctorMac 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.
| Feature | Mac M4 (Local) | Ampere.sh |
|---|---|---|
| Setup time | 10 to 15 minutes | Under 2 minutes |
| Online when Mac is off | No | Yes — always |
| Online when Mac sleeps | No | Yes — always |
| MacBook lid closed | Goes offline — needs external monitor | Stays online |
| Updates and maintenance | Manual — you handle it | Automatic — fully managed |
| Starting cost | Free — API fees only | Free credits on sign up |