Syncthing on Arch Linux

Syncthing on Arch Linux







Syncthing 1 is an open source tool which keeps files on different machines in sync.


For Arch Linux Syncthing is available in the community repository 3 and can be installed easily:

# pacman -S syncthing

The Syncthing package installs a .service file at /usr/lib/systemd/system/syncthing@.service.

Description=Syncthing service for %i



When enabling or starting the service, supply the user under which syncthing will run:

# systemctl start syncthing@yourname
# systemctl enable syncthing@yourname


Configuration is located at ~/.config/syncthing/. The directory and config files inside it will be created when Syncthing is first started. It is described in detail in the Syncthing documentation 2.

The config.xml can either be edited via the web GUI or manually. By default, the Web GUI is only reachable from the same machine.

If Syncthing is installed on a machine without a desktop, one can either edit the configuration manually for all tasks or at least to make the GUI available on the network. Manual configuration will also be necessary if you want to change the port number under which the GUI is available, for example when the default port 8080 is already in use.

<configuration version="6">
    <gui enabled="true" tls="true">
        <!-- default: -->

The first thing you might want to do is to remove the ~/Sync/ directory that was created on startup and replace it with something else.

# systemctl stop syncthing@yourname
$ rm -r ~/Sync

Edit the config file to include the directories to sync:

<configuration version="6">
    <folder id="default" path="/home/yourname/sync-folder" ro="false" rescanIntervalS="60" ignorePerms="false">
        <device id="[ID-1]"></device>

Create more <folder> elements if you want to sync other directories.

Changes will take effect when Syncthing is restarted:

# systemctl restart syncthing@yourname

Start Syncing

Repeat installation and configuration on other machines you which to keep in sync. On each machine, Syncthing must be started at least once to determine the device ID for that machine.

Edit the config file to include the new devices and add the device to each folder you want to sync:

<configuration version="6">
    <folder id="notes" path="/home/akeil/notes" ro="false" rescanIntervalS="60" ignorePerms="false">
        <!-- the ID of the local device -->
        <device id="[ID-1]"></device>
        <!-- one or more IDs of remote devices -->
        <device id="[ID-2]"></device>
    <!-- the local device -->
    <device id="[ID-1]" name="other-machine" compression="true" introducer="false">
    <!-- remote devices to sync with -->
    <device id="[ID-1] name="home" compression="true" introducer="false">

Restart syncthing:

# systemctl restart syncthing@yourname


You must create <device> elements on both machines. (inside the <folder>'s you wish to sync and in the general section of known devices.).

If not, entries like this appear in the log and nothing is synced:

[...] Connection from with unknown device ID [ID-1];

Logfiles (Journal)

View logs with:

$ journalctl --unit syncthing@yourname


$ systemctl status syncthing@yourname