Using Syncthing
This guide refers to using Syncthing on Linux.
Since Syncthing accesses personal documents and files, it is highly recommended to use it as a user service, only providing user-level (not root) permissions. The following steps integrate Syncthing as such.
To turn Syncthing into a system daemon do the following:
- Ensure the Syncthing executable is in your users path (~/.bin or ~/.local/bin are fine places to put it). This has the added benefit of allowing automatic upgrades.
- Add the following contents to the file ~/.config/systemd/user/syncthing.service
ini
[Unit]
Description=Syncthing - Open Source Continuous File Synchronization
Documentation=man:syncthing(1)
StartLimitIntervalSec=60
StartLimitBurst=4
[Service]
ExecStart=/home/<user>/.local/bin/syncthing serve --no-browser --no-restart --logflags=0
Restart=on-failure
RestartSec=1
SuccessExitStatus=3 4
RestartForceExitStatus=3 4
# Hardening
SystemCallArchitectures=native
MemoryDenyWriteExecute=true
NoNewPrivileges=true
[Install]
WantedBy=default.target
[Unit]
Description=Syncthing - Open Source Continuous File Synchronization
Documentation=man:syncthing(1)
StartLimitIntervalSec=60
StartLimitBurst=4
[Service]
ExecStart=/home/<user>/.local/bin/syncthing serve --no-browser --no-restart --logflags=0
Restart=on-failure
RestartSec=1
SuccessExitStatus=3 4
RestartForceExitStatus=3 4
# Hardening
SystemCallArchitectures=native
MemoryDenyWriteExecute=true
NoNewPrivileges=true
[Install]
WantedBy=default.target
Replacing <user>
with the actual user. 3. Initialize the daemon with systemctl --user start syncthing.service
. Otherise interact with the service in the same way as any other Systemd unit file, except add the --user
flag to specify it's a user service. 4. Access the default Web GUI at localhost:8384.
See the Additional Resources if this simple guide is out of date.
ADDITIONAL RESOURCES