मुख्य सामग्री पर जाएं

Mac Mini पर OpenClaw AI एजेंट को 24/7 कैसे चलाएं

OpenClaw एक ओपन-सोर्स AI एजेंट है जो WhatsApp, Telegram, Discord और अन्य के माध्यम से कार्यों को स्वचालित करता है, Claude या GPT द्वारा संचालित। Mac mini M4 आदर्श हमेशा-चालू होस्ट है: लोकल Apple Silicon प्रोसेसिंग, शून्य GPU अधिभार, और मशीन के लिए एक समान $85/माह (USD, कर अतिरिक्त)। Claude या GPT API के उपयोग का बिल उसका प्रदाता अलग से भेजता है।

AI और स्वचालन 25 मिनट पढ़ें 13 अक्टूबर, 2026 को अपडेट किया गया

OpenClaw को Mac Mini पर क्यों चलाएं?

क्लाउड VPS प्रदाता कंप्यूट समय के आधार पर शुल्क लेते हैं और AI इन्फरेंस के लिए GPU अधिभार जोड़ते हैं। Mac mini M4 आपको एक समान $85/माह (USD, कर अतिरिक्त) पर समर्पित Apple Silicon देता है, पूर्ण SSH एक्सेस, और लगभग-शून्य इन्फरेंस लागत के लिए OpenClaw के साथ लोकल LLMs चलाने की क्षमता। Claude या किसी अन्य होस्टेड मॉडल को किए गए कॉल का बिल अब भी उस प्रदाता द्वारा प्रति टोकन लिया जाता है।

OpenClaw को Mac Mini पर क्यों चलाएं?
Mac Mini M4 (My Remote Mac) क्लाउड VPS (AI टियर)
मासिक लागत $85/माह (समान दर) GPU-टियर मूल्य (भिन्न होता है)
लोकल LLM समर्थन नेटिव (Ollama, llama.cpp) अतिरिक्त लागत / सीमित
हमेशा-चालू अपटाइम हां (99.9% SLA) हां
Apple इंटीग्रेशन iMessage, Shortcuts, Automator कोई नहीं
सेटअप जटिलता कम (SSH एक्सेस शामिल) मध्यम
गोपनीयता समर्पित हार्डवेयर शेयर्ड डेटासेंटर

My Remote Mac की कीमतें USD में, कर अतिरिक्त।

मुख्य लाभ: क्लाउड VPS के विपरीत, आपका Mac mini M4, Apple Silicon पर नेटिव रूप से Ollama या llama.cpp चलाता है। आप सामान्य या संवेदनशील कार्यों के लिए OpenClaw को एक लोकल LLM पर रूट कर सकते हैं, जिस पर कोई प्रति-टोकन लागत नहीं है, और जटिल क्वेरी के लिए Claude रख सकते हैं, जिसका बिल Anthropic प्रति टोकन लेता है।

पूर्वापेक्षाएं

शुरू करने से पहले, सुनिश्चित करें कि आपके पास निम्नलिखित हैं:

  • My Remote Mac से एक Mac Mini M4 सर्वर ($85/माह से) या Mac mini M6 ($149/माह से)
  • आपके Mac Mini तक SSH एक्सेस (आपकी My Remote Mac सदस्यता के साथ प्रदान किया गया)
  • एक Anthropic API key (Claude के लिए), इसे console.anthropic.com पर प्राप्त करें
  • अपने एजेंट को कनेक्ट करने के लिए Telegram, Discord या WhatsApp पर एक मैसेजिंग अकाउंट
  • टर्मिनल कमांड और एक JSON5 कॉन्फ़िगरेशन फ़ाइल (~/.openclaw/openclaw.json) संपादित करने से बुनियादी परिचय

चरण 1: अपने Mac Mini से कनेक्ट करें और Node.js इंस्टॉल करें

सबसे पहले, अपने Mac Mini M4 में SSH करें। जब आपने अपना My Remote Mac सर्वर सेट किया होगा तब आपको अपने क्रेडेंशियल प्राप्त हुए होंगे।

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

Homebrew के साथ Node.js इंस्टॉल करें

# 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

एक समर्थित Node.js इंस्टॉल करें (26.1+ या 24.16+)

