ガイド - AIと自動化

専用Mac miniでnanobotを24時間365日稼働させる方法(セルフホスト型AIエージェント)

nanobotは、香港大学のData Intelligence Labが開発した、Pythonで書かれた超軽量・オープンソース・セルフホスト型のパーソナルAIエージェントフレームワークです(MITライセンス、2026年9月時点でGitHubスター約48.6k)。同梱のWebUI、ターミナルUI、またはお使いのチャットアプリ(Telegram、Discord、Slack、WhatsAppをはじめ10数種類)で動作し、自らの自動化をスケジュールし、ローカルのOllamaサーバーを含む40以上のモデルプロバイダーと通信します。専用のApple Silicon Mac miniは、自然な常時稼働ホストです。スリープするノートPCとは無縁で、1:1の物理ハードウェア、macOS内蔵のサンドボックス、そして月額$85からの定額料金です。

読了20分 2026年9月28日更新

1. なぜMac miniでnanobotを実行するのか?

nanobotは長時間稼働するゲートウェイプロセスを中心に設計されています。公式ドキュメントは nanobot gateway を稼働させ続けるよう求めています。チャットアプリへのバックグラウンド配信、WebUIのトピック、スケジュールされた自動化、ローカルトリガー、ハートビートをすべてこのプロセスが担うためです。これは決してスリープしないマシンでしか機能しません。MyRemoteMacの専用Mac miniなら、まさにそれが手に入ります、あなただけの物理的なApple Silicon Macが、99.9% SLAで24時間365日オンライン、完全なroot権限、SSHとVNCアクセス、WireGuard VPN付きで、GPUプランのVPS課金ではなく定額の月額料金で利用できます。さらにmacOSなので、nanobotは内蔵のSeatbelt execサンドボックス(macOSに標準搭載の sandbox-exec)を使い、同じマシン上でローカルのOllamaモデルを実行できます。

項目 クラウドVPS(AIプラン) Mac mini(MyRemoteMac)
月額料金 GPUプランの料金(変動) M4 月額$85から · M6 月額$149から(定額、USD)
Execサンドボックス bubblewrap(bwrap、要インストール) Seatbelt(sandbox-exec)、macOSに標準搭載
ローカルLLM(Ollama) 追加料金/制限あり Apple Siliconの統合メモリでネイティブ対応
常時稼働 対応 対応(99.9% SLA)
ハードウェア 共有・仮想化 専用の1:1物理Mac
アクセス SSH SSH + VNC + WireGuard VPN、完全なroot権限

主なメリット: nanobotの本番環境向けの推奨は、アプリケーションレベルのワークスペースガードとOSのexecサンドボックス、Linuxではbubblewrap、macOSではSeatbelt、を組み合わせることです。Mac miniならサンドボックスは最初から備わっています。設定キー1つで、エージェントのシェルコマンドをワークスペースのファイルシステムに閉じ込められます(ネットワークは制限されません)。ローカルのOllamaモデルと組み合わせれば、定型タスクはマシンの外に一切出ません。

2. 前提条件

nanobotはPyPIパッケージ nanobot-ai として配布されており、Apple SiliconおよびIntelのmacOS 13以降向けに、WebUIとネイティブのターミナルUIを同梱したプラットフォームwheelが用意されています。標準のインストール手順では、Node.js、Homebrew、Gitは不要です。必要なものは以下のとおりです。

  • MyRemoteMac の専用Mac mini、M4 月額$85から(16 GB / 256 GB)または M6 月額$149から。どちらもApple Siliconで、macOS arm64 wheelの対象です。
  • Mac miniへのSSHアクセス(MyRemoteMacのサブスクリプションに付属)と、nanobotを実行するための標準の非rootユーザーアカウント、プロジェクトのSECURITY.mdは、決してrootとして実行してはならないと明記しています。
  • Python 3.11以降とcurl。ワンコマンドインストーラーは、古いpython3しか見つからない場合に中止します。uvまたはpipxは任意ですが、pipが externally-managed-environment を報告する場合には推奨されます。
  • LLMプロバイダー:APIキー(Anthropic、OpenAI、OpenRouter、Gemini、DeepSeek、Groq、Mistralなど約40種類が組み込み済み)、または同じMac mini上で動作するOllamaのようなローカルのOpenAI互換サーバー。
  • エージェントに接続するためのTelegram、Discord、Slack、またはWhatsAppのメッセージングアカウント(Telegramが最も手軽です:@BotFather のボットトークンだけで、受信ポートは不要)。

