How do I run 2 Syncthing instances at the same time on Android device?

Hello, I was reading that it is only possible with changing ports and running containers. Why did it get so complicated?

Until yesterday I was still running the old Syncthing, that was not updated for a long time. So I decided to upgrade it to the “Fork” but unfortunately my old setup is not working with the new application.

I habe an old Pixel phone and I use the main profile to backup photos from my new Pixel phone to Google Photos. But I also have a work profile with my wife’s account to backup her photos from her Pixel phone. That was working now for years without any problems and I was able to backup photos to 2 separate Google accounts at the same time just with one phone. But with the “Fork” I am getting on one of the profiles “exit code 1“ and in logs ‘“…instance is already running“.

Is there any way to get it to work or is my only option going back to the old application?

Syncthing has always required that multiple instances run on different ports. And while it can be run in a container, this is the first time I can recall anyone discussing running Syncthing on a mobile device in a container.

How are you backing photos up to Google Photos? Syncthing doesn’t do that directly. I’m thinking you’re syncing photos to another Syncthing Device that in turn backs things up to Google Photos. Is that right?

The message “instance is already running” means that Syncthing is already running on that Device. The second Syncthing instance cannot use the same database.

While you can run two instances of Syncthing on the same Device (take a look at the —home flag, for an example of a way to do this), most people should not, IMO. I’m not understanding your use case for wanting to run two instances. Running two instances on a mobile device strikes me as…well…inadvisable.

2 Likes

Thanks for the replay.

I was not talking about running containers on mobile devices. It’s just what I can find when searching on the internet.

So again, I have an old Pixel device that I am using to backup all my photos (from my new devices) to Google Photos. Backup to Google Photos is only free on old Pixel devices (up to Pixel 5) and that’s why I can’t just do it directly from my new device. I would think that would be a common use case of this application. And because I want to do that for two different Google accounts, I am using the work profile for one of them so I can be logged into both at the same time.

Is there any simpler way to do that? And with the old application I just had to install it on both profiles (main and work) and it was just working without changing any ports or whatever.

So I had a look at the “-home” flag but just to clarify: don’t the profiles on an android device have separate data locations anyways? I have many other apps running on both profiles and all of them have their own unique data.

I don’t run Android.

Would this work for your use case?

  • FirstPhone syncs photos to Pixel
  • SecondPhone syncs photos to Pixel
  • Pixel backs up photos to Google

You can do this with a single instance of Syncthing on each device — I’d strongly recommend that FirstPhone and SecondPhone sync to separate Syncthing Folders on the Pixel.

That would be perfect, running only one instance would be my preference. The problem is, I need to be logged into TWO different Google accounts at the same time for the Google Photos backup to work. And I have no access in my “work” profile to files from my “main” account.

If anyone has an idea how to access files between both profiles. The folder would have to be recognized by Google Photos.

But still, my main question remains. What did change in the V2. Is that the Web UI or what is blocking two instances from running at the same time? They use different databases because it is two different profiles, but still I am getting the exit error: “Another Syncthing instance may be already running.“ What is it exactly checking to determine that and can it be turned off?

I just looked up the version I was running before and had no problems whatsoever. It was v1.27.10 and it looks like my only option is to go back to this very old version.

1 Like

In your shoes I would probably look for a used old Pixel and do this twice.

If your use case requires two mutually exclusive Google logins and Syncthing can’t sync the files for both accounts at the same time, then it does seem like you do need two Syncthing instances on your Pixel.

Syncthing has always required separate databases, config files and ports when more than one instance is running. This is not a change from 1.x to 2.x.

You could also have just one Syncthing instance running at a time. This would still require different databases and config files, but could use the same port just one at a time.

Now that is a big ask. Spending 150€ on the phone and most likely having to replace the battery. And keep both phones always charged. Also I would have to get 2 phones, because I have exactly the same setup for my parents.

Something changed, old version works fine. There has to be same additional check that prevents it from running. But as the old version shows, running an instance on main and work profile at the same time is possible and the extra check could be disabled/improved… If any contributor could have a look into that.

If I wanted to change the port, where would I do it? Is it under GUI options or is it the announce port?

Check your configuration files for the two Syncthing instances that were running 1.x. I promise you that they weren’t using the same network ports at the same time.

The GUI options are for the GUI and API access. Check Actions / Settings / Connections to see and change the configuration for the listen address — you can override the default port here.

Changing port was the solution. Just doing it for the connections is not enough. I had to change the GUI port as well.

I also looked into the configuration of my old phone for the old app version. And indeed, the ports were changed in the work profile. But I didn’t do it, so I guess the application had to recognize that they are already in use and changed them by itself.

Thanks for the help :slight_smile:

1 Like