OpenClaw को Node.js 26.1+ (अनुशंसित) या 24.16+ चाहिए। रिलीज़ 2026.9.3 से Node 22, 23 और 25 समर्थित नहीं हैं। macOS पर Homebrew ही प्रलेखित तरीका है। यदि आप nvm पसंद करते हैं, तो Node 26 इंस्टॉल करें (कभी भी --lts नहीं) और सुनिश्चित करें कि nvm ~/.zshrc में इनिशियलाइज़ हो, अन्यथा openclaw आपके PATH में नहीं होगा:

# 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

इंस्टॉलेशन सत्यापित करें

# Confirm Node.js is running on Apple Silicon
node -e "console.log(process.platform, process.arch)"
# darwin arm64

चरण 2: OpenClaw इंस्टॉल करें और Claude API Key कॉन्फ़िगर करें

Node.js तैयार होने के बाद, OpenClaw CLI को ग्लोबली इंस्टॉल करें। कोई प्रोजेक्ट-लोकल इंस्टॉल नहीं है। OpenClaw को npm पैकेज openclaw के रूप में वितरित किया जाता है; एक वन-लाइन इंस्टॉलर (openclaw.ai/install.sh) भी उपलब्ध है, जो Node 26 मौजूद न होने पर उसे आपके लिए प्रोविज़न कर देता है।

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

Onboarding Wizard चलाएं

OpenClaw अपनी सेटिंग्स ~/.openclaw/openclaw.json (JSON5) से पढ़ता है। इसे हाथ से न लिखें: onboarding wizard इसे बनाता है, आपकी Anthropic API key मांगता है, मॉडल एक्सेस जांचता है और launchd सर्विस रजिस्टर करता है, सब एक ही बार में:

# 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

जब wizard पूछे तो console.anthropic.com से अपनी key पेस्ट करें (या इसे --anthropic-api-key के साथ पास करें)। मॉडल id में provider प्रीफ़िक्स ज़रूरी है: जटिल कार्यों के लिए anthropic/claude-sonnet-5 या तेज़, सस्ते उत्तरों के लिए anthropic/claude-haiku-4-5 का उपयोग करें। नए सेटअप पर OpenClaw का डिफ़ॉल्ट anthropic/claude-opus-5-5 है।

Gateway सत्यापित करें और पहला संदेश भेजें

# 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)

चरण 3: मैसेजिंग चैनल कनेक्ट करें

OpenClaw, Telegram, Discord, WhatsApp, iMessage, Slack, Signal, Microsoft Teams, Google Chat और 20+ अन्य चैनलों का समर्थन करता है। Telegram बंडल्ड है और सबसे तेज़ी से काम करने लगता है: @BotFather के माध्यम से एक bot बनाएं, टोकन जोड़ें, फिर bot द्वारा वापस भेजे गए pairing code से अपने पहले DM को स्वीकृत करें:

# 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

Discord कनेक्ट करें

एक Discord bot कनेक्ट करने के लिए, Discord Developer Portal में एक एप्लिकेशन बनाएं, Message Content Intent सक्षम करें (आवश्यक) और इसे bot + applications.commands scopes के साथ इनवाइट करें। आधिकारिक plugin इंस्टॉल करें, टोकन को DISCORD_BOT_TOKEN एनवायरनमेंट वेरिएबल से रेफ़रेंस करें और अपने पहले DM को स्वीकृत करें:

# 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

चरण 4: एक स्थायी launchd सर्विस के रूप में चलाएं

24/7 संचालन के लिए, OpenClaw Gateway को विफलता पर पुनः आरंभ होना चाहिए और मशीन के रीबूट के बाद वापस आना चाहिए। निगरानी OpenClaw स्वयं संभालता है: openclaw gateway install (या चरण 2 का --install-daemon फ़्लैग) ~/Library/LaunchAgents/ में ai.openclaw.gateway नाम का एक सुपरवाइज़्ड launchd LaunchAgent रजिस्टर करता है। plist कभी भी हाथ से न लिखें। LaunchAgent बूट पर नहीं, बल्कि आपका user सत्र शुरू होने पर चलता है: हेडलेस Mac mini पर अपने admin user के लिए Automatic login सक्षम करें (System Settings > Users & Groups; FileVault चालू रहने पर उपलब्ध नहीं), फिर एक बार रीबूट करें और जांचें कि Gateway चल रहा है।

