RustDesk中继服务器Docker部署
yaoye Lv5

RustDesk中继服务器Docker部署

使用 docker-compose.yml 部署服务器

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
networks:
rustdesk-net:
external: false

services:
hbbs:
container_name: hbbs
ports:
- 21115:21115
- 21116:21116 # 自定义 hbbs 映射端口
- 21116:21116/udp # 自定义 hbbs 映射端口
image: rustdesk/rustdesk-server
command: hbbs -r 服务器IP:21117 -k 自定义通信密钥
volumes:
- /root/docker/rustdesk/root:/root # 自定义挂载目录
networks:
- rustdesk-net
depends_on:
- hbbr
restart: unless-stopped
deploy:
resources:
limits:
memory: 64M

hbbr:
container_name: hbbr
ports:
- 21117:21117 # 自定义 hbbr 映射端口
image: rustdesk/rustdesk-server
command: hbbr -k 自定义通信密钥
volumes:
- /root/docker/rustdesk/root:/root # 自定义挂载目录
networks:
- rustdesk-net
restart: unless-stopped
deploy:
resources:
limits:
memory: 64M

rustdesk-api-server:
container_name: rustdesk-api-server
image: kingmo888/rustdesk-api-server:latest
environment:
- CSRF_TRUSTED_ORIGINS=http://服务器IP:21114 #防跨域信任来源,可选
- ID_SERVER=服务器IP:21114 #Web控制端使用的ID服务器
volumes:
- /root/docker/rustdesk/db:/rustdesk-api-server/db #修改为你宿主机数据库挂载目录
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
#network_mode: bridge
networks:
- rustdesk-net
ports:
- "21114:21114"
restart: unless-stopped

运行

1
docker-compose up -d

开放服务器对应端口

21114-21117 TCP

21116 UDP

配置 Rustdesk 客户端

设置点击网络后以管理员命令点击解锁网络设置

ID服务器和中继服务器:服务器实际IP地址

api 服务器放空

Key :自定义通信密钥