Syncthing Installation & Configuration Guide#


1. #truenas TrueNAS Scale Installation#

Increase Inotify Limit#

For real-time file watching on large datasets, increase the inotify limit in the TrueNAS backend.

  1. Go to System Settings > Advanced > Sysctl.
  2. Add New Sysctl:
    • Variable: fs.inotify.max_user_watches
    • Value: 524288
    • Description: Increase inotify limit for Syncthing.
  3. Verify persistence via Shell:
cat /proc/sys/fs/inotify/max_user_watches

App Deployment#

  1. Apps > Settings > Advanced: Disable “Host Path Safety Check” (if using existing datasets).
  2. Catalog: Search for and install the Syncthing Enterprise version.
  3. Storage Configuration:
    • Type: Host Path
    • Host Path: /mnt/HP1-4TBSSD-Raid0/HP1Storage (or your specific data path).
    • Mount Path: HP1Storage
  4. Access: Open the Web UI at http://[IP]:31000. Set an Admin password immediately.

2. Synology DSM Installation (via Docker)#

Increase Inotify Limit#

  1. Connect via SSH and run:
echo "fs.inotify.max_user_watches=204800" | sudo tee -a /etc/sysctl.d/90-override.conf
echo 204800 | sudo tee /proc/sys/fs/inotify/max_user_watches

Identify User IDs (PUID/PGID)#

To avoid permission issues, run the container as your specific user.

  1. Control Panel > Task Scheduler > Create User-defined script.
  2. Script: id > /volume1/docker/id.txt
  3. Run manually and check the output file. Example: uid=1027(marc) gid=100(users).

Docker Compose Configuration#

Use Container Manager (DSM 7.2+) or Docker to deploy the project.

---
services:
  syncthing:
    image: lscr.io/linuxserver/syncthing:latest
    container_name: syncthing
    hostname: syncthing-synology
    environment:
      - PUID=1027
      - PGID=100
      - TZ=America/New_York
    volumes:
      - /volume1/docker/syncthing/config:/config
      - /volume2/HP1Storage:/volume2/HP1Storage
      - /volume2/HP1Photos:/volume2/HP1Photos
      - /volume2/homes:/volume2/HP1Homes
    ports:
      - 8384:8384    # Web UI
      - 22000:22000/tcp
      - 22000:22000/udp
      - 21027:21027/udp
    restart: unless-stopped

3. Master .stignore List#

Create a file named .stignore in the root of your synced folders and paste the following to exclude system junk and temporary files.

// ########## OS generated files
$RECYCLE.BIN
$Recycle.Bin
System Volume Information
lost+found
.DocumentRevisions-V100
.TemporaryItems
.fseventsd
.iCloud
.DS_Store
.DS_Store?
.Spotlight-V100
.Trashes
.Trash-*
~*
*~
.~lock.*
*.part
*.filepart
.csync_journal.db
.csync_journal.db.tmp
*.swn
*.swp
*.swo
.dropbox
.dropbox.attr
*.crdownload
._*

// ########## Synology & General Cloud Junk
.SynologyWorkingDirectory
@eaDir
@SynoResource
@synoResource
.@__thumb
#recycle
(?i)#recycle
Thumbs.db
.Thumbnails
Desktop.ini
sync.ffs_db
Sync.ffs_lock
.tmp.drivedownload
.tmp