Deploy your own private RustDesk relay & ID server using Docker on Ubuntu 22.04 or 24.04 — fully automated with a single script.
Grab the automated bash script from GitHub to follow along with the video.
wget https://raw.githubusercontent.com/mhmdali94/Docker/main/remote-access/rustdesk/rustdesk-ubuntu.sh
chmod +x rustdesk-ubuntu.sh
sudo bash rustdesk-ubuntu.sh
Make sure you have Ubuntu 22.04 or 24.04 with root/sudo access. The following firewall ports must be open:
| Port | Protocol | Purpose |
|---|---|---|
| 21115 | TCP | NAT type test |
| 21116 | TCP + UDP | ID service & hole punching |
| 21117 | TCP | Relay service (hbbr) |
| 21118 | TCP | Web client support |
| 21119 | TCP | Relay web client support |
Download the automated installer using wget:
wget https://raw.githubusercontent.com/mhmdali94/Docker/main/remote-access/rustdesk/rustdesk-ubuntu.sh
chmod +x rustdesk-ubuntu.sh
The script will check for Docker, clean up any previous installation, generate a fresh docker-compose.yml, and start the containers automatically.
sudo bash rustdesk-ubuntu.sh
The script auto-detects your public WAN IP. Press Enter to accept it, or type a custom domain/IP:
Enter your domain or IP address [203.0.113.10]:
In your RustDesk client app, go to Settings → Network and set:
ID Server: your-server-ip:21116
Relay Server: your-server-ip:21117
API Server: http://your-server-ip:21114
/root/docker/rustdesk/docker-compose.yml