Let’s see how to install it as a systemd user service.
Enable systemd service for the user running
sudo loginctl enable-linger pim
Add the package (borrowed from https://apt.syncthing.net/) :
# Add the release PGP keys: curl -s https://syncthing.net/release-key.txt | sudo apt-key add - # Add the "stable" channel to your APT sources: echo "deb https://apt.syncthing.net/ syncthing stable" | sudo tee /etc/apt/sources.list.d/syncthing.list # Update and install syncthing: sudo apt-get update sudo apt-get install syncthing
Create the user service :
# make sure the systemd user directory exists mkdir -p ~/.config/systemd/user # create the service file cat >~/.config/systemd/user/syncthing <<EOL [Unit] Description=Syncthing - Open Source Continuous File Synchronization Documentation=man:syncthing(1) [Service] ExecStart=/usr/bin/syncthing -no-browser -logflags=0 Restart=on-failure SuccessExitStatus=3 4 RestartForceExitStatus=3 4 Nice=19 IOSchedulingClass=idle [Install] WantedBy=default.target EOL
Enable and start the service
systemctl --user enable syncthing systemctl --user start syncthing
The web interface is available at http://localhost:8384
syncthing will work behind a NAT, but will use public relays. For faster operation,
have a look at the syncthing documentation about firewalls.
For more details, here is a post about user services.