iMessage bridge setup (macOS)
Please note that everything in these docs are meant for server admins who want to self-host the bridge. If you're just looking to use the bridges, check out Beeper, which provides fully managed instances of all of these bridges.
Requirements
- A computer running a reasonably new version of macOS.
- The bridge requires full disk access in privacy settings to read your chat database.
- A Matrix homeserver that supports application services (e.g. Synapse). You need access to register an appservice, which usually involves editing the homeserver config file.
- A websocket proxy to receive appservice transactions.
If you want to compile the bridge manually (which is not required), you'll also need:
- Go 1.19+ (download & installation instructions at https://go.dev/doc/install).
- libolm3 with dev headers (
brew install libolm). - Optionally libheif with dev headers for heif -> jpeg conversion (
brew install libheif).
Installation
You may either compile the bridge manually or download a prebuilt executable from the mau.dev CI.
Compiling manually
- Clone the repo with
git clone https://github.com/mautrix/imessage.git. - Enter the directory (
cd mautrix-imessage). - Run
./build.shto fetch Go dependencies and compile (build.shwill simply callgo buildwith some additional flags).
Downloading a prebuilt executable
- Go to https://mau.dev/mautrix/imessage/-/pipelines?scope=branches&page=1
- Find the entry for the
masterbranch and click the download button on the right-hand side in the list.- There are three entries: universal, arm64 (Apple Silicon) and amd64 (Intel). You can either pick universal, or the specific architecture depending on what Mac you have.
- Extract the downloaded zip file into a new directory.
Configuring and running
- Copy
example-config.yamltoconfig.yaml - Update the config to your liking.
- You need to make sure that the
addressanddomainfield point to your homeserver. - You will also need to add your user ID to the
bridgesection.
- You need to make sure that the
- Generate the appservice registration file by running
./mautrix-imessage -g.- You can use the
-cand-rflags to change the location of the config and registration files. They default toconfig.yamlandregistration.yamlrespectively.
- You can use the
- Set up mautrix-wsproxy.
- Update your registration file so the
urlfield points to wsproxy (e.g.http://localhost:29331, this is where your homeserver reaches wsproxy), and make sure thewebsocket_proxyfield in the bridge config also points to wsproxy (e.g.ws://matrix.example.com:29331, where the bridge reaches wsproxy). - Register the bridge on your homeserver (see Registering appservices).
- Run the bridge with
./mautrix-imessage. - If/when the bridge fails to initialize the iMessage connector with the
operation not permittederror, go to System Preferences -> Security & Privacy -> Privacy -> Full Disk Access and grant access to the terminal you're running the bridge in.