Guía - IA y Automatización

Cómo ejecutar el agente IA OpenClaw 24/7 en un Mac Mini

OpenClaw es un agente IA de código abierto que automatiza tareas vía WhatsApp, Telegram, Discord y más, impulsado por Claude o GPT. Un Mac Mini M4 es el host ideal: procesamiento local en Apple Silicon, sin cargos adicionales por GPU, y un coste mensual fijo de 85 $/mes.

25 min de lectura Actualizado el 28 de septiembre de 2026

1. ¿Por qué usar un Mac Mini para OpenClaw?

Los proveedores de VPS cloud cobran por tiempo de cómputo y añaden cargos adicionales por GPU para la inferencia IA. Un Mac Mini M4 te ofrece Apple Silicon dedicado a un precio fijo de 85 $/mes, sin sorpresas en la factura, con acceso SSH completo y la posibilidad de ejecutar LLM locales junto a OpenClaw.

Característica VPS cloud (tier IA) Mac Mini M4 (MyRemoteMac)
Coste mensual Tarifa tier GPU (variable) 85 $/mes (tarifa plana)
LLM locales Coste adicional / limitado Nativo (Ollama, llama.cpp)
Disponibilidad 24/7 Sí Sí (SLA 99,9 %)
Integraciones Apple Ninguna iMessage, Atajos, Automator
Complejidad de configuración Media Baja (acceso SSH incluido)
Privacidad Datacenter compartido Hardware dedicado

Ventaja clave: A diferencia de un VPS cloud, tu Mac Mini M4 ejecuta Ollama o llama.cpp de forma nativa en Apple Silicon. Puedes enrutar OpenClaw hacia un LLM local para tareas sensibles y usar Claude para consultas complejas, sin pagar por token.

2. Requisitos previos

Antes de empezar, asegúrate de tener lo siguiente:

  • Un servidor Mac Mini M4 (desde 85 $/mes) o Mac mini M6 (desde 149 $/mes) de MyRemoteMac
  • Acceso SSH a tu Mac Mini (incluido con tu suscripción a MyRemoteMac)
  • Una clave API de Anthropic (para Claude), obtenla en console.anthropic.com
  • Una cuenta de mensajería en Telegram, Discord o WhatsApp para conectar tu agente
  • Conocimientos básicos de línea de comandos y de edición de un archivo de configuración JSON5 (~/.openclaw/openclaw.json)

3. Paso 1: Conectar al Mac Mini e instalar Node.js

Primero, conéctate por SSH a tu Mac Mini M4. Habrás recibido tus credenciales al configurar tu servidor MyRemoteMac.

Conexión vía 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
# ProductName:    macOS
# ProductVersion: 15.4

Instalación de Node.js con 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

Instalación de una versión compatible de Node.js (26.1+ o 24.16+)

OpenClaw necesita Node.js 26.1+ (recomendado) o 24.16+, Node 22, 23 y 25 no son compatibles desde la versión 2026.9.3. Homebrew es el método documentado en macOS. Si prefieres nvm, instala Node 26 (nunca --lts) y asegúrate de que nvm se inicializa en ~/.zshrc, o openclaw no estará en tu 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

Verificación de la instalación

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

4. Paso 2: Instalar OpenClaw y configurar la clave Claude

Con Node.js listo, instala la CLI de OpenClaw de forma global, no existe instalación local por proyecto. OpenClaw se distribuye como el paquete npm openclaw; también hay disponible un instalador de una sola línea (openclaw.ai/install.sh) que aprovisiona Node 26 por ti si falta.

Instalación de 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

Ejecución del asistente de configuración inicial

OpenClaw lee su configuración desde ~/.openclaw/openclaw.json (JSON5). No lo escribas a mano: el asistente de configuración inicial lo crea, te pide tu clave API de Anthropic, comprueba el acceso a los modelos y registra el servicio launchd de una sola vez:

# 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

Pega tu clave de console.anthropic.com cuando el asistente la pida (o pásala con --anthropic-api-key). Los identificadores de modelo necesitan el prefijo del proveedor: usa anthropic/claude-sonnet-5 para tareas complejas o anthropic/claude-haiku-4-5 para respuestas más rápidas y económicas, el modelo por defecto de OpenClaw en una instalación nueva es anthropic/claude-opus-5-5.

Verificación del Gateway y envío de un primer mensaje

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

5. Paso 3: Conectar canales de mensajería

