Lucas Janin | Headscale & Tailscale - Synology NAS Installation - Lucas Janin

Headscale & Tailscale – Synology NAS Installation

3 January 2025
  • headscale-synology-featured

This is the specific procedure for installing Tailscale with Headscale on a Synology NAS. This post is also available in French too.
First, install the Tailscale application using the Synology package manager.

Do not try to initialize using the user interface, as this will only work with the Tailscale commercial service, not Headscale.

Then log in to the NAS using SSH via your administrator account and execute this command:

sudo tailscale up --reset --login-server https://hs.xxxx.xxx

Retrieve the value of mkey, then open a terminal on the Headscale machine and execute this command:

docker exec headscale headscale nodes register --user USERNAME --key mkey:xxxxxxxxxxxxxxxxxxxxxxxx 

To do this via the Headplane interface, on the “Machines” page, click on “Add Device”, add the mkey:xxx character string, choose the user and click “Register”.

Setup Tailscale Outbound Connections On Synology NAS

On a Synology NAS, some additional operations are required. I found this information about this video and this documentation on the Tailscale website.

  • Make sure you’re running Tailscale 1.22.2 or later, either from the Synology Package Center or a manually installed *.spk from the Tailscale Packages server.
  • In Synology, go to Control Panel > Task Scheduler, click Create, and select Triggered Task.
  • Select User-defined script.
  • When the Create task window appears, click General.
  • In General Settings, enter a task name, select root as the user that the task will run for, and select Boot-up as the event that triggers the task. Ensure the task is enabled.
  • Click Task Settings and enter the following for User-defined script.
/var/packages/Tailscale/target/bin/tailscale configure-host; 
synosystemctl restart pkgctl-Tailscale.service
  • Click OK to save the settings.
  • Reboot your Synology. (Alternatively, to avoid a reboot, run the above user-defined script as root on the device to restart the Tailscale package.)

On my remote Synology, I found that after a while, it would no longer accept incoming connections. So I created a new scheduled task for every day at 11:30 with the same command above to make sure that everything works for my backup that runs at midnight. I haven’t seen any worries since that addition.
I invite you to read or return to the Headscale and Tailscale ticket.

5 Comments

on Headscale & Tailscale – Synology NAS Installation.
  1. Jean-Pierre
    |

    Hello,
    Nice article about Head and tailscale. I have it running on a vps and is running fine.
    Just the nas would not connect with the command you mentioned here above.
    I give my sudo password and then nothing happens for a long time.
    Any recommendations?
    Thank you.

    • |

      Same issue here, I can enroll android phones, windiows and Linux machines, but the synology NAS is doing the exact same. Stuck after entering sudo password.

      i connected as root “sudo su” on the syno and re-run the command and again same behavior.

      I made sure my headscale was fully up2date, reachable and with correct certificate.

      If i just do a “sudo tailscale up”, then it work immediately, but with Tailscale’s server and not mine.

      Regards

  2. |

    To add to my comment, instead of downloading the TailScale from the synology store, I did donwloaded the current version from “from the Tailscale Packages server.” indicated in your post and the problem is now solved !!!

    I hope this will help Jean-Pierre.

    • Jean_pierre
      |

      I have also installed the other package and everything is working for now.
      Thank you for the reply and the help.

Leave a Reply

Your feedback is valuable for us. Your email will not be published.