How to install syncthing on Ubuntu Server

After nuking my Ubuntu 12.04 server and installing 14.04, I could finally use the ppa. The whole installation experience was a huge let down. The developers of Syncthing have been as "helpful" as off-shored support operators of eBay, never missing a chance of insulting me.

Despite this peopleware-specific shortcoming of the project I recommend you to try it out and hopefully my guide will help you get it up and running in no time.

The developers of Syncthing have been as "helpful" as off-shored support operators of eBay

Known Snares

  • Only Version v0.10.27 talks to v0.10.27! If you are trying to get version x.x.11 to talk to x.x.27 you are most likely out of luck. This is what I experienced, cross-version could work for you, I would not recomment it though.

  • Ubuntu 12.04 has an older kernel that won't let you install docker nor the syncthing docker container. You need to upgrade your kernel first

  • Although the syncthing developers write about version go1.3 or higher is needed in order to compile syncthing, you will need exactly go version 1.3 and not lower nor higher. This is what I experienced during installation.

  • Firewall: You will need to open that firewalls or you're out of luck. This can't be emphasised enough.

Getting the PPA

Make sure you have Ubuntu 14.04 installed

Add the PPA from ytvwld on both client and server like so:

sudo add-apt-repository ppa:ytvwld/syncthing
sudo apt-get update
sudo apt-get install syncthing

Setup iptables

iptables -A INPUT -p udp --dport 21025 -j ACCEPT
iptables -A INPUT -p tcp --dport 22000 -j ACCEPT
iptables-save
iptables --flush
iptables -L

-A INPUT -p udp -m udp --dport 21025 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 22000 -j ACCEPT

Setup syncthing

$ syncthing

CTRL-C

Change 127.0.0.1 to 0.0.0.0:8080 in the GUI section if you want to access externally

$ emacs ~/.config/syncthing/config.xml

Start up syncthing:

$ syncthing

Usually you would to change username and passwort in the GUI when doing above change to 0.0.0.0:8080, but you can change that in the GUI itself.

Use upstart to daemonize

There is a official upstart tutorial by the syncthing project, but as with any other guides the project posts, it has proven half-baked and did not work for me.

However, creating a configuration file like this inside ~/.config/upstart worked for my desktop version (thanks to wiremoon):

Epilogue

I am still looking forward to daemonize syncthing on my server and will update this article. Hopefully the project will survive a few years and thrive despite the childish atitudes the product owners displayed.

Credits

Above guide is based on this tutorial at DigitalOcean.
Thanks to wiremoon of providing the script.