3. ステップ1:SSHで接続してnanobotをインストールする

MyRemoteMacダッシュボードの認証情報でMac miniにSSH接続します。本ガイドのすべてのコマンドは通常のmacOSユーザーとして実行し、決してrootでは実行しないでください。後でインストールするLaunchAgentは、そのユーザーのセッション内で動作します。

SSHで接続してPythonを確認する

# Connect to your Mac mini as a standard user (never root: SECURITY.md)
ssh admin@your-server-ip

# Confirm you are on Apple Silicon
uname -m
# arm64

# nanobot needs Python 3.11 or newer: install a current Python first if this is older
python3 --version
# Python 3.12.x

# curl is used to fetch the one-command installer
which curl

nanobotをインストールする

プロジェクトのデフォルトの手順はワンコマンドインストーラーです。有効な仮想環境、uv、pipx、または ~/.nanobot/venv の管理venvを使ってPyPIから nanobot-ai をインストールまたはアップグレードし、実際に使用したコマンドを表示します。SSH_CONNECTION が設定されているため、ブラウザのWebUIをスキップして代わりにターミナルウィザード nanobot onboard --wizard を実行します。まず --dry-run でプレビューしてください。インストールを自分で管理したい場合は、uvとpipxが文書化された代替手段です:

# Option A, official one-command installer: preview, then run
curl -fsSL https://raw.githubusercontent.com/HKUDS/nanobot/main/scripts/install.sh | sh -s -- --dry-run
curl -fsSL https://raw.githubusercontent.com/HKUDS/nanobot/main/scripts/install.sh | sh
# Over SSH it runs the terminal wizard `nanobot onboard --wizard` instead of opening the WebUI.
# The script reads NANOBOT_SKIP_WIZARD / PYTHON from sh's own environment, so set them on sh, not on curl:
# curl -fsSL https://raw.githubusercontent.com/HKUDS/nanobot/main/scripts/install.sh | NANOBOT_SKIP_WIZARD=1 sh
# curl -fsSL https://raw.githubusercontent.com/HKUDS/nanobot/main/scripts/install.sh | PYTHON=/path/to/python3.12 sh

# Option B: uv (isolated tool install, no externally-managed-environment errors)
uv tool install nanobot-ai

# Option C: pipx, or pip inside a virtual environment
pipx install nanobot-ai
# python3 -m pip install nanobot-ai
# pip says "externally-managed-environment"? Use Option A or B: never --break-system-packages

インストールを確認する

新しいシェルで nanobot がPATHに含まれていない場合は、インストーラーが表示したランナー(uv tool run、pipx run、または管理venv)を使うか、~/.local/bin をPATHに追加してください:

nanobot --version
# 0.3.5

# `nanobot` not found? Use the runner the installer printed:
uv tool run --from nanobot-ai nanobot --version
pipx run --spec nanobot-ai nanobot --version
~/.nanobot/venv/bin/python -m nanobot --version

4. ステップ2:モデルプロバイダーを構成する(APIまたはローカルOllama)

nanobotはすべてを ~/.nanobot/config.json(プロバイダー、モデルプリセット、チャネル、ツール)から読み込み、メモリ、スキル、生成ファイルを ~/.nanobot/workspace/ に保存します。ターミナルウィザードが両方を作成します。公式ドキュメントの設定スニペットはcamelCaseのキーを使い、ファイルにマージすることを想定しています。丸ごと貼り付けるものではありません。このファイルは起動時に一度だけ読み込まれるため、編集のたびにゲートウェイを再起動してください。

ターミナルウィザードを実行する

# Documented path for SSH / headless installs (the installer already ran it unless skipped)
nanobot onboard --wizard
# Creates ~/.nanobot/config.json and ~/.nanobot/workspace/

# Later, after an upgrade: merge new default fields without overwriting your values
nanobot onboard --refresh

プロバイダーとモデルプリセットを追加する

プリセットはプロバイダーとモデルを結び付けます。ドキュメントの例はAnthropic直接で claude-opus-4-5 を使うものです。初回実行で最もよくある失敗は、あるプロバイダーのAPIキーと別のプロバイダーのモデルIDを混在させることなので、プリセットでは必ずプロバイダーを固定してください。公式の例ではキーを ${ANTHROPIC_API_KEY} として参照しており、nanobotを起動するプロセスの環境から解決され、書き戻されることはありません。これはシェルから起動するフォアグラウンドセッションでは機能しますが(デタッチされた --background プロセスによる環境の継承は文書化されていません)、ステップ4で生成されるLaunchAgentには環境変数が一切含まれません。そのためlaunchdでのデプロイでは、キーをconfig.jsonに保存し、SECURITY.mdの記載どおりファイルをロックダウンしてください:

