Deploy an OpenClaw gateway on a Linux server and use Tailscale to create a secure tunnel to your Mac. This lets you manage iMessage on your Mac through OpenClaw.
Architecture
┌──────────────────────────────┐ SSH (imsg rpc) ┌──────────────────────────┐
│ Gateway host (Linux/VM) │──────────────────────────────────▶│ Mac with Messages + imsg │
│ - clawdbot gateway │ SCP (attachments) │ - Messages signed in │
│ - channels.imessage.cliPath │◀──────────────────────────────────│ - Remote Login enabled │
└──────────────────────────────┘ └──────────────────────────┘
▲
│ Tailscale tailnet (hostname or 100.x.y.z)
▼
user@gateway-hostProcedure
Tailscale configuration
Configure Tailscale on your Mac and server to establish a network connection. First, register for an account at Tailscale.
Download and install Tailscale on your Mac from the download page.

After installation, start Tailscale from the command line:
/Applications/Tailscale.app/Contents/MacOS/Tailscale upTo install Tailscale on your Linux server, go to this page to get the installation script. Then, run the script on your Linux operating system.


After the script runs, your Mac and Linux server are on the same local area network and can communicate with each other.

Tailscale might overwrite the DNS settings on your Linux server, which can cause network connection failures. To fix this, configure the nameserver to use
1.1.1.1or8.8.8.8.

Mac configuration
Enable remote connection permissions on your Mac. Go to .
Grant permissions to sshd-keygen-wrapper. Go to .
Make sure you are logged on to iMessage on your Mac.
Clawdbot configuration
Edit the configuration file at
/root/.clawdbot/clawdbot.jsonand add thechannelconfiguration.{ "channels": { "imessage": { "enabled": true, "cliPath": "/root/.clawdbot/scripts/imsg-ssh", "dbPath": "/Users/{{YOUR_USER_NAME}}/Library/Messages/chat.db", "remoteHost": "{{YOUR_USER_NAME}}@{{YOUR_MAC_MAGIC_DNS}}", "dmPolicy": "pairing", "groupPolicy": "allowlist", "includeAttachments": true } } }Pay attention to the following parameters:
YOUR_USER_NAME: Replace with your Mac username.
YOUR_MAC_MAGIC_DNS: Replace with the Magic DNS of your Mac from your Tailscale network.
To get the Magic DNS:

Create the
/root/.clawdbot/scripts/imsg-sshfile. This script forwards commands to your Mac usingssh. Replace {{YOUR_USER_NAME}}@{{YOUR_MAC_MAGIC_DNS}} with the value from the previous step. Then, grant execute permission to the file.#!/usr/bin/env bash exec ssh -T {{YOUR_USER_NAME}}@{{YOUR_MAC_MAGIC_DNS}} /usr/local/bin/imsg "$@"You can now connect to your Mac from the Linux server with a password using
ssh {{YOUR_USER_NAME}}@{{YOUR_MAC_MAGIC_DNS}}. Configure passwordless logon from the Linux server to the Mac using SSH key authentication.Start and initialize the gateway:
cd /home/clawdbot/ pnpm clawdbot onboard --install-daemon
Results
Connect to Chat through the TUI.
Input: Send a poem to +86188xxxxxxxx using iMessage. The Mac then sends a poem to the specified number.
