repobenchmarks // remote infrastructure
DEVOPS
$ docker compose up -d hbbs hbbr

RustDesk Self-Hosted Relay

A complete open-source replacement for TeamViewer and AnyDesk that routes encrypted remote desktop traffic through your own self-hosted VPS.

Components: hbbs (Signal) & hbbr (Relay) Encryption: Ed25519 Public Key Stars: >75,000
Operator Client App Your VPS hbbs (Signal) hbbr (Relay)

Commercial remote desktop tools like TeamViewer and AnyDesk have become increasingly frustrating for independent developers and tech support specialists: aggressive commercial-use timeouts, high subscription pricing, and concerns over remote screen data routing through third-party proprietary clouds. RustDesk offers a high-performance, open-source alternative written in Rust. You can self-host your own rendezvous and relay servers on a modest \$4/month VPS, ensuring unlimited connection times and complete privacy.

How the RustDesk Server Architecture Works

  • Rendezvous / Signal Server (hbbs): Listens for incoming client registrations, facilitates NAT traversal (STUN/P2P hole-punching), and validates cryptographic public keys.
  • Relay Server (hbbr): If both peers are behind strict symmetrical NAT firewalls and cannot establish a direct peer-to-peer connection, hbbr relays the encrypted video and input streams between them.
  • End-to-End Cryptography: When you start the server, RustDesk generates an Ed25519 keypair. Clients configured with your public key refuse to connect to unauthorized third-party relay nodes.

RustDesk Direct P2P vs Relay Fallback

RustDesk P2P Connection vs Relay Fallback Shows rendezvous handshake at hbbs followed by direct peer-to-peer streaming or fallback through hbbr relay. Local Laptop Client A Direct P2P Encrypted Stream (Low Latency) Remote Workstation Client B hbbr Relay (Fallback if NAT Strict)

Docker Compose Server Deployment

services:
  hbbs:
    image: rustdesk/rustdesk-server:latest
    container_name: hbbs
    command: hbbs -r relay.yourdomain.com:21117 -k _
    volumes:
      - ./data:/root
    network_mode: host
    restart: unless-stopped

  hbbr:
    image: rustdesk/rustdesk-server:latest
    container_name: hbbr
    command: hbbr -k _
    volumes:
      - ./data:/root
    network_mode: host
    restart: unless-stopped

RustDesk vs Proprietary Alternatives

Feature RustDesk (Self-Hosted) TeamViewer AnyDesk
Pricing / Limitations 100% Free & Unlimited Strict commercial timeouts Paid monthly subscriptions
Server Control Your private VPS / Hardware Proprietary corporate cloud Proprietary corporate cloud
Client Customization Packaged with custom keys/host High-tier enterprise feature High-tier enterprise feature
⚠ Firewall Port Gotcha: Required TCP/UDP Ports

RustDesk requires several ports open on your VPS firewall (UFW/iptables). Specifically: TCP 21115-21119 and UDP 21116. Port 21116/udp is mandatory for initial NAT discovery and hole-punching; if UDP 21116 is blocked, clients will always fail to initiate direct connections and will struggle to register with the signal server.

For official client downloads and setup instructions, visit rustdesk.com or the open-source RustDesk repository.