RustDesk Remote Desktop Self-Hosted Server
Timeline
2025-03-14
- 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)
Installing Docker and Docker Compose Plugin
Reference:
Once installation is complete, add the current user to the Docker group:
1 | # Add docker user group, it should already exist |
docker-compose.yaml
Reference the official documentation:
If you have ufw enabled, you need to open these ports:1
2
3
4sudo 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
3mkdir -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
21services:
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
5docker 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).
Finally, enter the controlled machine’s ID and password to connect.