Mautrix-iMessage Bluebubbles Bridge Advanced Configuration
Written 12/14/2024 Updated 1/10/2025
Written by mackid1993 on Beeper (Don't DM me, I will ignore you, this is for informational purposes only and I don't have time to support this.) roc helped a lot with the auto update script.
If you don't know why your password doesn't show up in the terminal when you type sudo
please close this window and don't attempt this, please follow the guide linked below or use the automated script.
This is intended to be a fully manual unscripted setup for advanced users. This will enable use of easy to use ~/.zshrc
aliases to quickly and easily control the bridge as well as autoupdate bbctl as well as mautrix-imessage. This guide will work for both amd64 and arm64 Macs. It uses the --compile
flag for mautrix-imessage for amd64 compatibility. This is intended for skilled users comfortable with the command line. No support will be provided. This builds off the work of all of those involved with this guide especially the launchd automation section.
Initial Folders We Will Need
We need to create folders in the following places:
/Users/Shared
/Users/Shared/Scripts
If not created also create ~/Library/LaunchAgents/
Setup bbctl and Auto Updates
- Open a Terminal and install Homebrew
You may also be asked to install xcode command line tools. Additionally once Homebrew is installed pay attention to the terminal as it may ask you to run a few manual commands to add some things to PATH.
cd /Users/Shared
Now we're going to clone bbctl.
git clone https://github.com/beeper/bridge-manager.git
Now we install some dependencies to get bridge manager and later mautrix-imessage to compile.
You may run into issues if your version of macOS doesn't have Homebrew binaries for these dependencies, Ventura or newer is highly suggested.
- Run one after another:
- Now let's get bridge-manager compiled the first time. Run one after another.
Let it build.
chmod +x bbctl
- Now add bbctl to PATH.
Ensure any other copies of bbctl are removed from the machine to not cause conflicts!!
echo 'export PATH=$PATH:/Users/Shared/bridge-manager' >> ~/.zshrc && source ~/.zshrc
- Now for our auto update script:
cd /Users/Shared/Scripts
nano update-bbctl.sh
Within nano paste the following bash script:
Save and exit out of nano.
- Finally make our update script executable:
chmod +x update-bbctl.sh
Create Our Launchd Plist (Thanks JasonL)
- Navigate to the following path:
cd ~/Library/LaunchAgents
sudo nano bbctl-bluebubbles.plist
Paste in the following plist, ensure your Bluebubbles server and password are correct:
Save and edit out of nano.
Edit ~/.zshrc to make the bridge easy to manage
sudo nano ~/.zshrc
Paste in the following:
Save and exit nano.
Now once you restart your terminal:
start-bb
will update bbctl and start the bridge. This will also autostart it when your Mac reboots and it will continue to run until you run stop-bb
. bb-log
will show the output from the bridge in real time, just like it was running in the Terminal. bb-server-restart
will restart Bluebubbles. These are very useful when using a VPN server at home such as Wireguard and connecting to your home network from a cellphone, allowing you to troubleshoot your bridge using an SSH client on a cellphone in a pinch.
My favorite is to run start-bb && bb-log
which will start the bridge and show the output so you can see if something is misconfigured or erroring.
Auto Restart Our Mac So Everything Stays Up to Date
Finally we want our Mac to restart weekly so the bridge restarts, bbctl and mautrix-imessage update and everything works with minimal intervention.
Open a terminal and run:
sudo pmset repeat restart U 04:00:00
Apple has a whole syntax for this, but this command will restart your Mac every Sunday at 4 AM which works well for me. You also probably want to configure autologin as well but I'm not going over that. If you got this far you can figure that part out. If you open a chat with your bridge bot @sh-imessagebot:beeper.local
and send the version
command, you'll see when it was compiled. If it was Sunday around 4:10 AM your Mac rebooted.
Just a warning. Don't leave a logging terminal window open and the forget about your Mac. When it goes to reboot, the reboot process will be stopped by the Terminal window, BlueBubbles will shut down but the Mac will be stuck without manual intervention which will break your bridge until you manually close the Terminal so the Mac can reboot.
I also like to increase backfill and max attachment size, please see the original guide for instructions to do that in config.yaml.