# Merge into ~/.nanobot/config.json (key from console.anthropic.com)
{
  "providers": {
    "anthropic": { "apiKey": "sk-ant-YOUR_API_KEY_HERE" }
  },
  "modelPresets": {
    "primary": {
      "provider": "anthropic",
      "model": "claude-opus-4-5",
      "maxTokens": 8192,
      "contextWindowTokens": 200000
    }
  },
  "agents": { "defaults": { "modelPreset": "primary" } }
}

# Docs alternative for shell-started sessions: "apiKey": "${ANTHROPIC_API_KEY}"
# (resolved from the environment at startup; an unset variable fails fast with ConfigLoadError)

# Lock the config down (SECURITY.md)
chmod 700 ~/.nanobot && chmod 600 ~/.nanobot/config.json

任意:Ollamaでローカルモデルを使う

nanobotには専用の ollama プロバイダーがあります。Mac mini上でOllamaを別途起動し(当社のMac miniでLLMを実行するガイドを参照)、プロバイダーを http://localhost:11434/v1 に向けます、モデル名はプレフィックスなしの生のOllamaタグで、ほとんどのOllama環境ではAPIキーは不要です。フォールバックチェーンはプリセット名を参照するため、ホスト型のフロンティアモデルをプライマリに、ローカルのプリセットをフォールバックにできます(その逆も可能です):

# Ollama must already be running on the Mac mini (started separately, outside nanobot)
# Merge into ~/.nanobot/config.json: model = raw Ollama tag, no prefix, no API key needed
{
  "providers": {
    "ollama": { "apiBase": "http://localhost:11434/v1" }
  },
  "modelPresets": {
    "primary": {
      "provider": "ollama",
      "model": "llama3.2",
      "maxTokens": 4096,
      "contextWindowTokens": 32768
    }
  },
  "agents": { "defaults": { "modelPreset": "primary" } }
}

# Fallback chains use preset names, not model IDs: context is sized for the smallest window in the chain
# "agents": { "defaults": { "modelPreset": "primary", "fallbackModels": ["localSmall"] } }

セットアップを確認して最初のメッセージを送信する

ドキュメントは明確です:これが動作するまで、チャットアプリ、MCPサーバー、フォールバック、サービスを追加しないでください。

# Check the setup without calling a model
nanobot status

# First one-shot message (since v0.3.5 a bare `nanobot` opens the terminal UI instead)
nanobot -m "Hello!"

5. ステップ3:メッセージングチャネルを接続する

nanobotのチャットアプリのドキュメントは、Telegram、Discord、Slack、WhatsApp、WeChat、WeCom、Feishu/Lark、DingTalk、QQ、Matrix、メール、Mattermost、Linear、Microsoft Teams、Signal、Mochatに加え、同梱のWebUI、ターミナルUI、OpenAI互換API(nanobot serve)を扱っています。iMessageはサポートされていません。チャネルの依存関係は任意の機能です。設定でチャネルを有効にする前に、nanobot plugins enable <channel> で有効化してください。Telegramは最も早く動かせます、デフォルトでロングポーリングなので、Mac miniに受信ポートは不要です。Telegramガイドは初回セットアップにペアリング専用モードを推奨しています。allowFrom を省略し、信頼できるローカルCLIから最初のDMを承認します:

# 1. In Telegram, open @BotFather, send /newbot and copy the token (format: 1234567890:AAF...)

# 2. Enable the optional Telegram feature in the same Python environment as nanobot
nanobot plugins enable telegram

# 3. Merge into ~/.nanobot/config.json: omit allowFrom to use pairing-only mode
{ "channels": { "telegram": { "enabled": true, "token": "1234567890:AAF..." } } }

# 4. The channel must be listed, then run the gateway in the foreground for a first test
nanobot channels status
nanobot gateway

# 5. DM your bot once: it answers with a pairing code. Approve it from a second SSH session:
nanobot agent -m "/pairing approve ABCD-EFGH"

# 6. Stop the foreground gateway with Ctrl+C before installing the service in Step 4

Discord、Slack、またはWhatsAppを接続する

