-
-
Notifications
You must be signed in to change notification settings - Fork 4
macOS Agent Setup
This guide covers installing and configuring the BBS backup agent on macOS. The agent runs as a system daemon via launchd and supports both Apple Silicon (M1/M2/M3/M4) and Intel Macs.
Before installing the agent on your Mac, ensure you have:
- macOS 12 (Monterey) or later (earlier versions may work but are untested)
- Homebrew installed — the installer uses Homebrew to install BorgBackup and Python 3. Install from https://brew.sh
-
Administrator access — the installer requires
sudoto install system-wide services - Network access to your BBS server (HTTPS, typically port 443)
Open Terminal and run:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"Then install the required packages:
brew install borgbackup python3Note: The agent installer will attempt to install these automatically via Homebrew, but it's recommended to install them beforehand to avoid issues.
Before installing the agent, create a client entry in the BBS web interface:
- Log in to your BBS server
- Navigate to Clients and click Add Client
- Enter a name for the Mac (e.g., "Marcs-MacBook-Pro")
- Click Create Client
- Copy the install command displayed after creation — you'll need this in the next step
Open Terminal on your Mac and paste the install command from Step 1. It will look like this:
curl -s https://your-bbs-server.com/get-agent | sudo bash -s -- \
--server https://your-bbs-server.com \
--key YOUR_API_KEYReplace your-bbs-server.com with your BBS server URL and YOUR_API_KEY with the key from the BBS web interface. You will be prompted for your Mac login password (for sudo).
The installer will:
- Detect macOS and install BorgBackup via Homebrew (if not already installed)
- Download the agent script to
/opt/bbs-agent/ - Download the compiled macOS wrapper binary and create a
.appbundle for Full Disk Access - Generate a launchd service configuration
- Register the agent with your BBS server
- Start the agent service
You should see output similar to:
╔══════════════════════════════════════════════════════════════╗
║ Borg Backup Server — Agent Installer ║
╚══════════════════════════════════════════════════════════════╝
→ Detecting operating system...
✓ Detected: macOS 15.3
→ Checking for Borg Backup...
✓ Already installed: borg 1.4.0
→ Installing agent files...
✓ Agent downloaded to /opt/bbs-agent
✓ Configuration saved to /etc/bbs-agent/config.ini
→ Setting up SSH keys...
✓ SSH key installed to /etc/bbs-agent/ssh_key
→ Installing system service...
✓ Service installed (launchd)
╔══════════════════════════════════════════════════════════════╗
║ Installation Complete! ║
╚══════════════════════════════════════════════════════════════╝
This is the most important step for macOS. Without Full Disk Access (FDA), the agent cannot back up files in protected locations such as Desktop, Documents, Downloads, and external volumes.
Why is this needed? macOS requires explicit user consent before any program can access protected directories. This is an Apple security requirement and cannot be bypassed programmatically.
-
Open System Settings (or System Preferences on older macOS)
-
Navigate to Privacy & Security > Full Disk Access
-
Click the + button (you may need to click the lock icon and enter your password first)
-
A file browser dialog will appear. The BBS Agent app is installed in a system directory that isn't visible by default. Press Cmd+Shift+G to open the "Go to folder" dialog
-
Type the following path and press Enter:
/opt/bbs-agent/BBS Agent.app -
Select BBS Agent.app and click Open (or Add)
-
Verify that BBS Agent now appears in the Full Disk Access list with its toggle enabled
-
Restart the agent to apply the new permissions:
sudo launchctl kickstart -k system/com.borgbackupserver.agent
After granting FDA and restarting the agent, run a test backup from the BBS web interface. Check the agent log for any permission errors:
tail -f /var/log/bbs-agent.logIf backups complete without Operation not permitted errors, FDA is working correctly.
After installation, the agent should appear online in the BBS web interface within 30 seconds. Check the Clients page — the status should change from Setup (blue) to Online (green).
If the agent doesn't come online, see the Troubleshooting section below.
On macOS, the BBS agent runs differently than on Linux:
-
Wrapper binary — A compiled universal binary (
bbs-mac-agent) finds the correct Python 3 installation and launches the agent script. This binary is packaged as a.appbundle (BBS Agent.app) so that macOS recognizes it in Full Disk Access settings -
FDA inheritance — When you grant Full Disk Access to
BBS Agent.app, all child processes (Python, BorgBackup) inherit the permission automatically - launchd — macOS uses launchd (not systemd) to manage system services. The agent runs as a LaunchDaemon, starting automatically on boot and restarting if it crashes
| Path | Description |
|---|---|
/opt/bbs-agent/bbs-agent.py |
Agent script |
/opt/bbs-agent/BBS Agent.app |
Wrapper app bundle (for FDA) |
/opt/bbs-agent/bbs-mac-agent |
Compiled wrapper binary |
/opt/bbs-agent/uninstall.sh |
Uninstaller script |
/etc/bbs-agent/config.ini |
Agent configuration |
/etc/bbs-agent/ssh_key |
SSH private key for borg access |
/Library/LaunchDaemons/com.borgbackupserver.agent.plist |
launchd service definition |
/var/log/bbs-agent.log |
Agent log file |
# Check if the agent is running
sudo launchctl list | grep borgbackupserver
# View live agent logs
tail -f /var/log/bbs-agent.log
# View last 50 log lines
tail -50 /var/log/bbs-agent.log
# Restart the agent
sudo launchctl kickstart -k system/com.borgbackupserver.agent
# Stop the agent
sudo launchctl bootout system/com.borgbackupserver.agent
# Start the agent (after stopping)
sudo launchctl bootstrap system /Library/LaunchDaemons/com.borgbackupserver.agent.plistThe agent configuration is stored at /etc/bbs-agent/config.ini:
[server]
url = https://your-bbs-server.com
api_key = abc123...
[agent]
poll_interval = 30After editing the configuration, restart the agent:
sudo launchctl kickstart -k system/com.borgbackupserver.agentTo completely remove the agent from your Mac:
sudo /opt/bbs-agent/uninstall.shThis removes:
- The launchd service
- Agent files in
/opt/bbs-agent/ - Configuration and SSH key in
/etc/bbs-agent/ - The log file at
/var/log/bbs-agent.log
Note: The client entry on the BBS server must be removed manually via the web interface.
You should also remove BBS Agent from Full Disk Access in System Settings after uninstalling.
Check if the service is running:
sudo launchctl list | grep borgbackupserverIf no output is shown, the service isn't loaded. Bootstrap it:
sudo launchctl bootstrap system /Library/LaunchDaemons/com.borgbackupserver.agent.plistCheck the agent log:
tail -50 /var/log/bbs-agent.logLook for connection errors, SSL issues, or authentication failures.
Verify network connectivity:
curl -I https://your-bbs-server.comThis means Full Disk Access has not been granted or is not active:
- Open System Settings > Privacy & Security > Full Disk Access
- Verify BBS Agent is listed and its toggle is on
- If it's not listed, follow Step 3 above
- After granting FDA, restart the agent:
sudo launchctl kickstart -k system/com.borgbackupserver.agent
When adding the app to Full Disk Access, if you can't find it:
- In the file browser dialog, press Cmd+Shift+G
- Type
/opt/bbs-agent/BBS Agent.appand press Enter - The app should now be selectable
If the app doesn't exist, re-run the installer to create it.
The installer requires Homebrew for installing BorgBackup and Python 3. Install Homebrew first:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"Then re-run the agent installer.
If the installer can't find Python 3, install it via Homebrew:
brew install python3The agent supports Python 3 at these locations:
-
/opt/homebrew/bin/python3(Apple Silicon — Homebrew default) -
/usr/local/bin/python3(Intel — Homebrew default) -
/usr/bin/python3(macOS built-in, if available)
If you're seeing every log line printed twice, this was fixed in agent version 2.8.0. Update the agent from the BBS web interface: go to the client detail page and click Update Agent.
See also: Agent Setup (Linux) | Managing Clients | Backup Plans
📖 User Manual
Getting Started
Using BBS
- Dashboard
- Managing Clients
- Linux Agent Setup
- macOS Agent Setup
- Windows Agent Setup
- Repositories
- Storage Setup
- Backup Plans
- Restoring Files
- Database Backups
- Plugins
- Remote Storage
- S3 Offsite Sync
Monitoring
Administration
Reference