How to install Syncthing on a Debian server to serve multiple users

First, Install Syncthing:

sudo -s
curl -s | apt-key add -
echo "deb syncthing stable" | tee /etc/apt/sources.list.d/syncthing.list
printf "Package: *\nPin: origin\nPin-Priority: 990\n" | tee /etc/apt/preferences.d/syncthing
apt update
apt install syncthing

By default, Syncthing runs on port 8384. In order to serve multiple users, each user has to have a dedicated instance of Syncthing listening on a unique port. I found it easier to assign each user a port in 8390+ range re-using the last digit of user’s UID. The following sequense of commands would make it easier for you to automate the process of creating new istances. Note, that you might need to tweak it if your setup uses multiple IP addresses, or your users’ UIDs are not in the 1000-1009 range.

sudo -s -u <username>
sudo systemctl start syncthing@$user.service
sudo systemctl stop syncthing@$user.service
ip_address=$(hostname -I | xargs)
port=$(echo $UID | sed s/^100/839/)
sed -i "s/127\.0\.0\.1:8384/$ip_address:$port/" ~/.config/syncthing/config.xml
sudo systemctl enable syncthing@$user.service
sudo systemctl start syncthing@$user.service

Open web panel at http://$ip_address:$port and protect future access with login and password.

Also, you might want to mount your server sync directory on your desktop.