Discordには、Developer PortalでMESSAGE CONTENT INTENTを有効にしたボットトークンが必要です。デフォルトの groupPolicy mention を維持し、ボットが@メンションされたときのみ返信するようにしてください。SlackはSocket Mode(ボットトークンと connections:write 付きのアプリレベルトークン)を使い、公開URLは不要ですが、DMはデフォルトで開放されています、ペアリングコードを得るには dm.policy を allowlist に設定してください。WhatsAppはQRコードで連携し、v0.3.0以降は純粋なPython実装です(Node.jsブリッジなし)。そのセッションデータベースはアカウントへの完全なアクセスに等しいため、~/.nanobot/whatsapp-auth をモード0700に保ち、別の電話番号を使ってください:

# Discord: bot token with MESSAGE CONTENT INTENT enabled in the Developer Portal
{ "channels": { "discord": { "enabled": true, "token": "YOUR_DISCORD_BOT_TOKEN",
    "groupPolicy": "mention", "allowChannels": [] } } }

# Slack, Socket Mode (xoxb bot token + xapp app-level token with connections:write), no public URL
nanobot plugins enable slack
{ "channels": { "slack": { "enabled": true, "botToken": "xoxb-...", "appToken": "xapp-...",
    "dm": { "policy": "allowlist" } } } }

# WhatsApp: the CLI prints a QR code; scan it from WhatsApp > Linked Devices
# (if the QR is not readable in your terminal, run the same command over VNC; our advice: use a separate number)
nanobot plugins enable whatsapp
nanobot channels login whatsapp
{ "channels": { "whatsapp": { "enabled": true, "allowFrom": ["33612345678"] } } }
chmod 700 ~/.nanobot/whatsapp-auth   # session DB = full account access

# Every channel: verify it is listed, then restart the gateway
nanobot channels status

アクセス制御:allowFromとペアリング

DMに対応するすべてのチャネルは同じルールに従います。allowFrom を省略すると、最初のDMはペアリングコードを返し、すでに承認済みのチャットまたはCLIから承認します。空でないリストは厳密な許可リストで、それ以外の全員は無視されます。ワイルドカードはペアリングをバイパスし、チャネルに到達できる誰もがボットと会話できるようにします、ドキュメントはこれを、プライベートなサンドボックス内で意図的または一時的に使う場合にのみ認めており、本番環境では決して使いません:

# channels.<name>.allowFrom semantics
#   omitted          → pairing-only mode: the first DM returns a code such as ABCD-EFGH
#   ["123456789"]    → static allowlist (your numeric Telegram/Discord ID), everyone else ignored
#   ["*"]            → anyone who can reach the channel: never in production

# Pairing management from the trusted local CLI
nanobot agent -m "/pairing approve ABCD-EFGH"
nanobot agent -m "/pairing deny ABCD-EFGH"
nanobot agent -m "/pairing revoke 123456789"

# Slack / Mattermost need "dm": { "policy": "allowlist" } to issue pairing codes;
# "dm": { "enabled": false } disables DMs where you do not need them

6. ステップ4:強化、launchdで24時間365日稼働、更新

先に進む前に、フォアグラウンドのゲートウェイを停止します(Ctrl+C)。nanobotは、macOSでゲートウェイを稼働させ続ける方法を3つ文書化しています。nanobot自身が書き込むLaunchAgent、CLIから管理するデタッチされたバックグラウンドプロセス、またはテスト用の単純なフォアグラウンドプロセスです。ヘッドレスで24時間365日稼働するMac miniにはLaunchAgentを使ってください、launchdが監視し、障害時に再起動する唯一の選択肢です。まず設定を強化します。

永続化する前に強化する

公式の本番環境向けの推奨は、アプリケーションレベルのワークスペースガードとOSのexecサンドボックス、macOSではSeatbelt、の両方です。Seatbeltはエージェントのシェルコマンドをワークスペース(読み書き)、メディア(読み取り専用)、必要なシステムパスに閉じ込め、~/.nanobot 設定ディレクトリをマスクし、HOME と TMPDIR をワークスペースに向けます。ネットワークアクセスは制限せず、restrictToWorkspace 単体はOSのサンドボックスではありません。エージェントにシェルがまったく不要なら、ツールを完全に削除してください。また、tools.maxSessionMessagesPerMinute はデフォルトの6のままにし、LLMプロバイダーで支出上限を設定してください:

# Official production recommendation on macOS: merge into ~/.nanobot/config.json
{
  "tools": {
    "restrictToWorkspace": true,
    "exec": { "sandbox": "seatbelt" }
  }
}

# Agent does not need a shell? Remove the tool entirely instead:
# { "tools": { "exec": { "enable": false } } }

