Merge pull request #360 from xlionjuan/synology-dsm

#355 And add docs for DSM7
This commit is contained in:
RustDesk 2024-02-29 19:11:02 +08:00 committed by GitHub
commit e1022f5239
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
36 changed files with 187 additions and 68 deletions

View File

@ -2,71 +2,5 @@
title: Synology
weight: 22
---
> An alterative up-to-date tutorial from third-party is [here](https://mariushosting.com/how-to-install-rustdesk-on-your-synology-nas/).
This tutorial is based on latest DSM v6 and v7.
### Install Docker
| Open Package Center | Install Docker |
| --- | --- |
| ![](/docs/en/self-host/rustdesk-server-oss/synology/images/package-manager.png) | ![](/docs/en/self-host/rustdesk-server-oss/synology/images/docker.png) |
### Install RustDesk Server
| Search rustdesk-server in Docker's registry and install by double click | Installed rustdesk-server image, double click to create rustdesk-server container |
| --- | --- |
| ![](/docs/en/self-host/rustdesk-server-oss/synology/images/pull-rustdesk-server.png) | ![](/docs/en/self-host/rustdesk-server-oss/synology/images/rustdesk-server-installed.png) |
### Create hbbs container
As mentioned above, double click on rustdesk-server image to create new container, set it name to `hbbs`.
![](/docs/en/self-host/rustdesk-server-oss/synology/images/hbbs.png)
Click on above `Advanced Settings`.
- Enable auto-restart
![](/docs/en/self-host/rustdesk-server-oss/synology/images/auto-restart.png)
- Enable `Use the same network as Docker Host`, for more about host net, please [check](https://rustdesk.com/docs/en/self-host/rustdesk-server-oss/docker/#net-host).
![](/docs/en/self-host/rustdesk-server-oss/synology/images/host-net.png)
- Mount a host directory (e.g. `/home/rustdesk/`) to `/root`, hbbs will generate some files (database and `key` files) in this directory which need to be persistent over reboots.
| Mount | Files generated in the host directory |
| --- | --- |
| ![](/docs/en/self-host/rustdesk-server-oss/synology/images/mount.png) | ![](/docs/en/self-host/rustdesk-server-oss/synology/images/mounted-dir.png) |
- Set command
{{% notice note %}}
Synology's OS is Debian based, so host net (--net=host) works fine, we do not need to map ports with `-p` option.
`192.168.16.98` is an internal IP used here for demonstration only, please set it to a public IP when you deploy (or you can use your DDNS address if you have configured one in "Control Panel → Connectivity → DDNS") and don't forget to open ports on your router and your Synology firewall if this is enabled ("Control Panel → Connectivity → Firewall")!
{{% /notice %}}
![](/docs/en/self-host/rustdesk-server-oss/synology/images/hbbs-cmd.png?v2)
- Done
![](/docs/en/self-host/rustdesk-server-oss/synology/images/hbbs-config.png)
### Create hbbr container
Please repeat above `hbbs` steps, but name the container `hbbr` and command (for Set Command Step) should be `hbbr -k _`.
![](/docs/en/self-host/rustdesk-server-oss/synology/images/hbbr-config.png)
### hbbr/hbbs containers
![](/docs/en/self-host/rustdesk-server-oss/synology/images/containers.png)
| Double click on container and check log | Double confirm hbbs/hbbr using host network |
| --- | --- |
| ![](/docs/en/self-host/rustdesk-server-oss/synology/images/log.png) | ![](/docs/en/self-host/rustdesk-server-oss/synology/images/network-types.png) |
### Retrieve your Key
Browse to the folder setup before using File Station, download `id_ed25519.pub` and open with a text editor to via your key.
Synology has two type of Docker, "Docker" and "Container Manager", if you're using DSM 7.2 and latter, please follow the guide for DSM 7.2, or follow the DSM 6 guide if you're on older system.
{{% children depth="3" showhidden="true" %}}

View File

@ -0,0 +1,75 @@
---
title: Synology DSM 6
weight: 22
---
> An alterative up-to-date tutorial from third-party is [here](https://mariushosting.com/how-to-install-rustdesk-on-your-synology-nas/).
This tutorial is based on latest DSM v6 and v7.
{{% notice note %}}
After DSM 7.2, the Docker is upgraded to new "Container Manager", please check [this article](/docs/self-host/rustdesk-server-oss/synology/dsm-7) instead.
{{% /notice %}}
### Install Docker
| Open Package Center | Install Docker |
| --- | --- |
| ![](/docs/en/self-host/rustdesk-server-oss/synology/images/package-manager.png) | ![](/docs/en/self-host/rustdesk-server-oss/synology/images/docker.png) |
### Install RustDesk Server
| Search rustdesk-server in Docker's registry and install by double click | Installed rustdesk-server image, double click to create rustdesk-server container |
| --- | --- |
| ![](/docs/en/self-host/rustdesk-server-oss/synology/images/pull-rustdesk-server.png) | ![](/docs/en/self-host/rustdesk-server-oss/synology/images/rustdesk-server-installed.png) |
### Create hbbs container
As mentioned above, double click on rustdesk-server image to create new container, set it name to `hbbs`.
![](/docs/en/self-host/rustdesk-server-oss/synology/images/hbbs.png)
Click on above `Advanced Settings`.
- Enable auto-restart
![](/docs/en/self-host/rustdesk-server-oss/synology/images/auto-restart.png)
- Enable `Use the same network as Docker Host`, for more about host net, please [check](https://rustdesk.com/docs/en/self-host/rustdesk-server-oss/docker/#net-host).
![](/docs/en/self-host/rustdesk-server-oss/synology/images/host-net.png)
- Mount a host directory (e.g. `/home/rustdesk/`) to `/root`, hbbs will generate some files (database and `key` files) in this directory which need to be persistent over reboots.
| Mount | Files generated in the host directory |
| --- | --- |
| ![](/docs/en/self-host/rustdesk-server-oss/synology/images/mount.png) | ![](/docs/en/self-host/rustdesk-server-oss/synology/images/mounted-dir.png) |
- Set command
{{% notice note %}}
Synology's OS is Debian based, so host net (--net=host) works fine, we do not need to map ports with `-p` option.
`192.168.16.98` is an internal IP used here for demonstration only, please set it to a public IP when you deploy (or you can use your DDNS address if you have configured one in "Control Panel → Connectivity → DDNS") and don't forget to open ports on your router and your Synology firewall if this is enabled ("Control Panel → Connectivity → Firewall")!
{{% /notice %}}
![](/docs/en/self-host/rustdesk-server-oss/synology/images/hbbs-cmd.png?v2)
- Done
![](/docs/en/self-host/rustdesk-server-oss/synology/images/hbbs-config.png)
### Create hbbr container
Please repeat above `hbbs` steps, but name the container `hbbr` and command (for Set Command Step) should be `hbbr -k _`.
![](/docs/en/self-host/rustdesk-server-oss/synology/images/hbbr-config.png)
### hbbr/hbbs containers
![](/docs/en/self-host/rustdesk-server-oss/synology/images/containers.png)
| Double click on container and check log | Double confirm hbbs/hbbr using host network |
| --- | --- |
| ![](/docs/en/self-host/rustdesk-server-oss/synology/images/log.png) | ![](/docs/en/self-host/rustdesk-server-oss/synology/images/network-types.png) |
### Retrieve your Key
Browse to the folder setup before using File Station, download `id_ed25519.pub` and open with a text editor to via your key.

View File

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 64 KiB

View File

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

View File

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 49 KiB

View File

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 98 KiB

View File

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

View File

@ -0,0 +1,110 @@
---
title: Synology DSM 7.2
weight: 20
---
<!--to translater: When translating elements like "buttons", don't just translate, please refer actual naming in their interface.-->
After DSM 7.2 update, Synology renamed their "Docker" package to "Container Manager", it brings new GUI, and comes with docker-compose within its GUI, which make you create Docker more easily.
## Supported models and requirements
Container Manager brings ARM64 support for some low-end models, such as j series, for detail list of supported model, please check [Synology website](https://www.synology.com/en-us/dsm/packages/ContainerManager).
Most of time you won't need to install extra RAM for install Docker and RustDesk Server.
## 1. Install Container Manager (Docker)
Open "Package Center", search and install "Container Manager".
![](images/dsm7_install_container_manager_though_package_center.png)
## 2. Create folder
After you installed "Container Manager", it will create a Shared Folder called "docker", let's put our server's data here.
Open your File Station, create a folder named `rustdesk-server`(or whatever you like), then create a folder named `data` in it just like the picture.
![](images/dsm7_create_required_folders.png)
## 3. Create container
Open your Container Manager, Goto Project and click Create.
Enter the project name `rustdesk-server` and change Source from "Upload docker-compose.yml" to "Create docker-compose.yml", and copy following contents to the box, after you copyed, you should replace `rustdesk.example.com` (Which point to your `hbbr`) to the domain that will point to your NAS.
{{% notice note %}}
You could modify the line with `hbbs` to your NAS's LAN IP temporarily just like the picture, after you verify your server is working, you **should** change back.
{{% /notice %}}
![](images/dsm7_creating_project_init.png)
````yaml
version: '3'
services:
hbbs:
container_name: hbbs
image: rustdesk/rustdesk-server:latest
command: hbbs -r rustdesk.example.com:21117 -k _
volumes:
- ./data:/root
network_mode: host
depends_on:
- hbbr
restart: always
hbbr:
container_name: hbbr
image: rustdesk/rustdesk-server:latest
command: hbbr -k _
volumes:
- ./data:/root
network_mode: host
restart: always
# Because using docker host mode
# Just in case you forgot the ports:
# 21115 TCP For NAT type test
# 21116 TCP TCP hole punching
# 21116 UDP Heartbeat/ID server
# 21117 TCP Relay
````
Please skip `Web portal settings` then done.
## 4. Check it is working
Open your File Station, you should see `id_ed25519`, `id_ed25519.pub` on your `docker/rustdesk-server/data` folder, you could download it and open it though any text editor or use [Synology TextEditor](https://www.synology.com/en-us/dsm/packages/TextEditor), this is the public key that you need for your RustDesk client.
The public key will looks like this:
![](images/dsm7_viewing_public_key_though_syno_text_editor.png)
Check [here](/docs/en/self-host/rustdesk-server-oss/install/#step-3-set-hbbshbbr-address-on-client-side) to setup your client, only `ID Server` and `key` is needed, relay isn't needed because we've set it in `hbbs`, hbbs will provide this information automatically.
## 5. Set your hbbs to point to your domain
If you have set your `hbbs` command to point to your LAN IP, and verified it is working, it is time to change to the domain, because it will not working if you using it outside your LAN.
<hr>
5.1 Goto Container Manager > Project > Click "rustdesk-server" > Action > Stop
5.2 After stopped, click "YAML Configurations", modify the line start with `command: hbbs` to your domain, then click "Save", make sure you choose "Build and start the project (rebuild the image)"
![](images/dsm7_recreate_project_after_modified_args.png)
5.3 Your RustDesk Server should ready for connections from the Internet, next, you should setup port forwarding.
{{% notice note %}}
Having problem after you done this step? You should check [this article](/docs/en/self-host/nat-loopback-issues/).
{{% /notice %}}
## 6. Set port forwarding on your router
Go to your router's admin webpage, find anything related to `Port forwarding`, it should appear in `WAN` or `Firewall` settings.
If you still can't find the setting, Google search `{Router brand} + port forwarding` or `{Router model} + port forwarding`, if this device is from your ISP, ask them.
Open these required ports:
* `21115` `TCP` For NAT type test
* `21116` `TCP` TCP hole punching
* `21116` `UDP` Heartbeat/ID server
* `21117` `TCP` Relay

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 322 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB