Welcome aboard!
Always exploring, always improving.

RustDesk Remote Desktop – 9 Incredible Hacks to Build a Blazing‑Fast Self‑Hosted Server


RustDesk Remote Desktop saved my bacon last winter when our paid tool went into “commercial use detected” lockdown right as I needed to rescue a client’s frozen CAD workstation. One coffee‑fueled hour later I had my own RustDesk Remote Desktop server humming on a cheap VPS, latency under 30 ms, and a very happy customer. Today I’m gonna show you exactly how to do the same—plus eight more tricks to make your setup rock‑solid.

1. Why Choose RustDesk Remote Desktop

The open‑source RustDesk Remote Desktop stack delivers end‑to‑end encryption, zero license fees, and total data ownership. You keep the keys, the logs, and the bandwidth. The codebase is split into lean Rust crates—libs/ clipboard for copy‑paste, libs/enigo for synthetic input, and libs/scrap for pixel capture—a model of modular clarity.

  • Self‑hosting means no third‑party relay snooping your packets.
  • Rust‑powered safety gives memory‑safe performance on par with C++ tools.
  • Cross‑platform clients run on Windows, macOS, Linux, iOS, and Android.
  • Cost‑killer: axe that recurring bill from TeamViewer or ToDesk.

2. Architecture Deep‑Dive of hbbs & hbbr

The magic hinges on two daemons:

Binary Role Default Ports
hbbs ID / Rendezvous server TCP 21114‑21116, UDP 21116
hbbr Relay server (fallback) TCP 21117‑21119

Clients register with hbbs, attempt NAT hole‑punching, and only drop back to hbbr when direct peer‑to‑peer fails.

RustDesk Server Diagram

3. One‑Click & Package Installs

If you just want to try RustDesk Remote Desktop fast, download the latest binaries from GitHub Releases and run:

# Linux quick start
curl -LO https://github.com/rustdesk/rustdesk/releases/latest/download/rustdesk-1.2.3-x86_64.deb
sudo dpkg -i rustdesk-1.2.3-x86_64.deb
rustdesk

Windows and macOS users get signed installers; mobile clients live in the App Store and Play Store.

4. Compiling from Source (Ubuntu Example)

# Pre‑reqs
sudo apt update
sudo apt install -y zip g++ gcc git curl wget nasm yasm libgtk-3-dev clang \
    libxcb-randr0-dev libxfixes-dev libxcb-shape0-dev libxcb-xfixes0-dev \
    libasound2-dev libpulse-dev cmake make libclang-dev ninja-build \
    libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libpam0g-dev

# vcpkg for media deps
git clone https://github.com/microsoft/vcpkg ~/vcpkg
cd ~/vcpkg && git checkout 2023.04.15 && ./bootstrap-vcpkg.sh
export VCPKG_ROOT=$HOME/vcpkg
vcpkg/vcpkg install libvpx libyuv opus aom

# Build & run
git clone https://github.com/rustdesk/rustdesk.git
cd rustdesk && cargo run --release

Voilà—your very own RustDesk Remote Desktop build.

5. Docker‑Compose Deployment

Prefer containers? Whip up docker-compose.yaml:

version: "3"
services:
  hbbs:
    image: rustdesk/rustdesk-server
    command: hbbs
    restart: unless-stopped
    ports:
      - "21115:21115"
      - "21116:21116"
      - "21116:21116/udp"
    volumes:
      - ./hbbs:/root
  hbbr:
    image: rustdesk/rustdesk-server
    command: hbbr
    restart: unless-stopped
    ports:
      - "21117:21117"
volumes: {}
docker compose up -d

The first launch spits out a public key inside hbbs/id_ed25519.pub; paste it into every client’s Network → ID Server field.

6. Server Hardening & Firewall Rules

Open only the essentials:

  • 21114 TCP – optional web console (Pro)
  • 21115 TCP – NAT type probe
  • 21116 TCP/UDP – heartbeat and TCP relay
  • 21117 TCP – relay data (hbbr)

Block 21118‑21119 unless you need Web clients. Toss in ufw rules:

ufw allow 21115/tcp
ufw allow 21116
ufw allow 21117/tcp
ufw enable

7. Client Configuration Walk‑through

  1. Install the GUI client and open Settings → Network.
  2. Unlock with your password and punch in:
    • ID Server: Your VPS IP
    • Relay Server: leave blank unless hbbr is on a separate host
    • Key: contents of id_ed25519.pub
  3. Repeat on every device. Done—RustDesk Remote Desktop will remember.

8. Performance Tweaks & Benchmarks

On a bargain 2 vCPU / 2 GB RAM VPS I clock RustDesk Remote Desktop latency around 28‑32 ms with 3 MB bandwidth, beating my old TeamViewer readings by 40 %. Tweak:

  • --quality 90 flag for crisper video on LAN.
  • Enable H.265 in Settings → Display if both ends support it.
  • Set Frame Rate to 30 FPS for CAD or gaming sessions.

9. Advanced Hacks & Integrations

These extra‑credit moves turn RustDesk Remote Desktop into a mini‑RMM:

SSH Proxy‑Jump
Tunnel ssh -J user@relay host through hbbs for command‑line rescue.
File‑Drop Automation
Use the built‑in SFTP API to sync logs during sessions.
Webhook Auditing
Forward connection events to Grafana Loki for compliance.
Ansible Provisioning
Invoke ansible-pull over Relay to bootstrap new edge devices the moment they come online.

Need more hardcore DevOps goodness? Check out our guide to Dangerous DevOps Practices and pair it with the Server Maintenance Checklist to keep your remote stack indestructible.

10. TeamViewer vs ToDesk vs RustDesk Remote Desktop

Feature TeamViewer ToDesk RustDesk Remote Desktop
License Cost $49 +/mo Free (fair use) Free & Open Source
Self‑Hosted Server No No Yes
End‑to‑End Encryption Yes Partial Yes (NaCl)
File‑Transfer Speed Good Average Excellent
Mobile Control iOS/Android iOS/Android iOS/Android

11. FAQ

Q: Is RustDesk Remote Desktop safe for production?
A: Yes—NaCl encryption and self‑hosting put you in charge. Add 2FA for logins and rotate your relay keys quarterly.

Q: Can I brand the client?
A: Absolutely. Recompile with custom icons and set CARGO_CFG_BRAND.

Q: Does it work without hbbr?
A: In most NAT‑friendly environments, hole‑punching via hbbs is enough. hbbr simply guarantees a path when symmetric firewalls block P2P.

RustDesk-Remote-Desktop-Console

12. Final Thoughts

Kick expensive subscriptions to the curb—RustDesk Remote Desktop hands you the keys to a lightning‑fast, totally private remote‑control universe. Follow these nine hacks, keep your server patched, and you’ll wonder why you ever paid for remote access in the first place.

References:
RustDesk on GitHub,
TechRadar – Best Remote Desktop Software

Like(0) Support the Author
Reproduction without permission is prohibited.FoxDoo Technology » RustDesk Remote Desktop – 9 Incredible Hacks to Build a Blazing‑Fast Self‑Hosted Server

If you find this article helpful, please support the author.

Sign In

Forgot Password

Sign Up