# Seatbelt sets HOME and TMPDIR to the workspace and masks ~/.nanobot. Scripts that need
# extra paths get them via tools.exec.sandboxRoBinds / sandboxRwBinds (use sparingly).
# Neither Seatbelt nor bwrap restricts network access.

# Keep WebUI / API on localhost (defaults: WebUI 127.0.0.1:8765, health 127.0.0.1:18790, serve 127.0.0.1:8900)
# and leave tools.webuiAllowRemotePackageInstall = false and tools.ssrfWhitelist = []

LaunchAgentをインストールする

nanobot gateway install-service は ~/Library/LaunchAgents/ai.nanobot.gateway.plist を書き込みます。これは現在のPythonで python -m nanobot gateway --foreground を実行し、ロード時に起動し(RunAtLoad)、クラッシュ時に再起動し(KeepAlive、SuccessfulExit false)、~/.nanobot/logs/ にログを出力します。手動のゲートウェイがまだ動いていると address already in use で失敗するため、先にそれを停止し、--dry-run でプレビューしてください:

# Stop any manually started gateway first (otherwise: "address already in use")
nanobot gateway stop

# Preview the plist, then install it
nanobot gateway install-service --manager launchd --dry-run
nanobot gateway install-service --manager launchd
# Writes ~/Library/LaunchAgents/ai.nanobot.gateway.plist
# Runs: python -m nanobot gateway --foreground  (RunAtLoad, KeepAlive on failure)
# Logs: ~/.nanobot/logs/

サービスを管理する

LaunchAgentはユーザーのguiドメインに属するため、そのユーザーのログインセッションが存在してから動作します、ドキュメントでは、ログイン後にオンラインを維持すると説明されています。ヘッドレスのMac miniを再起動した後は、ユーザーが自動ログインする場合にのみ復帰します。再起動テストを1回行い、launchctl list で確認してください。config.json を編集するたびに再起動します:

# Is it loaded?
launchctl list | grep ai.nanobot.gateway

# Restart after every config.json edit (config is read at startup only)
launchctl kickstart -k gui/$(id -u)/ai.nanobot.gateway

# Remove the service
nanobot gateway uninstall-service --manager launchd

# Second, isolated instance on the same Mac (own config, workspace, port and LaunchAgent).
# docs/multiple-instances.md: "Each instance must use a different port if they run at the same time"
# nanobot onboard --config ~/.nanobot-telegram/config.json --workspace ~/.nanobot-telegram/workspace
# Merge into ~/.nanobot-telegram/config.json (default gateway port is 18790; change the WebSocket
# channel port too if that instance also enables the WebUI, default 8765):
# { "gateway": { "host": "127.0.0.1", "port": 18792 },
#   "channels": { "websocket": { "port": 8766 } } }
# nanobot gateway install-service --manager launchd --name nanobot-telegram \
#   --config ~/.nanobot-telegram/config.json --workspace ~/.nanobot-telegram/workspace
# (for a one-off foreground run instead: nanobot gateway --config ~/.nanobot-telegram/config.json --port 18792)

より軽量な代替手段:nanobot gateway --background

READMEはこれを、共有ゲートウェイを永続的なバックグラウンドモードに昇格させる唯一のコマンドと呼んでいます。テストには便利ですがOSの監視下にはないため、再起動後に自動では復帰しません、LaunchAgentと併用しないでください:

nanobot gateway --background
nanobot gateway status
nanobot gateway logs
nanobot gateway restart
nanobot gateway stop

nanobotを更新する

nanobot update コマンドはありません。インストール時と同じ方法でアップグレードしてください。プロジェクトは毎週の更新確認を求めており、2026年には5件のセキュリティアドバイザリを公開しているため、速やかにアップグレードしましょう。まずリリースノートを読んでください、v0.3.5ではセッションファイルが sessions/<workspace-id>/ に移動し、設定、ワークスペース、セッションストレージをバックアップして古いプロセスを先に停止するよう指示しています。つまり、ゲートウェイを停止し(LaunchAgentをアンインストール、またはバックグラウンドモードなら nanobot gateway stop)、バックアップし、アップグレードしてから再起動します、2つのバージョンが同じワークスペースに同時に書き込む状態は決して作らないでください:

# 1. Stop the old gateway first (v0.3.5 release notes: never let two versions write the same workspace)
nanobot gateway uninstall-service --manager launchd   # LaunchAgent (nanobot documents no plain launchd stop)
# nanobot gateway stop                                  # --background mode

# 2. Back up config, workspace and sessions
cp -R ~/.nanobot ~/nanobot-backup-$(date +%F)

