Guide to Setup Syncthing Truly Local Only

Syncthing settings for truely local only syncing

https://syncthing.net/

You need to:

  • exclude from any VPN, firewall or Tor on Phone (Not necessary)
  • remove syncthing run conditions and maybe battery restrictions
  • open web GUI on phone for more info (accessed through the hamburger menu of android when syncthing is running)
  • For true incoming local connections with high speed need to add port forwards in router and allow that for for LAN in firewall:

Someone in the Self Hosting Matrix group said:

Don’t use UPnP, like ever :slight_smile: (Security concerns) and port forwarding is not needed for what you’re looking for …

In your Syncthing app/server web interface click on Actions then Settings and go to the Connections … change the Sync Protocol Listening Addresses to just tcp4://0.0.0.0:22000 and uncheck the following;

Enable NAT traversal, Global Discovery, Enable Relaying.

Make sure to leave Local Discovery ON.

That would allow syncthing to check the local network for any IP address on port 22000 running syncthing.

If that doesn’t work or you want a more specific setup:

  1. Set a static local IP for your PC for the LAN or Wifi network (Search guides online, but can be done in your PC’s network settings quite easily)

Router:

Login to your router. This is OpenWRT your router setup may look different.

Firewall

Will be different per device, this is in Portmaster you’ll have to learn your own devices setup. Set these rules for the Syncthing app (You can also block internet):

Portmaster YAML config export:

type: settings

config:

filter:

blockInbound: false

blockInternet: true

defaultAction: permit

domainHeuristics: true

includeCNAMEs: true

includeSubdomains: true

preventBypassing: true

serviceEndpoints:

- + LAN TCP/22001

spn:

use: false

# jess-checksum: Zws6tfFjF8rnpgrDDuepe87ExAQsY6xABJKZwYqmTGnn5G

Syncthing:

  • Set listening address to your static IP and desired port, tcp4://192.168.x.xxx:22001 (where x is your PCs static IP)

  • In the WebGUI (accessed through the hamburger menu of android when syncthing is running) open: Actions>settings>connections of each device; turn off relaying, etc. Leave only local discovery on.
  • On the device, without a static IP eg a phone, open the web GUI and select the device with the static IP eg your PC. Edit it and set it’s address to tcp4://192.168.x.xxx:22001 (where x is your PCs static IP):

Now your device/phone, knows where to look for your other device.

  • Check Status on each device to see if Syncthing is running, if not edit the run conditions in app settings. Connect the phone and PC to a lan cable (or wifi if you allowed wifi in your router port forwarding) and they should detect each other after a short time.
  • If it’s working local only, in the WebGUI you should see under: Remote Devices > connection Type: TCP LAN and syncing will be much faster

Optional sync over internet when away from home

Turn on Relaying in each devices WebGUI settings. This will be slower and use data but it is private: Relaying — Syncthing documentation

See also Telegram: View @PrivateYourTech

An Official guides which don’t explain this well :

https://docs.syncthing.net/users/firewall.html

or Arch wiki “guide”:

https://wiki.archlinux.org/title/Syncthing#Local_network_setup

This is for people who want a phone to sync to a laptop only on one home lan/wifi network allowing local sync without relaying or global discovery.

Updated version (Forum won’t let me edit original) Title spelling correction *Truly

You may need to:

  • exclude from any VPN, firewall or Tor on Phone (Not always necessary)
  • Tweak Syncthing run conditions, for your desired outcomes in the Syncthing app settings and maybe remove android battery restrictions.
  • Open the Syncthing web GUI on phone for more info (accessed through the hamburger menu of android when syncthing is running)
  • This guide may require that you will allow incoming connections with a high speed via port forwards in your router you need to have access to your router back-end.Loosely based on the official guide:

Someone in the Self Hosting Matrix group said:

Don’t use UPnP, like ever :slight_smile: (Security concerns) and port forwarding is not needed for what you’re looking for …

In your Syncthing app/server web interface click on Actions then Settings and go to the Connections … change the Sync Protocol Listening Addresses to just tcp4://0.0.0.0:22000 and uncheck the following;

Enable NAT traversal, Global Discovery, Enable Relaying.

Make sure to leave Local Discovery ON.

That would allow Syncthing to check the local network for any IP address on port 22000 running Syncthing.

If that doesn’t work or you want a more specific setup:

  1. Set a static local IP for your PC for the LAN or Wifi network (Search guides online, but can be done in your PC’s network settings quite easily)

Router:

Login to your router. This is OpenWRT, your router setup may look different.

add these port forward rules to your router firewall.

Firewall

Will be different per device, this is in Portmaster you’ll have to learn your own devices setup. Set these rules for the Syncthing app (You can also block internet):

Portmaster YAML config export:

type: settings

config:

filter:

blockInbound: false

blockInternet: true

defaultAction: permit

domainHeuristics: true

includeCNAMEs: true

includeSubdomains: true

preventBypassing: true

serviceEndpoints:

- + LAN TCP/22001

spn:

use: false

# jess-checksum: Zws6tfFjF8rnpgrDDuepe87ExAQsY6xABJKZwYqmTGnn5G

Syncthing:

  • Set listening address to your static IP and desired port, tcp4://192.168.x.xxx:22001 (where x is your PCs static IP) You can experiment with adding other protocols like QUIC:// or UDP:// (I believe you can add multiple with comma separated addresses)

  • In the WebGUI (accessed through the hamburger menu of android when Syncthing is running) open: Actions>settings>connections of each device; turn off relaying, etc. Leave only local discovery on.
  • On the device, without a static IP eg a phone, open the web GUI and select the device with the static IP eg your PC. Edit it and set it’s address to tcp4://192.168.x.xxx:22001 (where x is your PCs static IP):

Now your device/phone, knows where to look for your other device. (Again you can add other protocols here if you like)

  • Check Status on each device to see if Syncthing is running, if not, edit the run conditions in app settings. Connect the phone and PC to a lan cable (or wifi if you allowed wifi in your router port forwarding) and they should detect each other after a short time.
  • If it’s working local only, in the WebGUI you should see under: Remote Devices > connection Type: TCP LAN and syncing will be much faster

Optional sync over internet when away from home

Turn on Relaying in each devices WebGUI settings. This will be slower and use data but it is private: Relaying — Syncthing documentation

there is also aArch wiki “guide”: title/Syncthing#Local_network_setup

The spelling of this post title was wrong and it had issues. I wasn’t allowed to edit so I updated this post here

1 Like