Syncthing: Private Folder Sync

← Self-Hosting · Files & Photos · Replaces: Dropbox-style folder sync, Resilio

What You'll Build

Syncthing keeps folders identical across your devices — laptop, desktop, phone, and server — directly between them, encrypted, with no cloud account. Unlike Nextcloud, there's no web app to manage: just folders that stay in sync. Having the server in the group means there's always an online copy.

Ports: 8384 (web UI), 22000 TCP/UDP (sync), 21027 UDP (discovery) · Time: 30 minutes · Difficulty: Easy

What You Need

Step 1: Start Syncthing on the Server

mkdir -p ~/stacks/syncthing/data && cd ~/stacks/syncthing
nano compose.yaml
services:
  syncthing:
    image: syncthing/syncthing:latest
    container_name: syncthing
    hostname: homeserver-sync          # the name other devices will see
    restart: unless-stopped
    network_mode: host                 # recommended: needed for fast LAN discovery
    environment:
      PUID: 1000
      PGID: 1000
    volumes:
      - ./data:/var/syncthing          # config + default "Sync" folder
docker compose up -d

# Host networking means the server's firewall applies — open Syncthing's ports
sudo ufw allow 8384/tcp
sudo ufw allow 22000
sudo ufw allow 21027/udp

Step 2: Secure the Web UI

  1. Open http://192.168.1.50:8384. A red banner warns that no password is set.
  2. Actions → Settings → GUI: set a username and password. Tick Use HTTPS for GUI → Save.
  3. Note the server's Device ID: Actions → Show ID.

Step 3: Connect Your Other Devices

DeviceInstall
Linuxsudo apt install syncthing, then systemctl --user enable --now syncthing; open http://127.0.0.1:8384
Windows / macOSSyncTrayzor (Windows) or Syncthing for macOS
AndroidSyncthing-Fork (from F-Droid or Google Play) — the original Android app has been discontinued
iPhoneMöbius Sync (third-party)
  1. On the laptop: + Add Remote Device → paste the server's Device ID (or scan its QR code on the phone) → Save.
  2. The server's web UI shows "New device wants to connect" → Add device.

Step 4: Share a Folder

  1. On the laptop: + Add Folder → label "Documents", choose the path → Sharing tab → tick the server → Save.
  2. Accept on the server and choose where it's stored (e.g. /var/syncthing/Documents).
  3. Pick a folder type per device:
    • Send & Receive — normal two-way sync.
    • Send Only — e.g. the phone's camera folder: changes flow out, never in.
    • Receive Only — e.g. the server keeps a copy but never changes it.
  4. On the server's copy, Edit → File Versioning → Staggered, so deleted or overwritten files are kept for a while.

Sync is not backup. If you delete a file on one device, Syncthing deletes it everywhere (apart from file versioning). Keep your restic backups running on the server.

Troubleshooting

What's Next?

Back to the Self-Hosting hub →