Mengapa Menjalankan OpenClaw di Mac Mini?
Penyedia VPS cloud menagih berdasarkan waktu komputasi dan menambahkan biaya tambahan GPU untuk inferensi AI. Mac mini M4 memberi Anda Apple Silicon khusus dengan biaya tetap $85/bln (USD, belum termasuk pajak), akses SSH penuh, dan kemampuan menjalankan LLM lokal bersama OpenClaw dengan biaya inferensi mendekati nol. Panggilan ke Claude atau model hosted lainnya tetap ditagih per token oleh penyedia tersebut.
| Fitur | Mac Mini M4 (My Remote Mac) | VPS Cloud (tingkat AI) |
|---|---|---|
| Biaya Bulanan | $85/bln (tarif tetap) | Harga tingkat GPU (bervariasi) |
| Dukungan LLM Lokal | Native (Ollama, llama.cpp) | Biaya tambahan / terbatas |
| Uptime Selalu Aktif | Ya (SLA 99.9%) | Ya |
| Integrasi Apple | iMessage, Shortcuts, Automator | Tidak ada |
| Kompleksitas Pengaturan | Rendah (termasuk akses SSH) | Sedang |
| Privasi | Hardware khusus | Datacenter bersama |
Harga My Remote Mac dalam USD, belum termasuk pajak.
Keunggulan Utama: Tidak seperti VPS cloud, Mac mini M4 Anda menjalankan Ollama atau llama.cpp secara native di Apple Silicon. Anda dapat mengarahkan OpenClaw ke LLM lokal untuk tugas rutin atau sensitif tanpa biaya per token, dan memakai Claude untuk kueri kompleks, yang ditagih per token oleh Anthropic.
Prasyarat
Sebelum memulai, pastikan Anda memiliki hal-hal berikut:
- Sebuah server Mac Mini M4 (mulai $85/bln) atau Mac mini M6 (mulai $149/bln) dari My Remote Mac
- Akses SSH ke Mac Mini Anda (disediakan bersama langganan My Remote Mac Anda)
- Sebuah kunci API Anthropic (untuk Claude), dapatkan di console.anthropic.com
- Akun perpesanan di Telegram, Discord, atau WhatsApp untuk menghubungkan agen Anda
- Pemahaman dasar tentang perintah terminal dan pengeditan file konfigurasi JSON5 (~/.openclaw/openclaw.json)
Langkah 1: Hubungkan ke Mac Mini Anda dan Instal Node.js
Pertama, SSH ke Mac Mini M4 Anda. Anda akan menerima kredensial saat menyiapkan server My Remote Mac Anda.
Hubungkan melalui 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 -productVersion
Instal Node.js dengan 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
Instal Node.js yang Didukung (26.1+ atau 24.16+)
OpenClaw membutuhkan Node.js 26.1+ (direkomendasikan) atau 24.16+. Node 22, 23, dan 25 tidak didukung sejak rilis 2026.9.3. Homebrew adalah metode yang terdokumentasi di macOS. Jika Anda lebih suka nvm, instal Node 26 (jangan pernah --lts) dan pastikan nvm diinisialisasi di ~/.zshrc, jika tidak openclaw tidak akan ada di PATH Anda:
# 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
Verifikasi Instalasi
# Confirm Node.js is running on Apple Silicon
node -e "console.log(process.platform, process.arch)"
# darwin arm64
Langkah 2: Instal OpenClaw dan Konfigurasikan Kunci API Claude
Dengan Node.js siap, instal CLI OpenClaw secara global: tidak ada instalasi lokal per proyek. OpenClaw didistribusikan sebagai paket npm openclaw; installer satu baris (openclaw.ai/install.sh) juga tersedia dan akan menyiapkan Node 26 untuk Anda jika belum ada.
Instal 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
Jalankan Wizard Onboarding
OpenClaw membaca pengaturannya dari ~/.openclaw/openclaw.json (JSON5). Jangan menulisnya secara manual: wizard onboarding membuatnya, meminta kunci API Anthropic Anda, memeriksa akses model, dan mendaftarkan layanan launchd sekaligus:
# 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
Tempel kunci Anda dari console.anthropic.com saat wizard memintanya (atau berikan dengan --anthropic-api-key). ID model memerlukan prefiks penyedia: gunakan anthropic/claude-sonnet-5 untuk tugas kompleks atau anthropic/claude-haiku-4-5 untuk respons yang lebih cepat dan lebih murah. Default OpenClaw pada instalasi baru adalah anthropic/claude-opus-5-5.
Verifikasi Gateway dan Kirim Pesan Pertama
# 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)
Langkah 3: Hubungkan Saluran Perpesanan
OpenClaw mendukung Telegram, Discord, WhatsApp, iMessage, Slack, Signal, Microsoft Teams, Google Chat, dan 20+ saluran lainnya. Telegram sudah disertakan bawaan dan paling cepat untuk dijalankan: buat bot melalui @BotFather, tambahkan token, lalu setujui DM pertama Anda dengan kode pairing yang dikirim balik oleh bot:
# 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
Hubungkan Discord
Untuk menghubungkan bot Discord, buat aplikasi di Discord Developer Portal, aktifkan Message Content Intent (wajib), dan undang bot dengan scope bot + applications.commands. Instal plugin resmi, rujuk token dari variabel lingkungan DISCORD_BOT_TOKEN, dan setujui DM pertama Anda:
# 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
Langkah 4: Jalankan sebagai Layanan launchd Persisten
Untuk operasi 24/7, OpenClaw Gateway harus memulai ulang saat gagal dan kembali aktif setelah mesin di-reboot. Pengawasan ditangani OpenClaw sendiri: openclaw gateway install (atau flag --install-daemon dari Langkah 2) mendaftarkan LaunchAgent launchd yang diawasi bernama ai.openclaw.gateway di ~/Library/LaunchAgents/. Jangan pernah menulis plist secara manual. LaunchAgent dimulai saat sesi pengguna Anda dimulai, bukan saat boot: di Mac mini headless, aktifkan Automatic login untuk pengguna admin Anda (System Settings > Users & Groups; tidak tersedia saat FileVault aktif), lalu reboot sekali dan pastikan Gateway berjalan.
Instal Layanan Gateway
Jika Anda melewatkan --install-daemon di Langkah 2, daftarkan layanannya sekarang. Kemudian nonaktifkan sleep macOS agar Gateway tetap bertahan saat jaringan terputus akibat maintenance sleep (rekomendasi resmi):
# 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
# LaunchAgents load at login: enable Automatic login so the Gateway returns after a reboot
# Keep the Mac awake: avoids maintenance-sleep network flaps (official recommendation)
sudo pmset -a sleep 0 disksleep 0 standby 0 powernap 0
Kelola Layanan
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
Verifikasi Layanan Berjalan
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
Perbarui 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
Pemecahan Masalah Umum
Gateway menolak memulai atau menampilkan ketidakcocokan versi
File ~/.openclaw/openclaw.json yang tidak valid (satu key tak dikenal saja sudah cukup) membuat Gateway menolak memulai, dan perubahan Node.js dapat membuat CLI dan layanan berjalan pada versi yang berbeda. Jalankan diagnostik bawaan dan perbaiki layanannya:
# 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
API Claude mengembalikan 401 Unauthorized
Kunci API Anda hilang, salah, atau akun Anthropic Anda tidak memiliki sisa kredit. Periksa status penyedia dari OpenClaw terlebih dahulu, lalu uji kuncinya secara langsung jika perlu:
# 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
Bot Telegram berhenti merespons
Token bot mungkin telah dicabut, DM Anda masih menunggu persetujuan pairing, atau Gateway telah berhenti. Periksa saluran, setujui pairing yang tertunda, dan mulai ulang:
# 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 berhenti merespons setelah beberapa jam di macOS
Maintenance sleep macOS dapat memutus jaringan (ENETDOWN) dan membungkam saluran sampai Anda menyentuh Mac. Nonaktifkan sleep, periksa log stabilitas, perhatikan peringatan tekanan memori, dan tambahkan watchdog launchd resmi:
# 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
Analisis Biaya vs. VPS Cloud
Berikut adalah perbandingan biaya realistis untuk menjalankan agen AI 24/7 pada berbagai tingkat penggunaan:
| Kasus Penggunaan | Biaya My Remote Mac | Panggilan AI/Bulan | Biaya VPS Cloud | Penghematan Bulanan |
|---|---|---|---|---|
| Asisten pribadi | $85/bln | ~500 panggilan | $120/bln (VPS GPU dasar) | $35/bln |
| Bot tim kecil | $85/bln | ~5,000 panggilan | $200/bln | $115/bln |
| LLM lokal + agen | $85/bln | Tanpa batas (lokal) | $350+/bln (VPS GPU) | $265+/bln |
| Sistem multi-agen | $229/bln (M4 Pro) | 10,000+ panggilan | $600+/bln | $371+/bln |
Harga My Remote Mac dalam USD, belum termasuk pajak.
Kesimpulan: Menjalankan OpenClaw di Mac Mini M4 jauh lebih murah daripada VPS GPU cloud. Anda juga mendapatkan Apple Silicon native untuk LLM lokal melalui Ollama: arahkan tugas non-sensitif ke model lokal (openclaw models set ollama/gemma4) dan arahkan heartbeat bawaan 30 menit ke anthropic/claude-haiku-4-5 agar tagihan API saat idle tetap rendah.
Sumber (dokumentasi resmi OpenClaw)
- 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