株式会社オブライト
Software Development2026-02-27

How to Set Up OpenClaw on Mac Mini: A Complete Beginner's Guide

A step-by-step guide for setting up OpenClaw on Mac mini M4, from hardware purchase to first task execution. Perfect for beginners.


Introduction

OpenClaw is the most talked-about open-source AI agent of 2026, but choosing the right hardware is crucial to getting the most out of it. The overwhelming favorite among the OpenClaw community is the Apple Mac mini M4. Its compact form factor, fanless silent operation, remarkable energy efficiency, and accessible price point starting at approximately $629 (¥94,800) make it the ideal foundation for an always-on AI assistant. In this guide, we will walk you through every step from purchasing a Mac mini M4 to executing your first task with OpenClaw, explained in a beginner-friendly, step-by-step format.

What You Will Need

Before starting the setup, prepare the following items. For hardware, you will need a Mac mini M4 (starting at $629/¥94,800). The 16GB RAM model is sufficient for most use cases, but consider the 24GB model if you plan to run many concurrent tasks. You will also need a stable internet connection (wired Ethernet recommended), a keyboard, mouse, and monitor for initial setup (these become unnecessary once SSH remote access is configured), and accounts for the messaging apps you want to integrate (LINE, Slack, Discord, etc.). For software, you will need Node.js (v20 or higher) or Docker, and an LLM API key (Anthropic Claude API or OpenAI GPT API). API keys can be obtained from each service's website.

Step 1: Initial Mac mini Configuration

After unboxing your Mac mini, begin with the macOS initial setup. Connect the keyboard, mouse, and monitor, power on the device, and follow the setup wizard. Complete the Apple ID configuration, Wi-Fi or Ethernet connection, and timezone settings. Next, enable SSH for remote access. Navigate to System Settings, then General, then Sharing, and turn on Remote Login. This allows you to control the Mac mini via terminal from another PC or smartphone. Finally, install the Homebrew package manager. Open Terminal and run the installation command found on the official Homebrew website. With Homebrew installed, you can easily install required software such as Node.js and Git.

Step 2: Installing OpenClaw

With Homebrew installed, proceed to set up OpenClaw. First, install Git and Node.js by running 'brew install git node' in Terminal. Next, clone the OpenClaw repository. Run 'git clone https://github.com/psteinberger/openclaw.git' and navigate into the directory with 'cd openclaw'. Install the dependency packages by running 'npm install'. Once installation completes, create the environment variable configuration file by running 'cp .env.example .env' to copy the template file. You will populate this .env file with your API keys and other settings in the following steps.

Step 3: Configuring the LLM API Key

Now configure the LLM API key that enables OpenClaw to 'think.' Anthropic Claude API is recommended, as Claude delivers particularly high accuracy for Japanese-language tasks. For Anthropic Claude API: Visit the Anthropic console (console.anthropic.com), create an account, and generate an API key. For OpenAI GPT API: Obtain an API key from the OpenAI platform (platform.openai.com). Add the obtained API key to your .env file. Open it with a text editor and enter 'LLM_PROVIDER=anthropic' and 'ANTHROPIC_API_KEY=sk-ant-xxxxx' with your actual key. Setting up multiple LLM providers enables OpenClaw's automatic model selection feature, which chooses the optimal model based on the task type.

Step 4: Connecting Messaging Apps

One of OpenClaw's greatest strengths is the ability to issue commands from everyday messaging apps. Here we will use LINE as an example. First, log in to LINE Developers (developers.line.biz) and create a new provider and Messaging API channel. Issue a long-lived channel access token and add it to your .env file as 'LINE_CHANNEL_ACCESS_TOKEN=xxxxx' and 'LINE_CHANNEL_SECRET=xxxxx'. You will need to configure a webhook URL. To make your Mac mini accessible from the outside, use a tunneling tool like ngrok or Cloudflare Tunnel, or set up a static IP with port forwarding. Register the webhook URL in the LINE Developers console, and you will be able to send messages to OpenClaw via LINE. Other platforms like Slack, Discord, and Telegram follow similar procedures. The OpenClaw official documentation provides detailed setup instructions for each platform.

Step 5: Security Configuration

Because OpenClaw has the authority to execute commands on your computer, security configuration is critically important. Without proper settings, there is a risk of unintended file deletion or system modifications. In your .env file or config.yaml, configure the following. First, restrict accessible directories: set 'ALLOWED_DIRECTORIES=/Users/username/openclaw-workspace' to explicitly specify which directories OpenClaw can read from and write to. Next, restrict executable commands: set 'COMMAND_ALLOWLIST=ls,cat,mkdir,cp,node,npm' to use a whitelist approach for permitted commands. Do not include dangerous commands like 'rm -rf'. Additionally, set a daily API call limit to prevent unexpected high charges: 'DAILY_API_LIMIT=1000'. We recommend starting with conservative settings and relaxing them gradually as you become more comfortable with the system.

Step 6: Testing the Setup

With all configurations complete, start OpenClaw and run a test. Execute 'npm start' in Terminal to launch the OpenClaw server. Verify that no errors appear in the startup logs. Open your connected messaging app (e.g., LINE) and send your first message to the OpenClaw account. Try simple tasks like 'Check today's weather' or 'Create a new folder on the desktop' to verify functionality. If OpenClaw responds successfully, your setup is complete. If you receive no response, check the terminal logs to identify the error cause. Common issues include webhook URL misconfiguration and API key typos. Logs are saved in the 'logs/' directory and are invaluable for troubleshooting.

Configuring Auto-Start

Once testing succeeds, configure OpenClaw to start automatically when the Mac mini reboots. On macOS, you can use launchd (launch daemon) to set up automatic process startup. Copy the sample plist file included in the OpenClaw repository to '~/Library/LaunchAgents/' and register it with the 'launchctl load' command. This ensures OpenClaw starts automatically every time the Mac mini powers on, ready to accept instructions from messaging apps at any time. Do not forget to also enable 'Start up automatically after a power failure' in System Settings under General, then Startup and Shutdown, to ensure recovery after power outages.

Common Issues and Troubleshooting

Here is a summary of common issues encountered during setup and how to resolve them. API Connection Errors: Verify that your API key is correctly configured. Extra spaces or line breaks in the .env file are a frequent cause. Also check that your API account has remaining credits. No Response from Messaging App: Confirm that the webhook URL is correctly set and that your tunneling tool is functioning properly. On the LINE Developers console, use the 'Verify Webhook' button to test the connection. Higher-than-Expected Token Usage: Adjust the maximum response tokens and context window size in OpenClaw's settings. Selecting lighter models (such as Claude Haiku) for simpler tasks can help reduce costs. Mac mini Keeps Going to Sleep: In System Settings under Energy Saver, configure 'Prevent automatic sleeping when the display is off'.

Conclusion

Setting up OpenClaw on a Mac mini M4 can be completed in approximately 2 to 4 hours, even for beginners. Once configured, you gain an environment where you can issue natural language commands via LINE or Slack to automate file operations, web research, schedule management, and much more. If you feel unsure about configuring everything yourself, or need a reliable production environment for business use, we recommend Oflight Inc.'s OpenClaw Professional Setup Service. For ¥49,800 (before tax), our team handles everything in a single visit—from initial hardware configuration to OpenClaw installation, messaging app integration, security settings, and operational verification. We offer on-site service in Minato, Shibuya, Setagaya, Meguro, Shinagawa, and Ota wards. Please feel free to contact us.

Feel free to contact us

Contact Us