Skip to content

Syncthing Installation

Main Repository

Documentation


Fedora Installation

Package Installs

sudo dnf install syncthing

Systemd Configuration

After installing syncthing I enabled and started the systemd user service with the following command:

sudo systemctl enable [email protected] --now

Check the service status

systemctl status [email protected]

There are also several additional options to autostart syncthing that can be used.

Access the admin GUI

The admin GUI starts automatically and remains available on http://localhost:8384/. Cookies are essential to the correct functioning of the GUI; please ensure your browser accepts them.


Arch Installation

See also: Arch Intall/wiki

Package Install

sudo pacman -S syncthing

Systemd Configuration

After installing syncthing I enabled and started the systemd user service with the following command:

sudo systemctl enable [email protected] --now

Server Configuration

NOTE: Was unsuccesful with this method

Mount

Mount the storage media somewhere into the prepared directory, example:

mkdir /mnt/syncthing_storage
mount /dev/sds /mnt/syncthing_storage

Make sure the storage media get automatically mounted on boot, example using UUID:

pacman -S arch-install-tools
genfstab -U /mnt/syncthing_storage/ >> /etc/fstab

Note: You can remove the arch-install-tools package after this step. If you edit an fstab file manually, you do not even need it for the genfstab command in the first place.

Syncthing User

Create a system user syncuser without any login shell:

useradd --system --user-group --create-home --shell /usr/bin/nologin syncuser

Allow only root and syncuser users to access storage media:

chown root:syncuser /mnt/syncthing_storage
chmod 750 /mnt/syncthing_storage

Note: A separate system user greatly limits unauthorized data manipulation in case some ransomware or a malicious user used SSH key-pair to enter the device from my laptop.

User service

Running Syncthing as a systemd user service ensures that Syncthing only starts after the user has logged into the system (e.g., via the graphical login screen, or ssh). Thus, the user service is intended to be used on a (multiuser) desktop computer. To use the user service, start/enable the user unit syncthing.service (i.e. with the --user flag).

systemctl start syncthing

Syncthing systemd user service can be started after a specific (optionally encrypted) device has been mounted and stopped when device has been unmounted. To create a user service dependent on a mount point, after device has been mounted, systemd mount name has to be identified by running systemctl list-units -t mount command. Afterwards, create a new service similar to the one below:

vim /home/$USER/.config/systemd/user/syncthing.service

[Unit]
Description=Syncthing
BindsTo=run-media-user-and-hash.mount

[Service]
ExecStart=/usr/bin/syncthing

[Install]
WantedBy=run-media-user-and-hash.mount

Above service needs to be enabled by running:

systemctl enable --user syncthing.service

Network access

Syncthing GUI

Syncthing GUI

Additional Resources


Last update : 29 avril 2023
Created : 29 avril 2023