# 3. Upgrade with the same method you installed with
curl -fsSL https://raw.githubusercontent.com/HKUDS/nanobot/main/scripts/install.sh | sh
# or: uv tool upgrade nanobot-ai
# or: pipx upgrade nanobot-ai
# or: python3 -m pip install -U nanobot-ai

nanobot --version
nanobot onboard --refresh      # merge new default config fields, keep your values

# 4. Start again so the new code and config are loaded
nanobot gateway install-service --manager launchd     # LaunchAgent: reinstall (RunAtLoad starts it)
# nanobot gateway --background                          # --background mode

7. よくある問題のトラブルシューティング

インストーラーが中止する、pipがインストールを拒否する、またはnanobotがPATHにない

python3が3.11より古いとインストーラーは停止します、最新のPythonをインストールし、PYTHON 変数でそれを指定してください。externally-managed-environment エラーに --break-system-packages で応じては決していけません。uv、pipx、または仮想環境を使ってください。新しいシェルでコマンドが見つからない場合は、インストーラーが表示したランナーを使います:

# Python too old? Point the installer at a 3.11+ interpreter
python3 --version
PYTHON=/path/to/python3.12 sh -c "$(curl -fsSL https://raw.githubusercontent.com/HKUDS/nanobot/main/scripts/install.sh)"

# "externally-managed-environment" → isolated install, never --break-system-packages
uv tool install nanobot-ai
# or: pipx install nanobot-ai

# "curl: command not found" → skip the script
uv tool install nanobot-ai

# `nanobot` not on PATH in a new shell
uv tool run --from nanobot-ai nanobot --version
pipx run --spec nanobot-ai nanobot --version
~/.nanobot/venv/bin/python -m nanobot --version
export PATH="$HOME/.local/bin:$PATH"

最初のメッセージが失敗する:モデルの誤り、ConfigLoadError、またはプロバイダーエラー

あるプロバイダーのキーと別のプロバイダーのモデルIDの組み合わせが、初回実行で最もよくある失敗です。未設定の ${VAR} プレースホルダーは、起動時に ConfigLoadError で即座に失敗させます、LaunchAgentの下では環境が渡されないため、そこでは保存済みのキーを使ってください。モデルを呼び出さずにセットアップを確認し、詳細ログ付きで再試行します:

# Validate without spending tokens
nanobot status

# Provider and model must match in the preset: provider "anthropic" ↔ "claude-opus-4-5",
# provider "openai" ↔ "gpt-5", provider "openrouter" ↔ "anthropic/claude-opus-4.5", provider "ollama" ↔ "llama3.2"

# ConfigLoadError at startup = a ${VAR} placeholder is unset in the starting process' environment
# (the generated LaunchAgent passes no environment → store the key in config.json + chmod 600)

# Watch the gateway with verbose logging (also verifies MCP servers)
nanobot gateway --verbose

Telegramボットが沈黙したまま

通常は次の3つのいずれかです:同じPython環境で telegram 機能が有効化されていない、DMがまだペアリング承認待ちになっている、またはゲートウェイを再起動せずに config.json を編集した(設定は起動時にのみ読み込まれます)。チャネル一覧を確認し、保留中のペアリングを承認して再起動します:

# Is the channel enabled and listed?
nanobot plugins enable telegram
nanobot channels status

# Pending pairing? Approve it from the CLI
nanobot agent -m "/pairing approve ABCD-EFGH"

# Edited config.json? Restart the gateway
launchctl kickstart -k gui/$(id -u)/ai.nanobot.gateway
# or: nanobot gateway restart

# Token revoked? Generate a new one via @BotFather (/mybots > API Token) and update config.json
# WhatsApp "login expired"? nanobot channels login whatsapp

LaunchAgentが起動しない、または再起動後にゲートウェイが消えている

address already in use は、手動で起動したゲートウェイ(フォアグラウンドまたは --background)がまだポートを保持していることを意味します、停止して再インストールしてください。再起動後、guiドメインのLaunchAgentはユーザーがログインしてから起動します。ログは ~/.nanobot/logs/ にあります。WebUIはポート8765で、18790はヘルスエンドポイント専用です:

# "address already in use" → a manual gateway still holds the port
nanobot gateway stop
nanobot gateway install-service --manager launchd

# Loaded? Logs?
launchctl list | grep ai.nanobot.gateway
ls ~/.nanobot/logs/

# Gone after a reboot: a gui-domain LaunchAgent starts once your user has logged in.
# If your setup allows automatic login for the nanobot user, enable it and reboot-test;
# WARNING: auto-login trades console-login security for reboot survival, confirm with your ops policy first.

