Docker deploys RustDesk Server and sets it to start automatically

3. Docker installation

Docker official and domestic daocloud both provide one-click installation scripts, making Docker installation more convenient.

The official one-click installation method:

curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun

Domestic daocloud one-key installation command:

curl -sSL https://get.daocloud.io/docker | sh

Execute any of the above commands and wait patiently to complete the Docker installation.

3. Docker start

Command to start Docker:

sudo systemctl start docker


4. Install RustDest-Server

Command to pull rustdesk-server:

docker pull rustdesk/rustdesk-server:latest

sudo docker run --name hbbs -p 21115:21115 -p 21116:21116 -p 21116:21116/udp -p 21118:21118 -v `pwd`:/root -td --net=host rustdesk/rustdesk-server hbbs -r ip -k_
sudo docker run --name hbbr -p 21117:21117 -p 21119:21119 -v `pwd`:/root -td --net=host rustdesk/rustdesk-server hbbr -k_

Run the hbbs command: (replace the external network IP with the external network IP of your own cloud server)

Suffix -k_ to force enable authentication

besides 

-k _ Author: Weijun Modeling https://www.bilibili.com/read/cv24660787?from=search&spm_id_from=333.337.0.0 Source: bilibili

docker run --name hbbs -p 21115:21115 -p 21116:21116 -p 21116:21116/udp -p 21118:21118 -v `pwd`:/root -td --net=host docker.io/rustdesk/rustdesk-server:latest hbbs -r 外网IP:21117

 

1. `pwd` represents the reference to the current directory.

2. The network error caused by –net=host (the official document also emphasizes that it will be  --net=host deleted) 

This is the docker command indicating that -p does not work and can be removed

3. The meaning of <relay-server-ip[:port]> means: 当前服务器的外网IP:指定的端口号; The port number can be omitted.

You can not write the port number, there is another  

I don’t know where the download path of his installation package comes from for such a command. Just write pwd directly.

sudo docker run --name hbbs -p 21115:21115 -p 21116:21116 -p 21116:21116/udp -p 21118:21118 -v [Download path of the second installation package]:/root -td rustdesk/rustdesk- server hbbs -r [your domain name or public IP]

Author: Request hand-brain collaboration https://www.bilibili.com/read/cv25702513 Source: bilibili

Run the hbbr command

docker run --name hbbr -p 21117:21117 -p 21119:21119 -v `pwd`:/root -td --net=host docker.io/rustdesk/rustdesk-server:latest hbbr

I don’t know where the download path of the installation package for the second part comes from. Let’s just write pwd.+

sudo docker run --name hbbr -p 21117:21117 -p 21119:21119 -v [Download path of the second step installation package]:/root -td rustdesk/rustdesk-server hbbr

Author: Request hand-brain collaboration https://www.bilibili.com/read/cv25702513 Source: bilibili

After the second part is executed, a key will be given, it is useful to write it down

Fill in the software

View all docker containers

docker ps -a


4. View the public key (in fact, the key after running hbbr is fine)

Cloud server command line interface, find the current rustdesk running directory


Among them, id_ed25519.pub is the public key, use the cat command to view,

cat id_ed25519.pub
5. Each RustDesk client fills in the corresponding ID server and public key

This should not need to be taught, mobile terminal and PC terminal

Additional configuration:

Docker starts automatically at boot

systemctl enable docker


Container restarts automatically

docker update --restart=always /hbbs
docker update --restart=always /hbbr
————————————————

Problem 2: The software starts successfully, but the software cannot be connected, and it displays "not ready, please check the network connection"


required port

The usage of TCP (21115, 21116, 21117, 21118, 21119)
UDP (21116)
ports is clearly written in the official document. If the web client (21118, 21119) support is not required, the corresponding port can not be opened.
1. Check whether the firewall is enabled

If systemctl status firewalld
# or
firewall-cmd --state
is enabled, there are two solutions:

#============================================= ① Directly close === ========================================
systemctl stop firewalld.service
#======= ====================================================================================================================================================================================================================================================================== ===============================
#Open port tcp transmission limit (--permanent takes effect permanently, without this parameter, it will fail after restarting, 21115-21119 batch open port TCP transmission in the interval)
firewall-cmd --zone=public --add-port=21115-21119/tcp --permanent 
#Open port udp transmission limit
firewall-cmd --zone=public - -add-port=21116/udp --permanent 
#Reload the firewall configuration
firewall-cmd --reload

Copyright statement: This article is an original article of CSDN blogger "cocokuaqsw", following the CC 4.0 BY-SA copyright agreement, please attach the original source link and this statement for reprinting.
Original link: https://blog.csdn.net/cocokuaqsw/article/details/129400337

Guess you like

Origin blog.csdn.net/linsenaa/article/details/132597488
Recommended