Gateway सर्विस इंस्टॉल करें

यदि आपने चरण 2 में --install-daemon छोड़ दिया था, तो सर्विस अभी रजिस्टर करें। फिर macOS स्लीप अक्षम करें ताकि Gateway मेंटेनेंस-स्लीप के नेटवर्क व्यवधानों से बचा रहे (आधिकारिक अनुशंसा):

# 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

सर्विस प्रबंधित करें

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

सत्यापित करें कि सर्विस चल रही है

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

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

सामान्य समस्याओं का निवारण

Gateway शुरू होने से इनकार करता है या version mismatch दिखाता है

एक अमान्य ~/.openclaw/openclaw.json (एक भी अज्ञात key काफी है) Gateway को शुरू होने से रोक देती है, और Node.js बदलने से CLI और सर्विस अलग-अलग वर्शन पर रह सकते हैं। बिल्ट-इन डायग्नोस्टिक्स चलाएं और सर्विस की मरम्मत करें:

# 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

Claude API 401 Unauthorized लौटाता है

आपकी API key गायब है, गलत है, या आपके Anthropic अकाउंट में कोई शेष क्रेडिट नहीं है। पहले OpenClaw से provider status जांचें, फिर ज़रूरत हो तो key को सीधे टेस्ट करें:

# 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

Telegram bot जवाब देना बंद कर देता है

bot टोकन रद्द कर दिया गया हो सकता है, आपका DM अभी भी pairing स्वीकृति की प्रतीक्षा में हो सकता है, या Gateway बंद हो गया हो सकता है। चैनल की जांच करें, लंबित pairings स्वीकृत करें और पुनः आरंभ करें:

# 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)

macOS पर कुछ घंटों बाद bot चुप हो जाता है

macOS मेंटेनेंस स्लीप नेटवर्क गिरा सकता है (ENETDOWN) और जब तक आप Mac को छूते नहीं, चैनल चुप रह सकते हैं। स्लीप अक्षम करें, स्थिरता लॉग जांचें, memory-pressure चेतावनियों पर नज़र रखें और आधिकारिक launchd watchdog जोड़ें:

# 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

क्लाउड VPS बनाम लागत विश्लेषण

विभिन्न उपयोग स्तरों पर एक AI एजेंट को 24/7 चलाने के लिए यहां एक यथार्थवादी लागत तुलना है:

क्लाउड VPS बनाम लागत विश्लेषण
उपयोग मामला My Remote Mac लागत AI कॉल/माह क्लाउड VPS लागत मासिक बचत
व्यक्तिगत सहायक $85/माह ~500 कॉल $120/माह (बेसिक GPU VPS) $35/माह
छोटी टीम bot $85/माह ~5,000 कॉल $200/माह $115/माह
लोकल LLM + एजेंट $85/माह असीमित (लोकल) $350+/माह (GPU VPS) $265+/माह
मल्टी-एजेंट सिस्टम $229/माह (M4 Pro) 10,000+ कॉल $600+/माह $371+/माह

My Remote Mac की कीमतें USD में, कर अतिरिक्त।

निष्कर्ष: Mac Mini M4 पर OpenClaw चलाना किसी GPU क्लाउड VPS की तुलना में काफी सस्ता है। आपको Ollama के माध्यम से लोकल LLMs के लिए नेटिव Apple Silicon भी मिलता है। गैर-संवेदनशील कार्यों को एक लोकल मॉडल पर रूट करें (openclaw models set ollama/gemma4) और बिल्ट-इन 30-मिनट heartbeat को anthropic/claude-haiku-4-5 पर सेट करें ताकि निष्क्रिय अवस्था का API बिल कम रहे।

स्रोत (आधिकारिक OpenClaw दस्तावेज़)

अपने AI एजेंट को 24/7 चलाने के लिए तैयार हैं?

अपने OpenClaw होस्ट के रूप में एक समर्पित Mac Mini M4 डिप्लॉय करें। $85/माह से शुरू।

My Remote Mac की कीमतें USD में, कर अतिरिक्त।

और जानकारी चाहिए?

चरण-दर-चरण सेटअप, कॉन्फ़िगरेशन संदर्भ और समस्या-निवारण के लिए संपूर्ण दस्तावेज़ देखें।

दस्तावेज़ खोलें →