BlueBubbles (iMessage)
iMessage عبر BlueBubbles
What this page is, and what it holds.
This page covers BlueBubbles (iMessage). You will use hermes gateway run and hermes logs gateway here; about 4 minutes to read. Open the channel to yourself first with an allowlist. An open channel means anyone can message your agent.
Outcomes taken from this page, not a template.
- Understand what بوابة المراسلة is and when you need it.
- Run
hermes gateway runandhermes logs gatewayand understand what happens next. - Read the table and take only the row that applies to you.
- Set
BLUEBUBBLES_SERVER_URLin the right place.
Exactly as they appear in Hermes.
hermes gateway runhermes logs gatewayhermes pairing listhermes gateway setuphermes pairing approve bluebubbles
BLUEBUBBLES_SERVER_URLBLUEBUBBLES_PASSWORDBLUEBUBBLES_ALLOWED_USERSBLUEBUBBLES_ALLOW_ALL_USERS
Jump to the part you need.
Nothing summarised away.
The documentation body below is reproduced from the official source so commands and identifiers stay exact. Each section carries a short note describing what it contains.
Connect Hermes to Apple iMessage via BlueBubbles ↗ — a free, open-source macOS server that bridges iMessage to any device.
Prerequisites
Explains the idea itself. Read it slowly; the later sections build on it.
- A Mac (always on) running BlueBubbles Server ↗
- Apple ID signed into Messages.app on that Mac
- BlueBubbles Server v1.0.0+ (webhooks require this version)
- Network connectivity between Hermes and the BlueBubbles server
Setup
Ordered, practical steps. Run one and confirm it worked before moving on. Commands here: hermes gateway run, hermes pairing list.
1. Install BlueBubbles Server
Download and install from bluebubbles.app ↗. Complete the setup wizard — sign in with your Apple ID and configure a connection method (local network, Ngrok, Cloudflare, or Dynamic DNS).
2. Get your Server URL and Password
In BlueBubbles Server → Settings → API, note:
- Server URL (e.g.,
http://192.168.1.10:1234) - Server Password
3. Configure Hermes
Run the setup wizard:
hermes gateway setupSelect BlueBubbles (iMessage) and enter your server URL and password.
Or set environment variables directly in ~/.hermes/.env:
BLUEBUBBLES_SERVER_URL=http://192.168.1.10:1234
BLUEBUBBLES_PASSWORD=your-server-passwordOptional: Require mentions in group chats
By default, Hermes responds to every authorized BlueBubbles/iMessage DM or group message. To make group chats opt-in, enable mention gating:
platforms:
bluebubbles:
enabled: true
extra:
require_mention: trueWith require_mention: true, DMs still work normally, but group-chat messages are ignored unless they match a mention pattern. If you do not configure custom patterns, Hermes uses conservative defaults for Hermes and @Hermes agent variants.
For a custom agent name, set regex patterns:
platforms:
bluebubbles:
extra:
require_mention: true
mention_patterns:
- '(?<![\w@])@?amos\b[,:\-]?'4. Authorize Users
Choose one approach:
DM Pairing (recommended): When someone messages your iMessage, Hermes automatically sends them a pairing code. Approve it with:
hermes pairing approve bluebubbles <CODE>Use hermes pairing list to see pending codes and approved users.
Pre-authorize specific users (in ~/.hermes/.env):
BLUEBUBBLES_ALLOWED_USERS=user@icloud.com,+15551234567Open access (in ~/.hermes/.env):
BLUEBUBBLES_ALLOW_ALL_USERS=true5. Start the Gateway
hermes gateway runHermes will connect to your BlueBubbles server, register a webhook, and start listening for iMessage messages.
How It Works
Explains the idea itself. Read it slowly; the later sections build on it.
iMessage → Messages.app → BlueBubbles Server → Webhook → Hermes
Hermes → BlueBubbles REST API → Messages.app → iMessage- Inbound: BlueBubbles sends webhook events to a local listener when new messages arrive. No polling — instant delivery.
- Outbound: Hermes sends messages via the BlueBubbles REST API.
- Media: Images, voice messages, videos, and documents are supported in both directions. Inbound attachments are downloaded and cached locally for the agent to process.
Environment Variables
A lookup table. Do not read it all; find the row that applies to you.
| Variable | Required | Default | Description |
|---|---|---|---|
BLUEBUBBLES_SERVER_URL | Yes | — | BlueBubbles server URL |
BLUEBUBBLES_PASSWORD | Yes | — | Server password |
BLUEBUBBLES_WEBHOOK_HOST | No | 127.0.0.1 | Webhook listener bind address |
BLUEBUBBLES_WEBHOOK_PORT | No | 8645 | Webhook listener port |
BLUEBUBBLES_WEBHOOK_PATH | No | /bluebubbles-webhook | Webhook URL path |
BLUEBUBBLES_HOME_CHANNEL | No | — | Phone/email for cron delivery |
BLUEBUBBLES_ALLOWED_USERS | No | — | Comma-separated authorized users |
BLUEBUBBLES_ALLOW_ALL_USERS | No | false | Allow all users |
BLUEBUBBLES_REQUIRE_MENTION | No | false | Require a mention pattern before responding in group chats |
BLUEBUBBLES_MENTION_PATTERNS | No | Hermes wake words | JSON array, newline-separated, or comma-separated regex patterns for group mention matching |
Auto-marking messages as read is controlled by the send_read_receipts key under platforms.bluebubbles.extra in ~/.hermes/config.yaml (default: true). There is no corresponding environment variable.
Features
Explains the idea itself. Read it slowly; the later sections build on it.
Text Messaging
Send and receive iMessages. Markdown is automatically stripped for clean plain-text delivery.
Rich Media
- Images: Photos appear natively in the iMessage conversation
- Voice messages: Audio files sent as iMessage voice messages
- Videos: Video attachments
- Documents: Files sent as iMessage attachments
Tapback Reactions
Love, like, dislike, laugh, emphasize, and question reactions. Requires the BlueBubbles Private API helper ↗.
Typing Indicators
Shows "typing..." in the iMessage conversation while the agent is processing. Requires Private API.
Read Receipts
Automatically marks messages as read after processing. Requires Private API.
Chat Addressing
You can address chats by email or phone number — Hermes resolves them to BlueBubbles chat GUIDs automatically. No need to use raw GUID format.
Private API
Explains the idea itself. Read it slowly; the later sections build on it.
Some features require the BlueBubbles Private API helper ↗:
- Tapback reactions
- Typing indicators
- Read receipts
- Creating new chats by address
Without the Private API, basic text messaging and media still work.
Troubleshooting
A troubleshooting section. Find the symptom that matches yours rather than reading it end to end. Commands here: hermes logs gateway.
"Cannot reach server"
- Verify the server URL is correct and the Mac is on
- Check that BlueBubbles Server is running
- Ensure network connectivity (firewall, port forwarding)
Messages not arriving
- Check that the webhook is registered in BlueBubbles Server → Settings → API → Webhooks
- Verify the webhook URL is reachable from the Mac
- Check
hermes logs gatewayfor webhook errors (orhermes logs -fto follow in real-time)
"Private API helper not connected"
- Install the Private API helper: docs.bluebubbles.app ↗
- Basic messaging works without it — only reactions, typing, and read receipts require it
3 questions answered by this page alone.
Every option is a real identifier from the Hermes documentation. The wrong ones are real too, just from other pages.