
Nothing ends a remote-support session faster than a pop-up accusing you of "commercial use." That exact frustration is why a large slice of the self-hosting community — Chinese developers included — standardized on RustDesk: an open-source remote desktop that works out of the box through a public rendezvous server, but also lets you run the entire backend yourself on a five-dollar VPS. When you self-host, your screen pixels never touch a vendor's relay. Here's what the moving parts are and how to deploy them.
RustDesk is a remote access and remote control tool written in Rust, developed by Purslane Ltd. and released under AGPL-3.0-or-later. The desktop and mobile clients have been Flutter-based since version 1.2.0 (2023). It aims to be an open-source TeamViewer alternative: it connects across Windows, macOS, Linux, Android, and iOS, supports end-to-end encryption, and — the detail that made it famous — works without VPNs or port forwarding, even behind firewalls and NATs.
Why do Chinese developers care about it disproportionately? Remote access is a daily tool in China's dev culture — maintaining parents' PCs, reaching into office machines, managing homelab racks — and RustDesk ships a full Chinese-language interface and documentation (README-ZH.md is in the official repo). It is a fixture of Chinese self-hosting discussion precisely because it solves the "TeamViewer flagged my account" problem with infrastructure you control.
Most people only ever install the client, which uses RustDesk's public rendezvous and relay servers by default. Self-hosting means replacing both of those with two small binaries:
| Component | Role | What it does |
|---|---|---|
| hbbs | ID / rendezvous server | Registers device IDs, helps clients discover each other, attempts direct P2P connections |
| hbbr | Relay server | Forwards encrypted traffic only when a direct connection can't be established |
The flow is simple: two clients ask hbbs to introduce them, they try a direct connection first (TCP hole punching), and if that fails, encrypted traffic flows through hbbr. The relay never sees plaintext — sessions are end-to-end encrypted regardless of who operates the server.
The official Docker documentation lists these ports, and getting them right is the single most common self-hosting stumbling block:
| Port | Protocol | Owner | Purpose |
|---|---|---|---|
| 21114 | TCP | hbbs | Web console — Pro version only |
| 21115 | TCP | hbbs | NAT type test |
| 21116 | TCP + UDP | hbbs | ID registration and heartbeat (UDP); hole punching and connection service (TCP) |
| 21117 | TCP | hbbr | Relay service |
| 21118 | TCP | hbbs | Web clients (optional) |
| 21119 | TCP | hbbr | Web clients (optional) |
Two details matter: 21116 must be open for both TCP and UDP, and 21118/21119 are only needed if you use the web client — otherwise keep them closed. The docs also carry a sharp warning: if you do expose the web-client ports, put them behind a reverse proxy, because hbbs/hbbr trust X-Real-IP / X-Forwarded-For headers on WebSocket connections and anyone reaching those ports directly can spoof IPs in your logs.
The documented way to run it is one Docker image with two commands. On a Linux VPS (minimum requirements are famously low — roughly 1 CPU core, 1 GB RAM, a couple of GB of disk, per community guides), the official setup recommends host networking so the server sees clients' real IP addresses:
services:
hbbs:
container_name: hbbs
image: rustdesk/rustdesk-server:latest
command: hbbs
volumes:
- ./data:/root
network_mode: "host"
depends_on:
- hbbr
restart: unless-stopped
hbbr:
container_name: hbbr
image: rustdesk/rustdesk-server:latest
command: hbbr
volumes:
- ./data:/root
network_mode: "host"
restart: unless-stopped
Start it with docker compose up -d. On first launch the server generates an Ed25519 key pair; pull the public key from the container:
docker logs hbbs 2>&1 | grep "Public Key"
# or
cat data/id_ed25519.pub
That public key is the linchpin of the whole setup — clients use it to verify they're talking to your server and not an impostor. Keep the private half (id_ed25519) private; the data/ directory is the only state you need to back up.
In each RustDesk client, open the menu next to your device ID, go to Settings → Network → ID/Relay Server, and fill in your server's address as the ID server plus the public key you just retrieved. The relay field can stay blank — hbbs advertises the relay address to clients automatically. When the status dot next to your ID turns green, you're registered with your own infrastructure.
One platform caveat worth knowing before you promise anything: on iOS, RustDesk can only control other devices — Apple restrictions block remote control of the iPhone/iPad itself, per community setup guides.
Server OSS covers everything a homelab or small team needs: ID registration, relaying, end-to-end encryption, file transfer, clipboard sync, multi-monitor, Wake-on-LAN. There is no device cap and no per-user license. Community analysis consistently lands in the same place: for personal use, the free tier is the whole product.
Pro is a commercial add-on for the self-hosted backend — RustDesk's pricing page lists the self-hosted Individual Pro plan at $11.88/month on annual billing. What you rent is administration: a web console, user and group management, address book sync, audit logs, OIDC/SSO, and API access. If you manage remote access for an IT helpdesk or a team where you need to know who connected to what, that's the feature set that justifies it. For connecting to machines you already know, it's a convenience, not a necessity.
| Server OSS | Server Pro | |
|---|---|---|
| Cost | $0 | from ~$11.88/mo (annual, self-hosted) |
| Core remote desktop + relay | Yes | Yes |
| Web console / user management | No | Yes |
| SSO, audit logs, API | No | Yes |
| End-to-end encryption | Yes | Yes |
Self-hosting shifts responsibility to you: updates, key backups, firewall rules, and uptime are yours now. A public server you don't maintain is worse than RustDesk's public one. Also, if your threat model includes a sophisticated network adversary, remember the relay only ever forwards ciphertext — but your hbbs server does learn which device IDs talk to each other. That's inherent to any rendezvous design, not a RustDesk flaw.
For readers assembling a fuller remote-access picture — how RustDesk compares with Tailscale-based RDP or plain SSH in daily Chinese dev workflows — see our earlier walkthrough of remote desktop stacks Chinese developers actually run. And if you don't have a VPS yet for the server side, the cheap-VPS hunting guide covers what to look for.
The bottom line: RustDesk is the rare open-source tool where self-hosting is a first-class, documented, weekend-afternoon operation — not an enterprise upsell. Run your own rendezvous server, keep the keys, and the "commercial use detected" pop-up becomes someone else's problem.