What is RustDesk
RustDesk is a free and open-source remote desktop application that supports multiple platforms such as Windows, macOS, Linux, iOS, and Android. RustDesk is an analogue of Windows Remote Desktop, Anydesk, Teamviewer. RuskDesk offers a very simple installation, you need to download the client from the official website and run it, you’ll get an ID and use it to connect to another device to the AnyDesk program.
RustDesk includes easy management, secure end-to-end encryption, and simple setup without complex configurations. RustDesk also includes features such as file transfer and a user-friendly interface, making it ideal for both personal and professional use.
By default, all connections are made through the centralized server of the RustDesk. For security of software operation and access, you can install your own Rust Relay server and configure the operation of Rust clients through it. Below we will tell you how to install a server and configure one client as an example.
How to install RustDesk
Installing RustDesk is quite simple, we only need to run a couple of commands.
First you have to open ports if a firewall is used
ufw allow 21114:21119/tcp
ufw allow 8000/tcp
ufw allow 21116/udp
Now we run the following commands, one after another in terminal
wget https://raw.githubusercontent.com/techahold/rustdeskinstall/master/install.sh
chmod +x install.sh
./install.sh
If you do not have IPv6 configured and the script cannot be downloaded, you can disable it temporarily, after rebooting the server it will be enabled again. We can do this using the command
sysctl -w net.ipv6.conf.all.disable_ipv6=1
The process itself should look exactly like this. After executing the commands, we must choose how we want to connect through our server, domain or IP. We will choose IP.

After that, in the second step, we select that we want to deploy a web server on which we can log in and download scripts for installing RustDeskt on Windows and Linux.

After the installation is done, we will receive data, or rather login and password for the RustDesk web panel and key.

Follow the link as indicated in the terminal
http://IP-addres:8000
When entering the link, we indicate the data that we received and go to the web panel.

Unfortunately, it is not possible to upload important files that you often need when working when you are connected remotely, but perhaps such an option will be available in the future.
How to set up a RustDesk relay server on a PC
Now that we have come to the end, it is important to understand why we did this.
There is a possibility that public relay servers will be overloaded and your connection to another device will be unstable or not available. Your own relay server is a way out of this situation and an addition to the security of data transmission as you connect to the server to which you have access.
First, download RustDesk, install it and run it.

Click on settings and a new window will open.
Then click on Network, and then click on the blue button Unblock network settings.

Now click on ID/Relay server and a new window will open.

In the new window we specify the IP of the server, in the Relay field we also specify the IP of the server and in the last field we need to enter the key that we received in the terminal. This will be enough, as the API field remains empty.

That’s all, now you should configure the other RustDesk client exactly the same way, so that both yours devices are connected via your relay, and not via public ones.
Thank you for reading this manual to the end, we hope that it was very useful for you!