Using Syncthing as a Backup Solution

What Is Syncthing (as a Backup Tool)?

Syncthing is primarily a file synchronization tool — it keeps folders in sync between multiple devices in real time. But with the right configuration, it doubles as a backup solution: enable file versioning, set up one-way “send only” folders, and you get continuous, encrypted, off-site backups without a separate backup tool. It replaces cloud backup services like Google Drive or iCloud backup for users who want full control over where their data lives.

Updated March 2026: Verified with latest Docker images and configurations.

Prerequisites

  • Two Linux servers (or one server + one desktop/NAS) — source and backup destination
  • Docker and Docker Compose installed on both (guide)
  • 256 MB of free RAM per Syncthing instance
  • Storage space on the backup destination matching your source data
  • Network connectivity between both devices (LAN or internet)

Docker Compose Configuration — Backup Server

This is the backup destination server — where your backup copies are stored.

Create a docker-compose.yml file:

services:
  syncthing:
    image: syncthing/syncthing:2.0.15
    container_name: syncthing-backup
    hostname: backup-server
    environment:
      - PUID=1000
      - PGID=1000
    ports:
      - "8384:8384"     # Web UI
      - "22000:22000/tcp" # File sync (TCP)
      - "22000:22000/udp" # File sync (QUIC)
      - "21027:21027/udp" # Local discovery
    volumes:
      - syncthing_config:/var/syncthing/config
      - /mnt/backups:/var/syncthing/data
    restart: unless-stopped

volumes:
  syncthing_config:

The source device also needs Syncthing running (same Docker image, or native install). See our Syncthing setup guide for the full deployment.

Start the backup server:

docker compose up -d

Setting Up Backup Sync

Step 1: Connect the Devices

  1. Open the Syncthing web UI on both devices (port 8384)
  2. On each device, go to Actions → Show ID and copy the Device ID
  3. On each device, click Add Remote Device and paste the other device’s ID
  4. Accept the connection on both sides

Step 2: Configure Backup Folders

On the source device (the machine you want to back up):

  1. Click Add Folder
  2. Set the Folder Path to the directory you want to back up (e.g., /home/user/documents)
  3. Set Folder Type to Send Only — this prevents the backup server from pushing changes back
  4. Share it with the backup server device
  5. Under File Versioning, select Staggered File Versioning

On the backup server:

  1. Accept the folder share request
  2. Set Folder Type to Receive Only — this prevents local changes from syncing back
  3. Set the folder path to your backup storage (e.g., /var/syncthing/data/documents)
  4. Enable File Versioning on this side too (belt and suspenders)

Step 3: Configure Versioning

File versioning is what turns Syncthing from “sync” into “backup.” Configure it on the backup server:

Versioning TypeBest ForHow It Works
StaggeredMost backup use casesKeeps versions at increasing intervals: 1/hour for 24h, 1/day for 30 days, 1/week for older
SimpleMaximum version retentionKeeps N copies of each changed file
TrashcanDeleted file recoveryMoves deleted files to a .stversions folder
ExternalCustom workflowsCalls an external script on file changes

Recommended settings for backup:

Type: Staggered File Versioning
Max Age: 365 days
Clean Out After: 365 days
Versioning Path: (leave empty — uses .stversions in the folder)

Backup Architecture Patterns

Pattern 1: Desktop → Server (Most Common)

Desktop (Send Only) → VPS/NAS (Receive Only + Versioning)

Your desktop pushes files to the server. The server stores current files plus versioned history. If your desktop drive fails, restore from the server.

Pattern 2: Server → Off-Site NAS

VPS (Send Only) → Home NAS (Receive Only + Versioning)

Back up your VPS data to a home NAS. Provides geographic separation.

Pattern 3: 3-2-1 with Syncthing

Desktop → Local NAS (Receive Only)
Desktop → Remote VPS (Receive Only)

Two backup destinations: one local (fast restores) and one remote (disaster recovery). Both set to Receive Only with versioning.

