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.

Written against the Termux wiki and package list (rsync 3.5.2) · 9 November 2026

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

  1. Open Termux and install the SSH server and rsync:

    pkg install openssh rsync
  2. Set a password. RSync Pro uses it once, to install its key:

    passwd
  3. Give 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-storage
  4. Start the server, and stop Android from pausing Termux in the background:

    sshd
    termux-wake-lock
  5. Find 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.

  1. 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.

  2. 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-links to the task, because the phone can't keep Mac permissions or symlinks.

  3. Click Test connection. Create the backup folder in Termux, then use its full path as the destination:

    mkdir -p /storage/emulated/0/Backups/Mac
  4. Run the task once by hand while the phone is awake, and open the folder in the phone's file manager to check the result.

  5. 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:8022

Then 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

A step no longer matches what you see? Write to support@bdtech.app and the page will be corrected.