OpenClaw es compatible con Telegram, Discord, WhatsApp, iMessage, Slack, Signal, Microsoft Teams, Google Chat y más de 20 canales adicionales. Telegram viene integrado y es el más rápido de poner en marcha, crea un bot a través de @BotFather, añade el token y luego aprueba tu primer mensaje directo con el código de emparejamiento que el bot te devuelve:

# 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

Conectar Discord

Para conectar un bot de Discord, crea una aplicación en el Portal de desarrolladores de Discord, activa el Message Content Intent (obligatorio) e invítalo con los scopes bot + applications.commands. Instala el plugin oficial, referencia el token desde la variable de entorno DISCORD_BOT_TOKEN y aprueba tu primer mensaje directo:

# 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

6. Paso 4: Ejecutar como servicio launchd persistente

Para un funcionamiento 24/7, el Gateway de OpenClaw debe arrancar automáticamente al inicio y reiniciarse ante fallos. OpenClaw se encarga de ello por sí mismo: openclaw gateway install (o el flag --install-daemon del Paso 2) registra un LaunchAgent de launchd supervisado llamado ai.openclaw.gateway en ~/Library/LaunchAgents/, nunca escribas el plist a mano.

Instalación del servicio Gateway

Si omitiste --install-daemon en el Paso 2, registra el servicio ahora. Después, desactiva el reposo de macOS para que el Gateway sobreviva a los cortes de red del reposo de mantenimiento (recomendación oficial):

# 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

# Keep the Mac awake: avoids maintenance-sleep network flaps (official recommendation)
sudo pmset -a sleep 0 disksleep 0 standby 0 powernap 0

Gestión del servicio

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

Verificación del servicio

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

Actualización de 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

7. Resolución de problemas comunes

El Gateway se niega a arrancar o muestra una discrepancia de versiones

Un ~/.openclaw/openclaw.json inválido (basta con una sola clave desconocida) hace que el Gateway se niegue a arrancar, y un cambio de Node.js puede dejar la CLI y el servicio en versiones distintas. Ejecuta el diagnóstico integrado y repara el servicio:

# 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

La API de Claude devuelve 401 Unauthorized

Falta tu clave API, es incorrecta o tu cuenta de Anthropic no tiene créditos restantes. Comprueba primero el estado del proveedor desde OpenClaw y, si es necesario, prueba la clave directamente:

# 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

El bot de Telegram deja de responder

El token del bot puede haber sido revocado, tu mensaje directo sigue esperando la aprobación del emparejamiento o el Gateway se ha detenido. Sondea el canal, aprueba los emparejamientos pendientes y reinicia:

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

El bot se queda en silencio tras unas horas en macOS

El reposo de mantenimiento de macOS puede cortar la red (ENETDOWN) y silenciar los canales hasta que toques el Mac. Desactiva el reposo, revisa los logs de estabilidad, vigila las advertencias de presión de memoria y añade el watchdog oficial de launchd:

# 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

8. Análisis de costes vs. VPS cloud

A continuación, una comparativa realista de costes para ejecutar un agente IA 24/7 a diferentes niveles de uso:

Caso de uso Llamadas IA/mes Coste VPS cloud Coste MyRemoteMac Ahorro mensual
Asistente personal ~500 llamadas 120 $/mes (VPS GPU básico) 85 $/mes 45 $/mes
Bot para equipo pequeño ~5.000 llamadas 200 $/mes 85 $/mes 125 $/mes
LLM local + agente Ilimitado (local) 350 +$/mes (VPS GPU) 85 $/mes 275 +$/mes
Sistema multi-agente 10.000+ llamadas 600 +$/mes 229 $/mes (M4 Pro) 371 +$/mes

Conclusión: Ejecutar OpenClaw en un Mac Mini M4 es significativamente más barato que un VPS cloud con GPU. Además, dispones de Apple Silicon nativo para LLM locales vía Ollama, enruta tareas no sensibles a un modelo local (openclaw models set ollama/gemma4) y apunta el heartbeat integrado de 30 minutos a anthropic/claude-haiku-4-5 para mantener baja la factura de API en reposo.

Fuentes (documentación oficial de OpenClaw)

Guías relacionadas

¿Listo para ejecutar tu agente IA 24/7?

Despliega un Mac Mini M4 dedicado como host de OpenClaw. Desde 85 $/mes.

¿Buscas más detalles?

Explora la documentación completa: guías paso a paso, referencias de configuración y resolución de problemas.

Abrir la documentación →