Advanced Configuration

Ignore Patterns

Create a .stignore file in each synced folder to exclude files from backup:

// Exclude temporary files
*.tmp
*.swp
*~

// Exclude OS metadata
.DS_Store
Thumbs.db
desktop.ini

// Exclude node_modules and build artifacts
node_modules
.git
dist
build
__pycache__

Bandwidth Limiting

Limit Syncthing’s bandwidth on the backup server so it doesn’t saturate your connection:

  1. Go to Actions → Settings → Connections
  2. Set Incoming Rate Limit and Outgoing Rate Limit (in KiB/s)
  3. A value of 10240 limits to ~10 MB/s

Encrypted Backup (Untrusted Server)

Syncthing supports encrypted folders for backing up to a server you don’t fully trust:

  1. On the source device, share the folder with encryption enabled
  2. The backup server stores encrypted data — it cannot read your files
  3. Only devices with the encryption password can decrypt

This is ideal for backing up to a friend’s server or a cheap VPS.

Backup Verification

Syncthing does not verify backup integrity automatically. Set up periodic checks:

# Compare file counts between source and backup
SOURCE_COUNT=$(find /path/to/source -type f | wc -l)
BACKUP_COUNT=$(find /mnt/backups/folder -type f | wc -l)
echo "Source: $SOURCE_COUNT files, Backup: $BACKUP_COUNT files"

Check the Syncthing web UI for:

  • Out of Sync Items: should be 0 when idle
  • Last Scan: confirms the folder is being monitored
  • Folder Status: “Up to Date” on both sides

Syncthing vs Dedicated Backup Tools

FeatureSyncthing (as backup)ResticBorgBackup
Real-time syncYesNo (scheduled)No (scheduled)
DeduplicationNoYes (block-level)Yes (block-level)
CompressionNoYesYes (lz4/zstd)
Encryption at restOptional (per-folder)AlwaysAlways
Point-in-time restoreVia versioningYes (snapshots)Yes (archives)
Bandwidth efficiencySyncs entire changed filesSyncs only changed blocksSyncs only changed blocks
Cloud storage backendsNo (device-to-device)S3, B2, SFTP, rest-serverSSH/SFTP only
Web UIYesNoNo
Setup complexityLowMediumMedium

Use Syncthing for backup when: you want real-time protection (every save is backed up immediately), your files change infrequently, or you already run Syncthing for sync.

Use a dedicated tool when: you have large datasets (deduplication saves significant space), you need cloud storage backends, or you want guaranteed point-in-time snapshots.

Troubleshooting

Files Not Syncing

Symptom: Source shows changes but backup server remains stale. Fix: Check that both devices show “Connected” in the web UI. Verify the folder is shared with the correct device. Check .stignore isn’t excluding the files.

Conflict Files Appearing

Symptom: Files named filename.sync-conflict-*.ext appearing. Fix: This happens when both sides modify the same file. If using Send Only / Receive Only correctly, conflicts shouldn’t occur. Check that the backup server folder is set to “Receive Only.”

High CPU Usage

Symptom: Syncthing using excessive CPU during initial sync. Fix: On first sync with large folders, Syncthing hashes every file. This is a one-time operation. Reduce fsWatcherDelayS to a higher value (e.g., 60) in advanced folder settings to decrease file system polling frequency.

Resource Requirements

  • RAM: ~100 MB idle per instance, ~300 MB during large syncs
  • CPU: Moderate during initial sync (file hashing), minimal afterward
  • Disk: Mirrors source data 1:1, plus versioned copies (plan for 1.5-2x source size)

Verdict

Syncthing is the easiest way to add real-time backup if you’re already using it for file sync. The Send Only / Receive Only pattern with staggered versioning gives you genuine backup protection with minimal setup. For most home users backing up documents, photos, and configs, this is sufficient. For large-scale or enterprise backup needs, Restic or BorgBackup are purpose-built and more storage-efficient.

Comments