In this tutorial, weβll walk through deploying your own RustDesk server using Docker, with a secure NGINX reverse proxy on another VM. This setup mimics tools like Bomgar or TeamViewer for remote support, using your own domain: remote.yourdomain.com
.
remote.yourdomain.com
)Create a project folder for RustDesk:
mkdir -p ~/rustdesk && cd ~/rustdesk
Create a Docker Compose file:
nano docker-compose.yml
Paste the following:
version: '3.8'
services:
rustdesk-hbbs:
image: rustdesk/rustdesk-server:latest
container_name: rustdesk-hbbs
restart: unless-stopped
command: hbbs -r rustdesk-hbbr:21117
ports:
- "21115:21115"
- "21116:21116"
- "21116:21116/udp"
volumes:
- ./data:/root
environment:
- ENCRYPTED_ONLY=1
rustdesk-hbbr:
image: rustdesk/rustdesk-server:latest
container_name: rustdesk-hbbr
restart: unless-stopped
command: hbbr
ports:
- "21117:21117"
volumes:
- ./data:/root
environment:
- ENCRYPTED_ONLY=1
Start the containers:
docker compose up -d
Log into your DNS provider and point an A record to your NGINX reverse proxy VM:
remote.yourdomain.com β [Public IP of reverse proxy VM]
Install NGINX and Certbot if not already done:
sudo apt update
sudo apt install nginx certbot python3-certbot-nginx
Create a new NGINX site config:
sudo nano /etc/nginx/sites-available/rustdesk
Paste:
server {
listen 80;
server_name remote.yourdomain.com;
location / {
proxy_pass http://[RUSTDESK-INTERNAL-IP]:21115;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
Replace [RUSTDESK-INTERNAL-IP]
with the private IP of your Docker VM.
Enable the site:
sudo ln -s /etc/nginx/sites-available/rustdesk /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
Request a Letβs Encrypt SSL certificate:
sudo certbot --nginx -d remote.yourdomain.com
Follow the prompts and choose the redirect option for HTTPS.
After the containers start, get your RustDesk public key (used for secure connections):
cat ~/rustdesk/data/id_ed25519.pub
https://remote.yourdomain.com
β you should see a 404 or blank response (this is expected β the API is not for browsers).remote.yourdomain.com
21115
To offer a branded, no-setup client like Bomgar:
.exe
or .pkg
to clients for instant support with no configuration needed.With this setup, you're no longer dependent on 3rd-party cloud relays. You're in full control of your remote support infrastructure, ready to serve clients securely and reliably.