Guide · Android · Termux
Back up a Mac to an Android phone with rsync
An Android phone can keep a copy of a Mac folder once it has an SSH server and rsync. Termux, a free Linux terminal for Android, provides both. Once it runs, the Mac connects to the phone like to any SSH server, on port 8022.
01
What you need
- Termux, from F-Droid or from its GitHub releases, the two sources the Termux project points to.
- The phone and the Mac on the same Wi-Fi, or Tailscale on both. The Tailscale guide explains how that works.
- Room on the phone for the folder you back up. No root is needed.
02
Set up the phone
Open Termux and install the SSH server and rsync:
pkg install openssh rsyncSet a password. RSync Pro uses it once, to install its key:
passwdGive Termux access to the phone's shared storage, so the backup can go where other apps see it. Android asks you to allow it:
termux-setup-storageStart the server, and stop Android from pausing Termux in the background:
sshd termux-wake-lockFind the phone's address in Android's Wi-Fi settings, under the network you are on. It looks like
192.168.1.23.
03 · RSync Pro
Setting it up in RSync Pro
RSync Pro is a Mac app that runs rsync over SSH from a window, with saved setups and schedules. A phone running Termux is set up like any SSH server, only on port 8022.
Create a sync task and set its destination to Remote. Enter the phone's address in Host Address and 8022 in Port, because Android doesn't let apps use ports below 1024. Any name works in User: Termux accepts them all.
Click Create Key, then Install Public Key, and type the password you set with
passwd. In Setup guide, the Android phone type sets port 8022 and adds--no-perms --no-linksto the task, because the phone can't keep Mac permissions or symlinks.Click Test connection. Create the backup folder in Termux, then use its full path as the destination:
mkdir -p /storage/emulated/0/Backups/MacRun the task once by hand while the phone is awake, and open the folder in the phone's file manager to check the result.
Leave mirror off. The NAS guide explains mirror and copy.
Free for one sync task, run by hand. A one-time unlock adds live and scheduled sync, more sync tasks and Versions. No subscription, no account. Requires macOS 15 or later.
04
Which folder to back up to
- Shared storage, under
/storage/emulated/0/. Other apps and a USB cable see the files, and they stay if you uninstall Termux. It doesn't keep Mac file permissions, so rsync may report that it couldn't set them. The files themselves still arrive. - Termux's home folder,
/data/data/com.termux/files/home. It keeps permissions, but only Termux can see it, and uninstalling Termux deletes it.
05
Other ways in: another SSH app, or USB
Sshd4a is an Android app with its own SSH server and rsync, if you'd rather not use a terminal. Its port and users are set in the app.
Over a USB cable, with USB debugging on and adb installed on the Mac, forward the port first:
adb forward tcp:8022 tcp:8022Then use localhost as the Host Address and 8022 as the Port.
06
Limits worth knowing
- We tested it on a OnePlus 7 Pro (Android 11, Termux 0.118.3, rsync 3.5.2) on 9 November 2026: sending to Termux's home and to shared storage, a second run that sends nothing, live sync, Mirror with its preview and recycle bin, pulling back to the Mac, and resuming an interrupted file — over Wi-Fi, over USB and through a jump host, with the phone locked. Another phone may behave differently; start with a small folder.
- Android stops Termux in the background. Keep the wake lock on. If syncs still stop halfway, turn off battery optimisation for Termux.
- A phone is a poor fit for live sync. It sleeps, leaves the Wi-Fi and changes address. Run the task by hand or on a schedule.
- The address can change. Reserve one for the phone in the router, or connect over Tailscale.
- RSync Pro has no Android app. The phone is a destination the Mac reaches over SSH.
- No symlinks or hard links on the phone. Shared storage can't hold symlinks, and Android refuses hard links, so a Versions task to a phone stores a full copy each time.
07
Questions
Does the phone need to be rooted?
No. Termux runs as an ordinary app, which is also why it uses port 8022 and not 22.
Does it work over mobile data?
Only through Tailscale or a VPN. Mobile networks don't let incoming connections reach a phone.
Why can't I sync to an iPhone the same way?
iOS has no SSH server and can't run rsync. The iPhone guide shows the route that works: a NAS in between, opened in the Files app.
Sources
- Termux wiki: Remote Access (sshd on port 8022) and termux-setup-storage.
- Termux packages: rsync 3.5.2, checked on 9 November 2026.
- Sshd4a on GitHub.
- Tested on 8 November 2026: openrsync on macOS to rsync 3.5.0 over SSH, on a NAS (see the UniFi guide). Not yet tested on a phone.
A step no longer matches what you see? Write to support@bdtech.app and the page will be corrected.
Guides
Back up to a NAS, a remote Mac or a phone
-
Synology, TrueNAS and Unraid
What to turn on in Synology DSM 7, TrueNAS and Unraid so a Mac can back up to them, and the permission mistakes that stop a key from working.
-
UniFi NAS (UNAS)
UniFi Drive's built-in rsync doesn't accept a backup sent from a Mac. Logging in over SSH as root does, and this guide shows how. Tested on a UNAS Pro 4.
-
A Mac with no fixed IP (Tailscale)
Reach a Mac at another home, behind CGNAT or on the road, through Tailscale. No port forwarding, nothing to set up on the router.
-
Your backups on an iPhone
An iPhone can't receive an rsync backup. Back up to a NAS or another Mac, then open the folder in the Files app.
-
A Windows PC
Share a folder on the PC and back up to it from Finder, or run rsync inside WSL for backups over the internet.