🖥️ Setup RustDesk Self-Hosted Server on Ubuntu

Deploy your own private RustDesk relay & ID server using Docker on Ubuntu 22.04 or 24.04 — fully automated with a single script.

⚠️ This script is provided for demo and testing purposes only. Not intended for production use.

📦 Resources & Setup Scripts

Grab the automated bash script from GitHub to follow along with the video.

Automated install script — one command sets everything up.
View on GitHub

Quick Install:

wget https://raw.githubusercontent.com/mhmdali94/Docker/main/remote-access/rustdesk/rustdesk-ubuntu.sh
chmod +x rustdesk-ubuntu.sh
sudo bash rustdesk-ubuntu.sh

Tutorial Steps

1 Prerequisites

Make sure you have Ubuntu 22.04 or 24.04 with root/sudo access. The following firewall ports must be open:

PortProtocolPurpose
21115TCPNAT type test
21116TCP + UDPID service & hole punching
21117TCPRelay service (hbbr)
21118TCPWeb client support
21119TCPRelay web client support

2 Download the Script

Download the automated installer using wget:

wget https://raw.githubusercontent.com/mhmdali94/Docker/main/remote-access/rustdesk/rustdesk-ubuntu.sh

3 Make it Executable

chmod +x rustdesk-ubuntu.sh

4 Run the Installer

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

5 Enter Your Server IP or Domain

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]:

6 Configure Your RustDesk Client

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

Files Location

/root/docker/rustdesk/docker-compose.yml