Syncthing and Fly.io

Hey all, I would like to host(in a cost efficient way) syncthing(https://syncthing.net/) on a VPS to get a somewhat centralized experience for it.
I also would like to deploy small web applications that I make in my free time, to get more experience with backend programming.

I’m currently deciding between Linode and Fly.io, Linode seems a great fit, but Fly.io docs are awesome and I am reading wonderful things about it.
But from the description, I get the impression that something like a syncthing server might not be the best fit for Fly.io? I say that because I see a lot of web frameworks related content for Fly.io

Hi @zetashift

You can run pretty much anything on Fly.io if you can package it as a docker container.

Looks like syncthing has a docker container already available so you should be fine running it on Fly.io

2 Likes

Thank you! :smiley:

So according to the Docker README of syncthing this is the command to get syncthing running in a container:

docker run --network=host \
    -v /wherever/st-sync:/var/syncthing \
    syncthing/syncthing:latest

And locally this does work for me, I could successfully navigate to the Syncthing web ui that was running in the container.
But how do I convert that command to something workable for Fly.io? Write a custom Dockerfile that pulls in and exposes ports?

Sorry for the question, in general new to Docker.

I’d be curious to have a sample fly.toml for this as well!

It’s been a while since I used it, but this worked for me:

app = "flysync"

[build]
  image = "syncthing/syncthing:latest"

[mounts]
source="syncthing_data"
destination="/var/syncthing"
1 Like

I just published a detailed tutorial for deploying Syncthing on Fly.io:

One thing I couldn’t figure out was how to get Syncthing to listen on an IPv6 interface and then proxy into it with fly proxy. The only way I could get it to work was by letting Syncthing listen on 127.0.0.1:8384, and then I used socat to proxy IPv6 8386 to 8384, and then I used fly proxy 8384:8386.

2 Likes