BlueBubbles Server
  • Server Overview
  • Installation Guides
    • Standard Installation
    • Manual Setup
  • FAQ
  • Private API Setup
  • Supporting the Project
  • Licenses / Legal
  • Basic Guides
    • Basic Guides - Overview
    • Port Forwarding & Dynamic DNS
    • Prevent macOS from Sleeping
    • Migrating Servers
    • Multiple Users on the Same Mac
    • Autostart Server After Crash
  • Troubleshooting Guides
    • Troubleshooting Guides - Overview
    • BlueBubbles Server Cannot Access MacOS Contacts
    • Not Receiving Notifications or URL Changes on Android
    • Unable to Send Messages to International Contacts
    • BlueBubbles App is Taking Up Too Much Storage
    • Can't Send Messages from BlueBubbles
    • BlueBubbles Server Opens to a Blank White Screen
    • Slow Upload Speed When Connecting Over LAN
    • Restarting Your Server Without a Direct Connection
    • Fix FaceTime Features for Virtual Machines
  • Advanced Guides
    • Advanced Guides - Overview
    • Generating an SSL Certificate using CertBot
    • Disabling SIP on Unofficial Macs for the Private API
    • Registering a Phone Number with your iMessage Account
    • macOS Virtualization
      • Running a macOS VM
        • Deploying macOS in VMWare on Windows (Full Guide)
        • Enabling iMessage in a VM
        • External Guides
          • Big Sur VM on a Mac Device
          • Big Sur VM on Proxmox
          • Big Sur VM on AMD Windows
          • Big Sur VM on Intel Windows
          • Catalina VM on a Mac Device
          • Catalina VM on Proxmox
          • Catalina VM on Intel / AMD Windows
          • Catalina VM on Intel Windows
          • Monterey VM on AMD Windows
      • Running BlueBubbles in Docker-OSX
        • Configuring BlueBubbles as a Service
    • BYO Proxy Service Guides
      • Cloudflare with a Custom Domain
      • Caddy & DuckDNS
      • Nginx Proxy Manager
      • Nginx Manual Setup
      • Tailscale VPN Setup
  • Developer Guides
    • Developer Guides - Overview
    • Build Yourself / Contribution Guide
    • REST API & Webhooks
    • Simple Web Server for Webhooks
      • Python Web Server Example
Powered by GitBook
On this page
  • BlueBubbles as a systemd service
  • Introduction
  • Guide

Was this helpful?

Edit on GitHub
Export as PDF
  1. Advanced Guides
  2. macOS Virtualization
  3. Running BlueBubbles in Docker-OSX

Configuring BlueBubbles as a Service

This guide will show you how to setup the BlueBubbles Docker container to run as a service on your Linux host. This is to make sure that the host starts up when your Linux host restarts.

PreviousRunning BlueBubbles in Docker-OSXNextBYO Proxy Service Guides

Last updated 2 years ago

Was this helpful?

BlueBubbles as a systemd service

Introduction

If you do not have a physical Mac at your disposal and if you already have a Linux home server, it is relatively easy to turn BlueBubbles into a systemd service which you can configure to run at startup. This way, when your home server starts or reboots, it BlueBubbles automatically starts up.

BlueBubbles does have to be initially configured manually, including a full install of a macOS VM. However, using Docker-OSX makes this configuration much easier. If you are not already running BlueBubbles in a Docker-OSX container, first follow our guide on Configuring BlueBubbles in a container with Docker-OSX.

Guide

Once you are done configuring Docker-OSX and your BlueBubbles install:

Inside the VM

  1. . This will make the boot faster and allow the BlueBubbles server to start automatically.

  2. In your BlueBubbles server settings, enable "Startup with MacOS".

  3. If using the Private API, ensure that MacForce launches at start:

MacForge Preferences > "General" tab > Check "Launch MacForce at Login"

On your Linux host

  1. Create a new systemd service:

sudo systemctl edit --force --full bluebubbles.service

2. Enter the following:

[Unit]
Description=BlueBubbles iMessage relay server
Requires=docker.service
After=docker.service

[Service]
Restart=always
ExecStart=/usr/bin/docker run \
  --rm \
  --name bluebubbles \
  --dns=1.1.1.1 \
  --device /dev/kvm \
  -p 5999:5999 \
  -p 1234:1234 \
  -p 50922:10022 \
  -v /tmp/.X11-unix:/tmp/.X11-unix \
  -v $PWD/maindisk.qcow2:/image \
  -v $PWD/bootdisk.qcow2:/bootdisk \
  -e IMAGE_PATH="/image" \
  -e BOOTDISK="/bootdisk" \
  -e EXTRA="-display none -vnc 0.0.0.0:99,password-secret=secvnc0 -object secret,id=secvnc0,data=vncpass" \
  -e ADDITIONAL_PORTS="hostfwd=tcp::1234-:1234," \
  -e DISPLAY=:99 \
  -e WIDTH=1920 \
  -e HEIGHT=1080 \
  -e NOPICKER=true \
  sickcodes/docker-osx:naked
ExecStop=/usr/bin/docker container stop bluebubbles

[Install]
WantedBy=multi-user.target

It's recommended that you replace the value of ExecStart with the script you made in Step 11 of the Configuring BlueBubbles in a container with Docker-OSX guide. If you do choose to paste the above code block into your new systemd service file, you will at least need to replace $PWD (in the -v options) with the full path to your Docker OSX virtual disks.

Alternatively, it is possible to point to the script file you saved. In that case, replace the ExecStart line with this instead:

ExecStart=/usr/bin/sh /absolute/path/to/your/script.sh

NOTE: If using podman, replace docker.service with podman.service and the docker run command with podman run.

3. Reload the systemd daemons:

sudo systemctl daemon-reload

4. Enable the service to start it at boot, and activate it now:

sudo systemctl enable --now bluebubbles.service
Enable auto-login