# Ports: WebUI 8765 (localhost), health endpoint 18790, `nanobot serve` API 8900
# Generic SSH tip (not a nanobot feature): reach the localhost WebUI from your laptop
# ssh -N -L 8765:127.0.0.1:8765 admin@your-server-ip   → http://127.0.0.1:8765

8. クラウドVPSとのコスト比較

nanobot自体は無料(MIT)です。費用がかかるのはホストとLLMの利用分です。以下のホスト比較は、当社のOpenClawガイドとHermesガイドのクラウドVPSの価格帯を再利用しています。LLM APIの利用料はプロバイダーから別途請求され、どちらのホストでも同額です、ただし、Mac mini上でローカルのOllamaモデルを実行する場合は、推論コストは$0になります。nanobotはRAMやCPUのフットプリントの数値を公開していない(自らを超軽量と表現しているだけ)ため、以下のプランのサイジングは定性的なものです。

ユースケース AIコール数/月 クラウドVPSのコスト MyRemoteMacのコスト 月間の節約額
パーソナルアシスタント(ホスト型APIモデル) 約500コール $120/月(基本的なGPU VPS) $85/月(Mac mini M4) $35/月
チーム向けボット + スケジュールされた自動化 約5,000コール $200/月 $85/月(Mac mini M4) $115/月
ローカルOllamaモデル + エージェントを1台で 無制限(ローカル) $350以上/月(GPU VPS) $149/月(Mac mini M6) $201以上/月
複数の分離インスタンス、大規模な自動化 10,000コール以上 $600以上/月 $149/月(Mac mini M6) $451以上/月

前提:VPSの価格は、GPU対応のAIプランインスタンスについて当社のガイド全体で使用している価格帯と同じで、特定のプロバイダーの見積もりではありません。MyRemoteMacの価格は現在の月額料金(USD、1 Gbps込み、Mac mini M6は2026年9月22日から提供)です。M4/M6の区分は推奨であり、計測された要件ではありません。ホスト型プロバイダーを使うパーソナルボットならMac mini M4で十分です。同じマシンでローカルのOllamaモデルや複数のnanobotインスタンスも動かす場合はM6を選んでください。

結論: 専用Mac miniは、あらゆる利用レベルでGPU VPSより低コストです。さらにnanobotのプリセットベースのフォールバックチェーンにより、定型作業は無料のローカルOllamaプリセットにルーティングし、難しい質問にはホスト型のフロンティアモデルを残しておけます、すべて、あなただけのハードウェア上で。

9. nanobot vs. OpenClaw

どちらもオープンソース(MIT)で、セルフホスト型、常時稼働のパーソナルAIエージェントであり、チャットアプリから操作します。どちらも長時間稼働するゲートウェイを実行し、それぞれ独自のlaunchd LaunchAgent(ai.nanobot.gateway と ai.openclaw.gateway)を登録します。nanobotのREADMEは、OpenClawから来た人にとって nanobot gateway は馴染みのあるエントリーポイントだとまで述べています。違いはスタックと売りにあります。OpenClawはNode.js(26.1以上、またはHomebrew経由で24.16以上)上のTypeScriptで、npmでインストールします。nanobotはPyPI(nanobot-ai)のPython 3.11以上で、ワンライナーのスクリプト、uv、またはpipxでインストールし、Node.jsは一切不要です。OpenClawの売りは機能の幅広さと大きなコミュニティ、nanobotの売りは小さく読みやすいコア、チャネルごとのペアリングとmacOS Seatbelt execサンドボックスの内蔵(v0.3.5で新登場)、1台のMac上の複数の分離インスタンス(multiple-instances.md)、そしてPython SDKとOpenAI互換APIです。OpenClawはiMessageに対応していますが、nanobotは対応していません。

最も機能が充実したアシスタントと、より大きなコミュニティとチャネル一覧を求めるなら、当社のMac mini向けOpenClawガイドをお読みください。端から端まで読み通せる軽量なPythonエージェント、サンドボックス化された複数のインスタンス、または同じMac mini上のOllamaを求めるなら、nanobotの方が適しています。3つ目の選択肢であるHermes Agentは、当社のMac mini向けHermesガイドで扱っています。Mac mini、launchdサービス、ローカルOllamaのオプションは3つとも共通です。

10. FAQ

nanobotは無料で使えますか?

