 Today, we're going to be looking at a program called SyncThing. SyncThing is an application that allows you to synchronize your files between devices. And I've been running it for a while on my desktop to synchronize music and photos from my phone. SyncThing is licensed under a Mozilla public license, and it's available for Linux, OSX, Windows, Android, BSD, Solaris, and today we're going to be looking at setting up so that we can sync files from an Android device and a desktop Linux device. Right now, I'm running off of Flash Drive here. This is a live version of MX Linux, why MX Linux? I just picked it because I've never used it before, and it's the most popular on Distro Watch right now, so I figured I'd give it a try. But it shouldn't matter what Distro you're running, SyncThing should run the same. So let's go ahead and get it installed on both devices and then synchronize some files. SyncThing, I believe, is available in the Google Play Store, but I'm going to install it from fDroid since that's what I normally use. So I'm going to go into fDroid and I'll type in SyncThing. And in the fDroid repository, you'll find that there's two copies. There's SyncThing and there's SyncThing force, I'm sorry, forked. And I believe that the forked version from what I've read is just the maintainers for the Android version weren't keeping up to date, so someone decide to take it over because it's open source. I think I normally use the regular version, but I'm going to go for the forked version in this video and see how that works. So I'll just click download and it will download. And then once it's done downloading, I'll click install. And I'll say install, it should only take a second here. And then I'll click open. If the open button doesn't work, I'll just click open. There we go. Now we'll go through a few things here, introduction, we want to grant permission to access storage on our device, continue, I'm going to grant permission for battery optimization. It has some options, you know, when it comes to battery optimization, depending on what state the battery on your device is in, you can decide, you know, whether it keeps syncing or it stops. And then now it's asking for location permissions. This is for, it will look at your Wi-Fi. So if you only wanted to sync when you're on your local network, you can set it to, you know, deactivate or disable when you're not on your local network or whatever networks you set it up for. So I'm going to go ahead and grant permission for this and hit continue. And now it's going to generate some keys for us because it's going to encrypt the transfer. By default, already has a folder set for the camera, but we're going to ignore that for now. And we're going to move on to the desktop. So normally I'm a, you know, pure Debian guy, but just wanted to do a new system. So again, this is right off a live USB drive. It's not even installed. And I chose MX Linux just because it seems to be a popular one now. So I figured people would be interested. But you can use whatever package manager you want. I am going to just go ahead and open up my terminal. And I will make the font bigger. There we go. So you can see what's going on here. And I'm just going to pseudo apt install sync thing, type in my secret password, which is demo by default on a live system for MX Linux. And it's going to start downloading. Hopefully. Oh, you know what, let me see something here. Oh, it just finished. It was just off the screen because I had made everything so big. So once sync thing is installed on your system, let's go ahead and clear this out. All you have to do is type in sync thing. Got to spell it right though. Sync thing. Oops. And hit enter. And what's going to do is going to start the server and then it's going to open up your web browser. And the GUI interface for this is a running as a web server. So let's see. Sync thing seems to be experiencing problem processing your request. Please refresh the page. Okay. We'll refresh page. I've never seen that message before, but we'll go ahead and refresh. There we go. Okay. So how do we set it up so these two devices sync? In reality, you can start on either end. I am going to start on the phone end here for this example. And I'm just going to ignore this interface for Android. And I'm going to click the menu here and there's a web GUI button. I'm going to press that. It's going to bring up the same interface that we have on the desktop, which I actually prefer. And you can actually set up the app to automatically open up to the web interface rather than this default interface. Let's see. It's asking right here just permission for allowing anonymous usage. That's up to you. Whether you want to do that, I'll just click no for now. And now what I want to do is I want to set up a new folder. So I'm going to click this add folder button. I'm going to give it a label and I'm just going to back up basically what would be my home directory. So hopefully it'll back up my music, my photos and everything inside that main Android directory I have. So I'm just going to call this main. I'm just going to give it a name and folder ID. We'll just leave that as the randomly generated one. And then the folder path. So I'm going to do storage emulated zero and I'm going to remove this main. So again, you could put in like music or whatever directory it is you want to back up. And I'm just going to do the entire directory there. And then I am going to click save. And actually before you click save, you can go into share settings. But now I'm going to go back in here on the main and I'm going to click edit. And there's a share tab, which was there before, but I exited out of it. And then what we're going to do here is we are going to decide what device we want to share it with. But I forgot an important step. We're going to hit cancel on this. So we set up a folder, but we also have to set up a device that this device will share with. So I'm going to come down here to devices and you'll see this device here. And I'm going to say add a remote device. And now it's going to ask for a device ID. And the device ID is unique for each device. It's generated. And you can see right here. I actually have a few listed on my local network because I got my desktop, my wife's desktop, my phone, her phone, and we're seeing four of them are on the network right now. And I have to make sure that I am picking the right one. So back on the desktop here. I can go up here to the top of the web interface and I can hit actions. And I can say show ID. And it gives you a QR code. You can scan with your phone. You can also see it written here that you can copy and paste. But since it's already detecting these devices on the phone, I just have to find the one that starts with this U3FIO. So let's go back to the phone. And we can see the second one in the list here is that one. I'll go ahead and click that. It adds device ID into the folder there. We're going to give this device a name. I'll just call it, I'll call it MX. Because it's MX. And then I'll click save. Whoops. Save. Back over on the laptop here. I'll close out of this. Now, just so you know, it's running as a service. But it's running on your local loopback. So even though this is a web interface connecting to a server on this machine, remote machines can't access it because it's on your loopback device, if that means anything to you. And it is your local host and it's on port 8384. So anytime your server's running, if you close out your web browser, you can always get back to it by going to your local host colon 8384. And right here, you can see when I, it took it a second, but it found that this device added, it says, this device, the Nexus 5X, wants to connect to you. And I will click add device. It lists out information about that device. And it gives you some options. We're just going to leave all these as the defaults, although you can read through them and choose what you want. And we'll click save. So we've created a folder on the phone and we've connected these two devices. So if I come down to devices, you can see remote device Nexus 5 and on the phone in the same interface because I'm using the web GUI here. You can see remote devices, the MX5. Now I have set up folders here. So now I can go back into this main folder I've created. I'll click edit, sharing. And I can check MX5. So after you add multiple devices, you come in here for this folder and check the ones you want. And then you just click save. And now the two folders are the, well, actually, sorry, the desktop's going to ask where you want to link that to. So on the desktop, it's saying that Nexus 5 wants to share this folder with me. And just give it a minute or so. It should automatically, you can always click refresh, maybe speed it up a little bit. But in less than a minute, usually pretty fast this will show up. And we'll say, yeah, yeah, OK, we've already added that device. We'll add that folder. We'll click add. You can rename it something. So I can call this phone main if I want. And then, of course, it has a folder ID here. Now we want to say where we want to put this. So I am going to say in my home directory, forward slash, now let's call this phone main. And I will click save. There are advanced options. There's a lot of options. But this is the basic syncing files. Now we are good. Now these two directories on the phone, if I add files to that folder on the phone, they should sync to the desktop. And the other way around, if I add folders to files on the desktop, they should sync to the phone. If I delete something from the phone, it will delete from the desktop on the other way around, which is important to note. Because when I first set this up on my phone, I forgot to turn off that if I delete a photo, because I had syncing photos over to my desktop. And I wanted them to stay on the desktop. So in the options, there is a place where you can say ignore deleted files. So it will back up my photos to my desktop. But once I delete them off the phone, they stay on the desktop. But it all depends on what you want to set up. But as you can see, it's syncing. It's 1% synced right now. You can always click on this and it will give you a little update on this. And the same thing is going on on the phone. And if we open up, let's see. Again, I don't use MXLinks. This looks like a file manager here. We can see that there are directories here. And there is one called PhoneMain that synced thing created. I'll click on that. And you can see alarms, Android, DCIM, downloads, movies, music, notifications, pictures, podcasts. So these are all the files and folders that are in my main directory on my phone. And again, so it's syncing and it's creating all those folders. It's only 4% synced because I must have, this is my spare phone that I use for testing stuff out on. So I'm not sure all of what's syncing over. Obviously, Android's gonna have all the settings for my different Android applications if I've taken any pictures that are in there. So that's it. That is the basic. So again, to review those steps, you can either create the folder on the device first or synchronize the devices first. So you can add a device, the link together. Again, once you pick the correct device from the list, notification on that other device should say, hey, this device wants to connect. Yes or no, blah, blah, blah. And then once you do that, then you share the folder you create. It'll ask where you wanna save it. And then you can go into all the settings on it. How you want it to sync and battery management. Also, you have to make sure that the sync thing is running. So on your phone, you have to go into settings and make sure that you set it up. I don't think it does by default. You wanna set it up as a service. So it starts when the phone starts. If that's what you wanna do and I would recommend it. I have been doing it for months on my phone and I haven't noticed any difference in battery life. So it runs in the background all the time. So I take photos. Again, I set up my Wi-Fi as a recognized Wi-Fi and I set it up to only sync over Wi-Fi when I'm on that Wi-Fi. So if I'm out and about, I take a bunch of pictures and videos. Soon as I get home, as soon as I get on my Wi-Fi I start syncing with my desktop. So yeah, and on your desktop, you just wanna set sync thing to your artist art applications. So just make sure it's running on both devices. And at this point, it's syncing. And then at this point, you just go through the settings, see what options they have, because there are a lot. And I've only touched on a few of them because I only need to use a few of them. Like I said, my photos, I wanted to make sure that when a photo backs up from my phone to my desktop, even if I delete it off the phone, it stays on the desktop. So that was an option I had to go in and set. But with the other things, I have music syncing and I set it up so that it deletes either way. So if I delete a file off my desktop, it removes it from the phone. And if I add a file, it adds it back to the phone and the other way around that way, I can update my music list and I know it's on there without having to drag and drop files over to the phone. So sync thing. I've been using it for months. It is a great little program, cross platform. You can run it on an Arduino, not an Arduino, I do that all the time. Raspberry Pi, if you're running that as a server, or really anything running Linux, Windows, Solaris, what else I have to list to open it here. Mac OS or OS X, I guess it's called Android BSD. So if you're running any of those, you can now sync all your files automatically and it works great. So thanks for watching. I hope you found this useful and I hope that you have a great day.