Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Raspberry Pi Automatic Phone Backup: How-To

· 8 min read · Home Networking

In this article
  1. Why Back Up to a Raspberry Pi?
  2. What You Need to Get Started
  3. How It Works: The Two Main Approaches
  4. Step-by-Step Setup (Syncthing on a Raspberry Pi)
  5. Choosing the Right Software and Storage
  6. Common Problems and How to Fix Them
  7. Security and Privacy Considerations
  8. Frequently Asked Questions

Yes, you can use a Raspberry Pi to automatically back up every phone on your home network. The most practical approach is to run a backup server on the Pi (using software like Syncthing or Nextcloud) and configure each phone to sync its photos, videos, and files to it whenever the phone is on Wi-Fi. This gives you full control over your data without paying for cloud storage, and it works for both Android and iPhone, though the setup differs.

Why Back Up to a Raspberry Pi?

Most people rely on Google Photos, iCloud, or Dropbox for phone backups. Those services are convenient, but they come with storage limits, subscription fees, and privacy trade-offs. A Raspberry Pi gives you a personal, private backup destination that you own. The total cost is the Pi itself (around $35–$75 for a board, plus a case, power supply, and an SD card or external drive), and there are no monthly fees. It also keeps your data on your own hardware, so you don’t have to trust a third party with your photos and documents.

For many users, the main motivation is avoiding recurring costs. A 2TB external drive connected to a Pi can store years of phone photos and videos, and the only ongoing cost is electricity (a few dollars a year). It’s also a great way to learn about self-hosting and networking, and it can double as a media server or a home automation hub.

What You Need to Get Started

Here’s the basic hardware and software you’ll need:

  • A Raspberry Pi (any model from Pi 3 onward works; Pi 4 or Pi 5 are faster and handle multiple phones better).
  • A microSD card (at least 16GB, but 32GB or more is recommended) or a USB SSD for the operating system.
  • An external USB hard drive or SSD for the actual backups (size depends on how much data you have; 1TB is a common starting point).
  • A reliable power supply (official Pi power supply is best).
  • A network connection – Ethernet is preferred for speed and stability, but Wi-Fi works too.
  • Software: Raspberry Pi OS (the official operating system), and a backup server application.

You don’t need a monitor or keyboard after the initial setup if you enable SSH (Secure Shell) and connect from your computer.

How It Works: The Two Main Approaches

There are two popular ways to set up automatic phone backups on a Pi:

  1. Syncthing – This is a peer-to-peer file synchronization tool. You install Syncthing on the Pi and on your phone (the Android app is called Syncthing, and for iPhone you can use Möbius Sync, which is a paid wrapper). You create a shared folder on the Pi and point your phone’s camera or file folder to sync to it. Syncthing runs in the background and syncs whenever the phone is on the same network (or any network, if you configure it). It’s fast, free, and doesn’t require a central server.
  2. Nextcloud – This is a self-hosted cloud platform. You install Nextcloud on the Pi (using Docker or the built-in installer), then install the Nextcloud app on your phone. The app can auto-upload photos and videos to your Nextcloud server. Nextcloud gives you a web interface, file management, and more features like calendar and contacts, but it’s heavier and requires more configuration.

For most people, Syncthing is simpler and more reliable for pure backups. Nextcloud is better if you want a full cloud experience with web access and sharing.

Step-by-Step Setup (Syncthing on a Raspberry Pi)

Here’s a basic outline for setting up Syncthing on your Pi:

  1. Install Raspberry Pi OS on your SD card (use the Raspberry Pi Imager tool). Enable SSH during the setup by creating a file called ssh in the boot partition.
  2. Boot the Pi, find its IP address (via your router’s admin page or a network scanner), and SSH into it from your computer.
  3. Update the system: sudo apt update && sudo apt upgrade -y
  4. Install Syncthing: sudo apt install syncthing (or download the latest from the official website).
  5. Configure Syncthing to run as a service so it starts automatically on boot. You can use systemd to create a service file, or run it with syncthing serve in a tmux session.
  6. Access the Syncthing web interface at http://pi-ip:8384 from your computer.
  7. Add a folder on the Pi (e.g., /home/pi/phone-backup) and share it with your phone by adding your phone’s device ID.
  8. Install Syncthing on your Android phone (or Möbius Sync on iPhone), add the Pi as a remote device, and choose the folder to sync.
  9. In the phone app, enable “Auto-sync” and set it to only sync on Wi-Fi and while charging to save battery.

