Syncthing

Open Source Sync with Syncthing (Part 1)

The ability to easily and securely transfer files is important, and while I have been mostly happy with BitTorrent Sync, I am continually on the look out for better, open source alternatives. Over the past several months, I have been testing one such alternative and I want to share what I have learned.

I love the idea behind BitTorrent Sync, but it has always bothered me that it was closed source. Unlike the tightly controlled, proprietary hardware/software synergy that corporations like Apple excel at, a software-based sync solution is different, and is a more tractable problem for the open source community to address. Jakob Borg was one developer that was up to the challenge, and in December of 2013, he released Syncthing.

The general idea behind the product and how it operates is similar to BitTorrent Sync, but the software is open source and is licensed under the GPL. The project is hosted on GitHub, is being actively maintained, and has a healthy community of supporters. Syncthing has good documentation as well.

Using the software is cake, but the initial installation and configuration can be cumbersome. Once it is up and running, I have found that Syncthing is a reliable, efficient way to handle my data syncing needs.

Installation

Syncthing is available for Windows, Linux, OS X, BSD, and Solaris, but since I recommend the use of OS X and Ubuntu, I am going to focus on these platforms. First, head over to GitHub and grab the binary installation file for Syncthing.

Choosing the Correct Package

If you are on a Mac, you will need to grab the download that has macosx-amd64 in the file name. If you are using Ubuntu, you will have to make a choice between 3 options:

  1. linux-386: For 32-bit systems
  2. linux-amd64: For 64-bit systems
  3. linux-arm For ARM systems

You can determine your system type with the following terminal command:

uname -a

If the result looks something like this, you have a 32-bit system:

Linux discworld 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:50 UTC 2011 i686 i686 i386 GNU/Linux

If the result looks something like this, you have a 64-bit system:

Linux discworld 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:50 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux

64-bit

Alternatively, you can click the gear in the top right corner of your screen and select About This Computer. Under OS type you will see 32-bit, 64-bit, or ARM.

First Run and Configuration

Note: You can store the syncthing binary file in a different location than I specify, but for organizational purposes and congruity with Syncthing's official documentation, I recommend utilizing the bin directory.

Syncthing Binary File

For OS X users, download the correct file and unpack it. Next, navigate to your Mac's Home folder (select the Finder and press Command+Shift+H) and create a new folder called bin (this is a common directory name for a location where binary files are stored).

Copy the syncthing binary file to the bin directory. Double-click the file to start the application and initiate the installation process. During this process, the Terminal application will open and provide feedback, like this:

$ syncthing
[monitor] 15:56:58 INFO: Starting syncthing
15:56:58 INFO: Generating RSA key and certificate for syncthing...
[ANSMX] 15:57:05 INFO: syncthing v0.10.14 (go1.4 darwin-amd64 default) jb@syno...
[ANSMX] 15:57:05 INFO: My ID: ANSMXYD-E6CF3JC-TCVPYGF-GXJPHSJ-MKUXBUQ-ZSPOKXH-...
[ANSMX] 15:57:05 INFO: No config file; starting with empty defaults
[ANSMX] 15:57:05 INFO: Edit gs1/config.xml to taste or use the GUI
[ANSMX] 15:57:05 INFO: Starting web GUI on http://127.0.0.1:8080/
[ANSMX] 15:57:05 INFO: Loading HTTPS certificate: open gs1/https-cert.pem: no ...
[ANSMX] 15:57:05 INFO: Creating new HTTPS certificate
[ANSMX] 15:57:05 INFO: Generating RSA key and certificate for syno...
[ANSMX] 15:57:07 INFO: Starting UPnP discovery...
[ANSMX] 15:57:13 INFO: UPnP discovery complete (found 0 devices).
[ANSMX] 15:57:13 INFO: Starting local discovery announcements
[ANSMX] 15:57:13 INFO: Local discovery over IPv4 unavailable
[ANSMX] 15:57:13 INFO: Starting global discovery announcements
[ANSMX] 15:57:13 OK: Ready to synchronize default (read-write)
[ANSMX] 15:57:13 INFO: Device ANSMXYD-E6CF3JC-TCVPYGF-GXJPHSJ-MKUXBUQ-ZSPOKXH-...
[ANSMX] 15:57:13 INFO: Completed initial scan (rw) of folder default

For Ubuntu users, download the file, un-pack it, and store the syncthing binary file in a bin folder in your user directory, just like on the Mac.

Allow executing file as program

Then, right-click the syncthing file and select Properties > Permissions. Make sure that the Execute: box is checked off. Finally, right-click the file, once again, and select Run.

The application's interface will open in your system's web browser. This interface is the main way that you will interact with the application.

Syncthing Interface

If you are part geek, you will recognize the localhost hostname and the port for TCP/UDP. If you have no idea what I just said, do not worry. Also, bookmark this address with a descriptive name so that you can always get back to it.

After installation, a new default folder is created in your user's home directory. The Sync folder is going to be your base for all of your syncing needs. This folder is analogous to the BitTorrent Sync folder I discussed in my BT Sync post.

You can sync any folder on your system with any folder on any other system, but this is where the majority of my synced content goes. Each one of my friends' and family’s computers gets its own folder in my Sync folder, which helps me keep everything nice and tidy, as I like it.

Sheldon Cooper

Continue Reading…

Paul Ciano

Enjoyed this post?

Let me know you appreciate it by signing up for my newsletter.

3 thoughts on “Open Source Sync with Syncthing (Part 1)”

  1. That’s pretty cool. I configured it on my Android phone and Macbook and it synced a bunch of photos across. The Android app can be configured to run in the background but I think it does run anyway, or at least for a short while after exiting the app as it synced some more changes even when it wasn’t showing. That could be a problem if I’m away from wifi and my data connection gets hogged by the sync.

    I’m already using foldersync to move any files more than 3 days old to my laptop. That usually gives the phone enough time to upload the files to Google Plus, but I need to think about this. If I sync with my “mobile import” directory then Lightroom will delete the files as soon as it imports them, causing a delete on my phone too, possibly before uploading to G+. It’s rare that I use the photos on G+ anyway, but it’s nice to know they’re there.
    It also means my phone photos are in Lightroom that much quicker..

    I’ll have to look into adding syncthing to initrd or whatever Macs use. :)

    1. For mobile, I’m mostly on iOS these days, and I use a different app for syncing to a local directory on my Mac. Beyond that, I don’t usually need to wirelessly transfer data between the iPhone and the Mac, and when I do, Transmit is a pretty awesome solution.

      If you’re new to Syncthing, I’m glad you’re enjoying playing around with it. I hope you find something that meets your specifications.

Comments are closed.