はい。nanobotはMITライセンスで無料です。支払うのは選んだプロバイダーのLLM利用料だけです。Mac mini上のローカルOllamaモデルは無料で実行できます。Mac mini自体はMyRemoteMacで月額$85(M4)または月額$149(M6)からで、USDで請求されます。

nanobotにはどのMac mini構成を選ぶべきですか?

nanobotはRAMやCPUの数値を公開していないため、これは定性的な判断です。ホスト型プロバイダー(Anthropic、OpenAI、OpenRouterなど)を使うパーソナルボットなら、月額$85のエントリーMac mini M4(16 GB / 256 GB)が妥当な選択です。エージェントは超軽量と説明されています。同じマシンでローカルのOllamaモデルや複数の分離されたnanobotインスタンスも実行する場合は、月額$149からのMac mini M6を選んでください。メモリと計算資源を必要とするのはローカル推論だからです。

Mac miniを再起動してもnanobotは動き続けますか?

nanobot gateway install-service --manager launchd が書き込むLaunchAgentには RunAtLoad true と KeepAlive が含まれるため、launchdはユーザーセッションのロード時に起動し、クラッシュ後に再起動します。guiドメインに属するため、再起動後はユーザーがログインしてはじめて復帰します。そのユーザーの自動ログインが環境上許容されるなら、有効にすることで再起動後にサービスが復元されます、ただし、自動ログインはコンソールログインのセキュリティと引き換えに再起動耐性を得るものなので、まず運用ポリシーに照らして確認してください、その後、再起動テストを1回行い、launchctl list | grep ai.nanobot.gateway で検証します。nanobot gateway --background は監視されておらず、再起動後は復帰しません。

nanobotはAPIの代わりにローカルモデルを使えますか?

はい。nanobotには専用の ollama プロバイダー(デフォルトの apiBase は http://localhost:11434/v1)に加え、他のローカルOpenAI互換サーバー向けに lm_studio、vllm、OVMS があります。Mac mini上でOllamaを起動し、プリセットの model を生のOllamaタグ(例:llama3.2)に設定して、provider を ollama に固定します。ほとんどのOllama環境ではAPIキーは不要です。ツールを使うターンが遅い場合、ドキュメントはメモリやコンテキストの設定に手を付ける前に、モデルのチャットテンプレートとプロンプトキャッシュの再利用を確認するよう求めています。

nanobotはどのメッセージングプラットフォームに対応していますか?

公式のチャットアプリのドキュメントには、Telegram、Discord、Slack、WhatsApp、WeChat/Weixin、WeCom、Feishu/Lark、DingTalk、QQ(およびNapcat/OneBot)、Matrix/Element、メール、Mattermost、Linear、Microsoft Teams、Signal、Mochatが記載されており、1つのゲートウェイで提供されます、さらに同梱のWebUI、ネイティブのターミナルUI、nanobot serve によるOpenAI互換HTTP APIも含まれます。iMessageはサポートされていません。

Mac mini上のAIエージェントにシェルアクセスを与えても安全ですか?

文書化されたガードレールを守る場合に限ります:nanobotを標準ユーザーとして実行し(決してrootでは実行しない)、tools.restrictToWorkspace を true に、tools.exec.sandbox を seatbelt に設定します(macOSにおけるプロジェクトの本番環境向けの推奨)。エージェントにシェルがまったく不要なら、tools.exec.enable を false に設定します。すべてのチャネルでペアリング専用モードまたは絞り込んだ allowFrom を維持し、ワイルドカードは決して使わず、WebUIとAPIはlocalhostにバインドしたまま、デフォルトのレート制限(1分あたり6メッセージ)を維持し、プロバイダーで支出上限を設定し、毎週更新してください、2026年には5件のアドバイザリが公開されているため、0.3.5以降を実行してください。

11. 出典と参考資料

本ガイドのすべてのコマンド、パス、設定キーは、公式のnanobotリポジトリ(READMEと docs/ ツリー、2026年9月28日に確認、v0.3.5)とそのSECURITY.mdに基づいています。リポジトリのドキュメントは最新のパッケージリリースより新しい場合があるため、コマンドの動作が異なる場合はリポジトリに照らして再確認してください。

関連ガイド

nanobotを24時間365日稼働させる準備はできましたか?

専用Mac miniをセルフホスト型AIエージェントのホストとして導入しましょう。Mac mini M4は月額$85から、Mac mini M6は月額$149から、1 Gbps込み。

さらに詳しい情報をお探しですか?

ステップバイステップのセットアップ手順、設定リファレンス、トラブルシューティングについては、完全なドキュメントをご覧ください。

ドキュメントを開く →