Once set up, the phone will automatically push new photos and files to the Pi whenever they’re both online. You can also set up a folder on the Pi that syncs back to the phone if you want to transfer files to your phone.

Choosing the Right Software and Storage

Your choice of software depends on your needs:

  • Syncthing – Best for simple, direct phone-to-Pi sync. It’s free, open-source, and works without a central server. It’s ideal if you just want to back up photos and files automatically.
  • Nextcloud – Best if you want a full cloud experience with web access, sharing, and optional apps. It’s more complex to set up but offers more features.
  • rsync over SSH – This is a command-line tool that can be scheduled with cron. It’s more technical but very reliable. It’s not as automatic as Syncthing because you need to run a script on the phone (which is tricky on iOS), so it’s mainly for Android users who are comfortable with Termux.

For storage, use an external drive formatted as ext4 (Linux native) or exFAT (compatible with Windows/Mac). If you use a USB drive, make sure it’s plugged into a powered hub or a drive with its own power supply, because the Pi’s USB ports may not provide enough power for larger drives.

Common Problems and How to Fix Them

  • Battery drain on the phone – Syncthing can use battery if not configured properly. Set it to sync only on Wi-Fi and while charging, and enable “Run conditions” in the app.
  • Syncing stops after a while – This often happens when the phone’s OS kills the background app. On Android, you may need to disable battery optimization for the Syncthing app. On iPhone, Möbius Sync has limitations due to iOS background restrictions.
  • Pi runs out of space – Monitor disk usage with df -h. You can set up a cron job to clean old backups, or use a larger drive.
  • Slow transfer speeds – Use Ethernet for the Pi and your phone’s Wi-Fi 5GHz band. Also, make sure the Pi is not using Wi-Fi if you can use Ethernet.
  • Security concerns – By default, Syncthing has no authentication. Set a password for the web interface and use a firewall (like ufw) to restrict access to your local network.

Security and Privacy Considerations

When you run a backup server at home, you need to think about security:

  • Change the default password for the Pi user and for the Syncthing web interface.
  • Use a firewall to block external access to the Pi. Only allow connections from your local network (e.g., 192.168.1.0/24).
  • Consider encrypting your backups. You can use an encrypted disk (LUKS) or encrypt the Syncthing folder with a tool like Cryptomator.
  • If you want to access backups from outside your home, set up a VPN (like WireGuard) instead of exposing the Pi directly to the internet.
  • Regularly update the Pi’s operating system and software to patch vulnerabilities.

Remember that your backup is only as safe as your Pi. If the Pi fails or is stolen, you lose your data. Consider making a second backup to an external drive or a cloud service for critical files.

Frequently Asked Questions

Can I back up an iPhone to a Raspberry Pi?

Yes, but it’s more limited than Android. iPhones don’t allow file-level access to the entire storage. You can use the Nextcloud app to auto-upload photos and videos, or use Möbius Sync (a Syncthing client) to sync specific folders. However, iOS background restrictions mean the sync may not be as instant as on Android. For full iPhone backups (including app data), you’d need to use iTunes or iCloud, which don’t work with a Pi.

Will this work if my phone is not on the same Wi-Fi?

Syncthing and Nextcloud can work over the internet, but you’ll need to configure port forwarding or a VPN. For security, it’s better to use a VPN (like WireGuard) to connect your phone to your home network remotely. By default, both apps are set to sync only on the same network to avoid data usage.

How much storage do I need on the Pi?

Estimate based on your phone’s usage. A typical phone produces about 1-2 GB of photos and videos per month. A 1TB drive can hold several years of backups for a few phones. You can also set up automatic cleanup to delete files older than a certain age.

Is it safe to use a Raspberry Pi for backups?

Yes, but you should take precautions. Use a reliable power supply, a good quality SD card (or better, an SSD), and keep the Pi cool. Back up the Pi’s configuration and consider using RAID or a second drive for redundancy. The Pi is a low-power device, but it can run 24/7 without issues if set up properly.

Can I back up multiple phones to the same Pi?

Yes. With Syncthing, each phone can have its own folder on the Pi. With Nextcloud, you can create multiple user accounts. Just make sure the Pi has enough storage and processing power. A Pi 4 or 5 can handle several phones simultaneously.

What happens if my phone is lost or stolen?

Your backups on the Pi are safe, but you should also enable remote wipe on your phone (Find My iPhone or Find My Device). If you’re worried about someone accessing your backups, encrypt the backup folder or the entire drive.