Timeline

2025-03-14

  1. init

After using ToDesk for a few days, since it was not shut down(I prefer to leaving the computer open), the free quota was used up in the middle of the month, and I could no longer continue using it for free. I uninstalled it and switched to RustDesk, it really astonished me, using Self-host, which is free and offers much higher frame rates and resolution than ToDesk’s free version. Below is the setup log.

Basic Environment Setup

I am using two Windows (win10) and one Ubuntu (with the configuration shown below). The Ubuntu server acts as the ID/relay server, allowing one Windows machine to connect to another. Ubuntu needs Docker installed, and both Windows machines need to install RustDesk and perform some configuration.

My three machines are all in the same local area network (LAN)

Hardware Environment

Installing Docker and Docker Compose Plugin

Reference:


Once installation is complete, add the current user to the Docker group:
1
2
3
4
5
6
7
# Add docker user group, it should already exist
sudo groupadd docker
# Add the current user to the docker group
sudo gpasswd -a $USER docker
# Update the user group
newgrp docker
docker version

docker-compose.yaml

Reference the official documentation:

If you have ufw enabled, you need to open these ports:

1
2
3
4
sudo ufw status
sudo ufw allow 21114:21119/tcp
sudo ufw allow 8000/tcp
sudo ufw allow 21116/udp

Choose a directory to store the ID/relay server data:
1
2
3
mkdir -p ~/rustdesk
cd ~/rustdesk
touch docker-compose.yaml

Here is the docker-compose.yaml file from the official RustDesk documentation:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
services:
hbbs:
container_name: hbbs
image: rustdesk/rustdesk-server:latest
command: hbbs
volumes:
- ./data:/root
network_mode: "host"

depends_on:
- hbbr
restart: unless-stopped

hbbr:
container_name: hbbr
image: rustdesk/rustdesk-server:latest
command: hbbr
volumes:
- ./data:/root
network_mode: "host"
restart: unless-stopped

Then start it.
1
2
3
4
5
docker compose up -d
# Go to ~/rustdesk/data directory
cd data
# View the key
cat id_*.pub

Installing and Configuring RustDesk

Installation reference:


After installation, open the network settings and enter the IP address of the ID/relay server, which is the server running Docker. The controlled machine does not need to enter the relay server, but it’s recommended for the controlling machine to do so. Then, the controlling machine should enter the key (the contents of the .pub file in the data folder above).

windows rustdesk network configuration

Finally, enter the controlled machine’s ID and password to connect.