A complete, production-ready solution to transform a Raspberry Pi (3B+/4/5) into a Time Machine backup server for macOS, replacing the need for an expensive Apple Time Capsule.
| Advantage | Details |
|---|---|
| ✅ Always-on | Can run 24/7 with minimal power consumption (~5-10W) |
| ✅ Cost-effective | Hardware you may already own, no expensive Apple hardware |
| ✅ Full control | Configure exactly what you need, no vendor limitations |
| ✅ Samba 4.x | Complete vfs_fruit module support for Time Machine |
| ✅ USB 3.0 | Fast transfer speeds for external drives |
| ✅ Network accessible | Works on your local network and remotely via Tailscale VPN |
| ✅ Open source | Based on standard Linux technologies (Samba, Avahi) |
- Automated setup - Single script installation
- macOS auto-discovery - Appears natively in Time Machine preferences
- SMB3 protocol - Secure and fast transfers
- vfs_fruit support - Full macOS compatibility
- User authentication - Secure password-based access
- mDNS/Bonjour - Zero-configuration network discovery
- Tailscale ready - Works over VPN for remote backups
- Raspberry Pi 4 (4GB+ RAM recommended, Pi 3B+ works too)
- External USB drive (1TB+ recommended, formatted as ext4)
- Network connection (Ethernet preferred, WiFi works)
- Power supply - Reliable 5V/3A for Pi 4
- Raspberry Pi OS (Bullseye or Bookworm recommended)
- SSH access to your Raspberry Pi
- macOS 10.9+ (Mavericks or newer for Time Machine support)
-
Clone this repository:
git clone https://github.com/rizal72/TimeCapsule-Pi.git cd TimeCapsule-Pi -
Connect your external drive to the Raspberry Pi
-
Run the installer:
chmod +x install.sh sudo ./install.sh
-
Follow the prompts - the script will:
- Detect your external drive
- Format it as ext4 (with confirmation)
- Install and configure Samba
- Set up Avahi for macOS discovery
- Create a user account for Time Machine
- Configure auto-mount on boot
-
On your Mac: Open System Settings → General → Time Machine → Add Backup Disk
- Select TIMECAPSULE-PI → TimeCapsule
- Enter your credentials
- Start your first backup!
See MANUAL_INSTALL.md for detailed step-by-step instructions.
After installation, your Time Capsule will be configured as:
| Setting | Value |
|---|---|
| Server name | TIMECAPSULE-PI |
| Share name | TimeCapsule |
| Protocol | SMB3 (SMB2/3 forced, SMB1 disabled) |
| Quota | 1TB (configurable) |
| Authentication | User-based (no guest access) |
Edit /etc/samba/smb.conf to customize:
[TimeCapsule]
comment = Time Machine Backup on Raspberry Pi
path = /mnt/timecapsule
browseable = yes
read only = no
valid users = your_username
# Time Machine specific
fruit:time machine max size = 2T # Change quota here
vfs objects = catia fruit streams_xattrRestart Samba after changes:
sudo systemctl restart smbd nmbd- Use Ethernet instead of WiFi for faster backups
- USB 3.0 drive - Use a USB 3.0 port on your Pi 4
- First backup will take longer (several hours for large data sets)
- Subsequent backups are incremental and much faster
-
Check Samba is running:
systemctl status smbd nmbd
-
Check Avahi is running:
systemctl status avahi-daemon
-
Restart services:
sudo systemctl restart smbd nmbd avahi-daemon
- Verify firewall rules allow SMB (port 445)
- Check network connectivity:
ping pi4.local
-
Check disk is mounted:
df -h | grep timecapsule -
Verify permissions:
ls -la /mnt/timecapsule
-
The installer should set correct permissions automatically
Your Time Capsule works over Tailscale VPN:
- Install Tailscale on your Pi:
curl -fsSL https://tailscale.com/install.sh | sh - Log in:
sudo tailscale up - On your Mac (off-site), connect to:
smb://your-tailscale-ip
Create additional Samba users:
sudo smbpasswd -a newusernameThen add them to valid users in /etc/samba/smb.conf.
TimeCapsule-Pi/
├── README.md # This file
├── README.it.md # Italian documentation
├── CLAUDE.md # AI assistant guidelines
├── MANUAL_INSTALL.md # Detailed manual setup guide
├── install.sh # Automated installer script
├── setup/
│ ├── smb.conf # Samba configuration template
│ └── timecapsule.service # Avahi mDNS service file
└── docs/
├── architecture.md # Technical details
└── troubleshooting.md # Common issues and solutions
- Samba Project - Excellent SMB server implementation
- Avahi Project - mDNS/Bonjour for Linux
- Raspberry Pi Foundation - Amazing little computer
Contributions are welcome! Please feel free to submit issues or pull requests.
This project is provided as-is for educational and personal use.
Riccardo Sallusti
- GitHub: @rizal72
- Project started: February 2026
Note: This project replaces expensive Apple Time Capsule hardware with a configurable, open-source solution based on Raspberry Pi. It's been tested and confirmed working on macOS Tahoe 26.2 with Raspberry Pi 4 running Raspberry Pi OS Bullseye.
This software is provided "as is", without warranty of any kind. Always keep multiple backups of important data. The authors are not responsible for any data loss.