Skip to main content

How to Install RustDesk on Your Synology NAS

RustDesk is a remote desktop software, the open source TeamViewer / AnyDesk alternative. You have full control of your data, with no concerns about security since it only sends data to a server that you setup. You can use a public rendezvous/relay server or self-host one. In this step by step guide I will show you how to install RustDesk on your Synology NAS using Docker and DSM 7.2 I've based a significant amount of this guide on https://drfrankenstein.co.uk guides. First, Follow the following 4 guides: Step 0: Docker, Memory Recommendations and Limitations Step 1: Directory Setup Guide Step 2: Setting up a restricted Docker user Step 3: Setting up a Docker Bridge Network Following these guides will give you a nice Docker folder structure, a restricted user to run your containers on (this is more secure) and a dedicated network for your containers. Lets Begin First we need to set up some folders for RustDesk to save its configuration files and also where the Project will save th...

How to Install RustDesk on Your Synology NAS

RustDesk is a remote desktop software, the open source TeamViewer / AnyDesk alternative. You have full control of your data, with no concerns about security since it only sends data to a server that you setup. You can use a public rendezvous/relay server or self-host one. In this step by step guide I will show you how to install RustDesk on your Synology NAS using Docker and DSM 7.2

I've based a significant amount of this guide on https://drfrankenstein.co.uk guides.


First, Follow the following 4 guides:

Following these guides will give you a nice Docker folder structure, a restricted user to run your containers on (this is more secure) and a dedicated network for your containers.

Lets Begin

First we need to set up some folders for RustDesk to save its configuration files and also where the Project will save the compose.

Using File Station create the following folders.
/docker/projects/rustdesk-compose
/docker/rustdesk 
 

Container Setup

Next we are going to set up a ‘Project’ in Container Manager. Open up Container Manager and click on Project, then on the right-hand side click ‘Create’.

In the next screen we will set up our General Settings.

Section

Setting

Project Name:

rustdesk

Path:

/docker/projects/rustdesk-compose

Source:

Create docker-compose.yml



Next we are going to drop in our docker compose configuration, copy all the code in the box below and paste it into line ‘1’

You will see notes saying #change me we will do this on the next step, and you can remove the comments if you wish.  Don't hit Next after pasting.


services:
  rustdeskhbbs:
    image: rustdesk/rustdesk-server:latest
    container_name: rustdeskhbbs
    command: hbbs -r rustdesk.example.com:21117 #CHANGE_TO_YOUR_ADDRESS
    environment:
      - PUID=1234 #CHANGE_TO_YOUR_UID
      - PGID=65432 #CHANGE_TO_YOUR_GID
      - TZ=Europe/London #CHANGE_TO_YOUR_TZ
      - UMASK=022
    volumes:
      - /volume1/docker/rustdesk:/root
    ports:
      - 21115:21115
      - 21116:21116
      - 21116:21116/udp
      - 21118:21118
    network_mode: synobridge
    security_opt:
      - no-new-privileges:true
    restart: always

  rustdeskhbbr:
    image: rustdesk/rustdesk-server:latest
    container_name: rustdeskhbbr
    command: hbbr -k _
    environment:
      - PUID=1234 #CHANGE_TO_YOUR_UID
      - PGID=65432 #CHANGE_TO_YOUR_GID
      - TZ=Europe/London #CHANGE_TO_YOUR_TZ
      - UMASK=022
    volumes:
      - /volume1/docker/rustdesk:/root
    ports:
      - 21117:21117
      - 21119:21119 
    network_mode: synobridge
    security_opt:
      - no-new-privileges:true
    restart: always
 

Editing the Compose & Environment Variables



Please keep in mind that yaml formatting is very specific, so keep things lined up as per the original.
We need to make some minor edits to the compose file in order to make sure the containers use the ‘dockerlimited’ user we created earlier and also let them know which timezone we are located. You will need to edit these in each section noted with ‘#change me’
VariableValue
PUID=Change it to the UID you obtained earlier in the first setup guides
PGID=Change it to the GID you obtained earlier in the first setup guides
TZ=You will need to change this line to your own timezone code – you can find the correct list of ones to use on wikipedia.org/wiki/List_of_tz_database_time_zones
command: hbbs -r Change to your external IP / Hostname or DDNS that you have setup

Once you have made all your required edits click ‘Next’

Nothing to change on the next screen click ‘Next’ again.


On the final screen just click ‘Done’ and you will see a new window appear which will kick of downloading of the required container image and configure the containers.


This can take a couple of minutes to finish as all the images are downloaded and extracted. You should see ‘Code 0’ when it has finished.

Once finished you will see the Project is running with a green status.

Finally, you need to find out what your Public Key is.  The Public Key is used to authenticate clients.

Using File Station, navigate to the rustdesk folder you created.  There will be a file ending in .PUB.  It contains your Public Key.  Copy this key to a safe place, you will need to enter it into each RustDesk client you want to use.

Client Setup

Download RustDesk from https://rustdesk.com/.  Once you have it installed, Launch it, and click the 3 dots on the left sidebar.


This will open the Settings Window.  Click on Network.  Then click Unlock Network Settings


In the ID Server field, put your external IP / Hostname or DDNS that you have setup.  In the Key field, put the Public Key from the PUB file.

Hit Apply, and you are done.  Close the settings window.  RustDesk is ready to be used.

Hardcoding the ID Server and Public Key

See this article from RustDesk for help doing this:

External Access

Make sure you Forward TCP Ports 21115-21119, and UDP port 21116 on your firewall to your SAN.

Firewall

If you have enabled the Firewall on your Synology SAN, you will need to open port TCP Ports 21115-21119, and UDP port 21116.

Upgrading

Follow DrFrankenstien's Guide to utilizing Watchtower.  It will automatically install updates from the container registry when they are released.

Notes

I chose to have the hbbs and the hbbr server use the same folder.  You will see some guides having different folders for each container.  I have found that this typically causes a Public Key mismatch because both servers will create Keys at startup.  By sharing a directory, the second container will see the existing Public Key, and just use it.

Several choices were made to increase security, that are not in other guides, namely using a Limited Access User Account and limiting the ports that the container can open.  

Comments

Most Popular Posts

First Post!

In August 1999, I bought my own domain name, mpking.com .  This domain name. Over the years I've used a variety of blogging software. Initially I did all the website design myself, hand crafting the HTML myself. I even had one of those *Designed by Notepad* buttons. I still have one of the custom drop cap letters I made. Yea, it's really hard to see, because it's White text.  My first website, like most all bad websites of the early 2000, was black theme.  I ran the website off my computer in my room. I quickly tired of this, and moved onto a Blog software platform.  You used an actual program program, (I don't remember it's name) and you would type up your entry, then upload it to the website.  That tired quickly, as the software was at home, and most entries, then as now, revolved around work. Then I discovered FreeGuppy .  It was online CMS platform, and it was nearly perfect, for almost five years.I even developed some pl...