BOINC
Berkeley Open Infrastructure for Network Computing (BOINC) is a distributed computing platform for contributing spare CPU cycles to science projects. This guide describes how to install BOINC on a Raspberry Pi running Raspberry Pi OS, with its data directory hosted on an external ext4 disk to protect the SD card from excessive writes.
This configuration assumes a Raspberry Pi 3B (or similar) and treats BOINC as a background task, ensuring it does not interfere with other services like Samba, SSH, or Webmin.
Assumptions
- You have followed the Persistent USB External Disk guide.
- The server (Pi) has a static IP address assigned for ease of connection (See main Pi Guide).
- The external disk is formatted as ext4, mounted at
/mnt/1TB, and configured withnofailin/etc/fstab.
Install BOINC
sudo apt update
sudo apt install boinc-client
Stop the service to configure the data location:
sudo systemctl stop boinc-client
Move data to the external disk
We bind-mount the external directory so the BOINC service can continue using its default path (/var/lib/boinc-client).
1. Prepare directory
sudo mkdir /mnt/1TB/boinc-data
sudo chown boinc:boinc /mnt/1TB/boinc-data
2. Copy existing data
sudo rsync -aHAX /var/lib/boinc-client/ /mnt/1TB/boinc-data/
sudo chown -R boinc:boinc /mnt/1TB/boinc-data
3. Setup Bind-Mount
Preserve the original directory temporarily:
sudo mv /var/lib/boinc-client /var/lib/boinc-client.original
sudo mkdir /var/lib/boinc-client
Add the bind mount to /etc/fstab:
/mnt/1TB/boinc-data /var/lib/boinc-client none bind,nofail,x-systemd.requires-mounts-for=/mnt/1TB 0 0
Apply and verify:
sudo systemctl daemon-reload
sudo mount /var/lib/boinc-client
findmnt /var/lib/boinc-client
4. Ensure BOINC requires the external disk
Configure systemd so BOINC only starts if the external disk is mounted:
sudo systemctl edit boinc-client
Add these lines:
[Unit]
RequiresMountsFor=/var/lib/boinc-client
ConditionPathIsMountPoint=/var/lib/boinc-client
Restart and verify:
sudo systemctl start boinc-client
systemctl status boinc-client
Once confirmed, remove the temporary backup:
sudo rm -rf /var/lib/boinc-client.original
Configure remote access
Enable headless management from another computer.
1. Remove GUI-RPC password
sudo sh -c ': > /etc/boinc-client/gui_rpc_auth.cfg'
Or edit the file in nano and remove the password line.
2. Restrict access
Edit /etc/boinc-client/remote_hosts.cfg and add the IP addresses of the computers authorized to control the Pi:
192.168.1.20
192.168.1.30
I like to add an address range in case DHCP assigns a different IP to my client.
Restart BOINC to apply:
sudo systemctl restart boinc-client
Note: You can now connect using the BOINC Manager GUI from the allowed computers by entering the Pi’s IP address and leaving the password blank.
Command-line control
While the GUI is preferred, you can use boinccmd for quick checks:
boinccmd --get_state
Keep BOINC from overwhelming the Pi
Since the Pi 3B has limited resources, we configure BOINC to stay in the background.
Suggested Configuration
Apply these settings via the BOINC Manager “Computing Preferences”:
| Setting | Recommendation |
|---|---|
| Max CPUs | 2 of 4 (50%) |
| CPU Time | 75% |
| Suspend when busy | Enable if non-BOINC usage > 25% |
| Memory | Limit to 50% |
| Suspend behavior | Do not leave apps in memory |
graph LR
A[Start Task] --> B{CPU Load > 25%?}
B -- Yes --> C[Suspend BOINC]
B -- No --> D[BOINC Runs]
C --> E{Load Drops?}
E -- Yes --> D
Design Decisions
- Resource isolation: BOINC runs as the dedicated
boincuser, with permissions restricted solely to/mnt/1TB/boinc-data. - Durability: Persistent BOINC data lives on the external ext4 disk, bypassing SD card wear.
- Fail-safe:
fstabusesnofailand the BOINC service requires the mount point, ensuring the Pi never fills the SD card if the disk is unplugged. - Security: Passwordless remote GUI access is restricted to known IPs via
remote_hosts.cfg.