UPDATE: you can now semi-automatically install Syncthing.
OPTION1: AUTOMATIC INSTALLATION
This will install SyncThing and configure the mediafolder that will contain the Sync folder.
-
Download my OSMCautosetup script:
wget https://gist.githubusercontent.com/zilexa/7a654cd18c9ec663f4daa1a791a5f99e/raw/be532deec710c2e82a269ec74468603cbb2fdb86/OSMCautosetup.sh
-
Now edit it, set a 0 for the apps/configurations you don’t want and a “1” for SyncThing, also set the path to the mediafolder/harddrive or network location that should contain the Sync folder, where it will sync your files:
nano OSMCautosetup.sh
(save the file with CTRL+O, exit the editor with CTRL+X) -
Now run the script:
sudo bash OSMCautosetup.sh
OPTION 2: MANUAL INSTALL:
Official information from Syncthing to install on Debian based systems: http://apt.syncthing.net/
This HowTo discusses how to manually do the following (note my OSMCautosetup from option 1 does all of this for you):
Installation
Autostart on boot
Remote WebUI
And will follow the exact guidelines from Syncthing with respect for the file structure and methods used by OSMC.
Installation
-
Add the release PGP keys:
curl -s https://syncthing.net/release-key.txt | sudo apt-key add -
-
Add the “release” channel to your APT sources:
echo “deb http://apt.syncthing.net/ syncthing release” | sudo tee /etc/apt/sources.list.d/syncthing.list
-
Update and install syncthing:
sudo apt-get update
sudo apt-get install syncthing
Autostart on boot
4) create the following file
sudo nano /lib/systemd/system/syncthing.service
-
copy paste the following, hit CTRL+O to save, CTRL+X to exit.
#Syncthing systemd service file for OSMC
#Path should be /lib/systemd/system/syncthing.service[Unit]
Description=Syncthing - OSMC
Documentation=http://docs.syncthing.net/
After=network.target
Wants=syncthing-inotify@.service[Service]
User=osmc
Nice=7
Environment=STNORESTART=yes
ExecStart=/usr/bin/syncthing -no-browser -logflags=0
Restart=on-failure
SuccessExitStatus=2 3 4
RestartForceExitStatus=3 4[Install]
WantedBy=multi-user.target -
now enable the service and start it
sudo systemctl enable syncthing.service
sudo systemctl start syncthing.service
You can check if Syncthing has started succesfully:
sudo systemctl status syncthing.service
Configuration
7) Edit the Syncthing configuration:
stop the service first sudo systemctl stop syncthing.service
open the config file in the editor: nano /home/osmc/.config/syncthing/config.xml
-
On line 2, change the following
path="home/osmc/sync/"
to the default path you want to use. For example in my case, it is my attached USB drive:path="/media/UsbDriveName/"
-
Also a bit further down the file, change the GUI Listen Address setting from the default 127.0.0.1:8384 to
0.0.0.0:8384. This is required for remote access of the webUI. -
Start Syncthing again:
sudo systemctl stop syncthing.service
DONE!
Remote WebUI (access Syncthing from other computers)
To access the webui, enter the IP of your OSMC device in a browser, for example: 192.168.1.1:8384
You will never need to do anything via SSH. Everything can be done via the webUI. To access this webUI and any other services like transmission when you are not at home, read my (suprisingly simple!) SSH Tunneling guide. No need to open ports in your router!