running Syncthing as normal user instead of root user

I have Syncthing running in a LXC on Proxmox, based on Debian. I used the proxmox ve helper scripts installation by ttec.
When opening the Syncthing GUI, I get a message that I’m running Syncthing as root/system user and I should consider using a normal user account - how can I do this?

I have read through several websites but did not find a clear instruction, how to change the general Syncthing settings in order to be able to run Syncthing as a normal user instead of the root user which is the preset after installation . I did a fresh install today to check again how I can fix it but was not successful so any help is highly appreciated - as I’m having a fresh installation now, there is no configurated sync jobs yet - so I would be ready to change it over once I know how to. Thanks!

Which OS template are you using for the LXC container?

LXC VMs are almost full OS installs, minus the Linux kernel and a few other things that are shared with the host. So the steps for installing and setting up Syncthing are the same as for a KVM or bare-metal machine.

(When referring to scripts, tutorials, etc., it often helps to have a link to the source of the info.)

Hi, it’s Debian 12 The script details can be found here:

Thank you!

That shell script basically bunches up the steps of adding the Syncthing project’s official APT repo → installing the DEB package → enabling a systemd service → opening up Syncthing’s web GUI for remote access.

(Automating the last step isn’t such a great idea before the user has had time to set a password, especially when Syncthing is running with root privileges.)

Line 28 of the script issues the following command:

systemctl enable syncthing@root.service

The line above tells systemd to auto-start Syncthing under the root user account.

After the line above there are also additional systemctl calls. A simple change would be to replace every instance of root.service with the name of your preferred user to run Syncthing – e.g. robert40.service

However, the script you used doesn’t override the Syncthing package provided by Debian, so your system will be open to conflicts/issues during future updates since there are technically two sources configured for Syncthing.

Since you’re running Syncthing in a LXC container, I’d recommend starting with a clean slate. Instead of using the syncthing-install.sh script, follow the simple steps at https://apt.syncthing.net/ and https://docs.syncthing.net/users/autostart.html#linux. You’ll end up with Syncthing running as a normal user, a more secure setup, and a cleaner install.

Hi, thank you so much for your detailed reply. I did follow your recommendation and startet with a clean slate. I installed syncthing myself as a programm in my debain LXC, instead of using the script. It worked and I was able to create a user “syncthing” instead of the root user. But now I fear I have a new problem: I seem not to have permissions - I get this error message, when trying to sync a folder: Failed to create folder marker: mkdir /home/syncthing/Sync/syncHandyM/.stfolder: permission denied

Could someone help me to solve this issue? Thank you!

PS: the folder permissions look like this: Screenshot Syncthing Putty 2024-08-21 150120

PPS: I read in another thread here in this forum a possible answer: Syncthing on regular Linux runs as the user you start it as. If you start it as yourself and you have access to the directory in question you should be fine.

→ I created the syncthing user during install - I’m pretty sure I am running the programm with this user, but how do I make sure this is the case?

I installed syncthing as a system service. Here’s the current status: