2026 Hermes Agent 安裝部署教學
macOS / Linux / Telegram Gateway 七步跑通 7×24
對象:已關注 Nous Research / hermes-agent、卡在「裝不上 / Gateway 起不來 / Telegram 無回應」的台港開發者。範圍:本篇只講 安裝、驗收、Gateway 常駐與頻道接入,不展開三層記憶——見 7×24 與記憶架構文。結果:約 90 分鐘內用官方 curl、hermes setup、hermes doctor 與 hermes gateway 在手機 Telegram 收到回覆。
2026 年 6 月,Hermes Agent(Nous Research,MIT)以一行 curl -fsSL https://get.hermes-agent.org | bash 在 macOS 與 Linux 落地 CLI,再透過 Gateway 把 Telegram 接到常駐程序。與 三層記憶與伺服器選型文、30 天實測與 Skill 複利文 不同,本篇是純安裝 How-To:主機矩陣、七步命令、三條數據與租用轉化。遠端 macOS 7×24 流程見 按日租用 Mac FAQ,方案見 Mac mini M4 定價頁。
目錄 · TABLE OF CONTENTS
01. 安裝前三痛點:腳本、Gateway、Telegram
客服工單裡,Hermes 安裝階段重複率最高的三類問題:
- curl 中斷或 PATH 未生效:公司代理、舊版 bash、或未重開 shell;有人混用 pip 舊版與官方腳本。對策:只用
get.hermes-agent.org,裝完跑hermes doctor。 - Gateway 未常駐:只跑 CLI,未
hermes gateway start/install;MacBook 合蓋休眠。對策:Linux 用 systemd;macOS 用 LaunchAgent 或機房 Mac mini。 - Telegram Token 與 allowlist 錯誤:Token 外洩、未 export、Bot 未 Start。對策:BotFather 重建後走 gateway 精靈,手機先點 Start。
02. 主機與環境選型矩陣
開始 curl 前對照下表——Gateway 需要穩定 HTTPS 出站與足夠磁碟、記憶體:
| 宿主選項 | 安裝路徑 | 適合場景 | 注意事項 |
|---|---|---|---|
| MacBook(開發試用) | macOS 原生 curl | 當日驗證 CLI | 休眠會斷 Gateway,不適合 7×24 Telegram |
| Linux 雲端伺服器(2 vCPU / 4GB 記憶體+) | curl + systemd | 最便宜公網 IP、機房頻寬穩 | 釋放實例前須備份 ~/.hermes/ |
| 自購 Mac mini M4 | get.hermes-agent.org | 長期 7×24、可選本機 Ollama | 家用上傳頻寬;管理 SSH 建議 Tailscale |
| MacDate Mac mini M4 租用 | 相同 macOS 安裝 | 先證 Telegram + 記憶再買硬體 | 退租 NIST 擦除——先 tarball 備份 |
帳號清單:LLM API 金鑰(hermes setup 寫入)、Telegram Bot Token(@BotFather)、SSH(租用節點見 FAQ)、磁碟 ≥10GB。
03. 七步安裝:curl → setup → doctor → gateway → Telegram
macOS 與 Linux 通用;MacDate 節點先 ssh admin@[IP]。預估 60~90 分鐘含 Telegram 配對與重開機測試。
- 登入並檢查出站:
curl -fsSLI https://get.hermes-agent.org與api.telegram.org無憑證錯誤。 - 官方一鍵安裝:
curl -fsSL https://get.hermes-agent.org | bash,hermes --version。 - hermes setup:填入 Provider 與 API 金鑰,確認
~/.hermes/可寫。 - hermes doctor:全綠再繼續;可併跑
hermes memory status。 - Gateway 初始化:
hermes gateway setup,再start或install服務化。 - Telegram:
export TELEGRAM_BOT_TOKEN=...,hermes channels add telegram,手機 Start 後測試。 - 自啟與備份:launchd/systemd 自啟、重開機後手機 ping;
tar czf hermes-backup.tar.gz ~/.hermes/。
04. Telegram:BotFather、Token 與 hermes gateway
順序勿跳步:@BotFather /newbot → 環境變數注入 Token(勿寫進聊天)→ allowlist 自己的 user ID → hermes gateway start。Hermes 多以長輪詢出站連 Telegram,通常不必開 inbound 公網埠;仍須保護 SSH 與 Bot Token。
Discord 可平行 hermes channels add discord;企業 IM 建議分機部署,避免單一 gateway 程序重啟牽連全部頻道。
05. 宿主對照:MacBook vs Linux 伺服器 vs Mac mini M4
| 維度 | MacBook | Linux VPS | Mac mini M4 |
|---|---|---|---|
| 安裝命令 | 相同 curl 腳本 | 相同 | macOS 原生 + 可選 Ollama |
| 7×24 Gateway | 合蓋休眠 | systemd 易常駐 | 低功耗機房/桌下 |
| Telegram 延遲 | 視當下網路 | 跨區 RTT 可能 +50~200ms | MacDate 香港節點常 15~30ms |
在 MacBook 完成七步後,可把 ~/.hermes/ 打包遷到租用節點——遷移後必重跑 hermes doctor 與 gateway install。TCO 理由見 選型文。
06. 三條安裝數據與常見錯誤
- ① 安裝入口:唯一推薦
curl -fsSL https://get.hermes-agent.org | bash,與 GitHub README 同步;裝完hermes --version對照 Release。 - ② Gateway 記憶體:僅 Telegram + 雲端 API 時常駐通常 < 300 MB,4GB 記憶體 Linux 伺服器或 8GB Mac mini 足夠;瓶頸多在 API 配額。
- ③ 驗收順序:setup → doctor → gateway,可減少「Bot 在線但模型 401」的偽故障;還原備份後必再 doctor。
速查:command not found: hermes → 重開 shell;gateway timeout → 出站與 Token;doctor 記憶體外掛可等頻道跑通後再讀 30 天實測文 調 Skill。
07. 轉化:何時把安裝遷到租用 Mac mini M4
MacBook 上裝通只代表「會裝」;要 7×24 收 Telegram、Cron 準時、Gateway 不因合蓋失聯,需要常通電宿主。MacDate 按日/彈性租用 Mac mini M4 讓你用同一套 curl 與 gateway install 在遠端 macOS 裸機重現本教學:機房頻寬、獨立 ~/.hermes/、退租前 tarball、釋放時 NIST 擦除——與 Nous Research 品牌無關。定價:裸機定價;SSH:租用 FAQ;為何值得 7×24:記憶選型文。