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.

Billing overview
Deploying and using OpenClaw on a Simple Application Server incurs the following fees:
Simple Application Server fees: For more information, see Simple Application Server billing overview.
Model call fees: The OpenClaw image on Simple Application Server includes a default model configuration. The default model varies based on your purchase date.
On or after January 31, 2026: The default model is
qwen3-max-2026-01-23. For pricing details, see Qwen Max model billing.Before January 30, 2026: The default model is
qwen-vl-plus. For pricing details, see Qwen-VL model billing.
Model call cost control
Purchase and configure a Coding Plan from Alibaba Cloud Model Studio: To avoid unexpected costs during initial use, subscribe to a Coding Plan. It provides a specific quota every 5 hours and is automatically disabled if the quota is exceeded. After deployment, modify configurations as described in Use a Coding Plan purchased from Alibaba Cloud Model Studio in OpenClaw. The Coding Plan supports deductions only for calls to
qwen3-max-2026-01-23andqwen3-coder-plusmodels.Enable Stop on Free Quota Exhaustion (Singapore region only): By default, Alibaba Cloud Model Studio (Singapore region) continues to incur charges after the free quota is exhausted. To avoid charges beyond the free quota, go to Alibaba Cloud Model Studio and enable Stop on Free Quota Exhaustion.