Getting started on headless linux

Hello,

Is there a documented approach on how to configure Syncthing on a headless linux?

If possible something fast and painless :slight_smile:

Thanks,

Thomas

1 Like

Exposing Syncthing’s UI to the world (taking usual security measures depending on your use-case) or doing an ssh tunnel are the usual methods that come to mind - both methods should be searchable.

Thanks for your response,

So there are not any known way to do this?

1 Like

Obviously there are, you’re not the first person to do this (by far), and that’s also what I wrote.

Have you checked the docs?

Sorry simon, your response sounded vague but it wasn’t.

Exposing the UI sound too complicated, I’m gonna skip this one.

I don’t understand what SSH tunneling could do for me in this case, could you explain it?

Create a tunnel between localhost:8384 on the headless device and e.g. localhost:8385 on the device your currently on, to access the web UI there.

Thanks !

If it works as I expect it could be a very handy trick :no_good_woman:

I just did this recently myself, so while it’s still fresh in my mind, here’s a quick and dirty tutorial:

Let’s say you have a Linux laptop, and the headless Linux box where you want to run syncthing has a working hostname of “headless”, (within your LAN). The username on the headless box we’ll run Syncthing as is called “admsync”.

On the laptop, in a terminal:

ssh -L 9988:localhost:8384 admsync@headless

Then once ssh’ed in as admsync, run the syncthing command.

Now on your laptop, in a web browser, visit the URL:

https://localhost:9988

…and you should see the Syncthing GUI from the headless box.

Note: on the headless box, in /etc/ssh/sshd_config, “AllowTcpForwarding” must not be “no”, for this tunneling to work.

I had no idea ssh had this feature, i’m glad I digged into it.

Works on windows also, perfect.

I am also on a headless server (Raspberry) and managed to get Syncthing working. I also used the tunnel, but slightly differently: https://askubuntu.com/questions/1209269/how-to-connect-to-localhost-of-headless-server-for-syncthing

Now there is one issue left. When I start syncthing on the server there is a lot of output to the console. I tried putting it into background with syncthing & but this is not working. I did not set up a systemctl service yet. Is there a simple way to manually start it in the background? I can not find anything in --help

This is more of a bash question but:

syncthing &>/var/log/syncthing.log & disown

will start it in the background, detach from your terminal, and redirect the logs to a file.