Hey everyone,
I’ve been using RustDesk lately as an awesome open-source alternative to TeamViewer and AnyDesk. I wanted to self-host the relay server to keep all my remote desktop traffic completely private, but I noticed there wasn’t a straightforward way to just run it as an App in Home Assistant. So, I put one together!
I figured others in the community might find this useful, so I’m sharing it here. No subscriptions, no relying on third-party public relay servers — your traffic never leaves your own infra.
GitHub: SankeerthBoddu/ha-rustdesk-server
How it works
The app bundles both of the RustDesk server components you need behind the scenes:
-
hbbs — the ID / rendezvous server (this handles discovery and NAT hole-punching)
-
hbbr — the relay server (this carries the network traffic when direct P2P fails)
Once the app is running, you just point your RustDesk clients (Windows, Mac, Linux, Android, iOS) to your Home Assistant IP or domain, and you’ve got a fully private remote desktop setup. Full encryption is enforced by default so unkeyed clients get rejected.
How to set it up
-
Click the Add Repository badge above (or manually add
https://github.com/sankeerthboddu/ha-rustdesk-serverto your App store). -
Install RustDesk Server and hit Start.
-
Click over to the Log tab — it automatically generates your encryption keys on the very first boot. Copy the Key it spits out.
-
On every device you’re using with RustDesk (both the one you are sitting at AND the ones you want to control), go into Settings → Network → ID Server and enter:
-
ID Server: your HA domain or IP (e.g.,
myhome.duckdns.orgor192.168.1.100) -
Key: paste the key you copied from the logs
Tip: You have to configure the ID Server and Key on both sides for this to work. When it connects successfully, the bottom status bar in the app turns green and says “Ready”.
A quick note on Networking
Since RustDesk uses raw TCP/UDP streams (it’s not HTTP data), your network setup is pretty important. Here are the most common ways to get it working outside your home network:
The simple way (DuckDNS / Direct IP)
If you use DuckDNS or anything that points straight back to your home IP, just port forward 21115 (TCP), 21116 (TCP & UDP), and 21117 (TCP) on your router pointing to your Home Assistant instance. Then use your DuckDNS hostname as the ID Server in the app.
Using Cloudflare?
If you’re using Cloudflare for your domain, you can’t use the proxy (Orange Cloud) because standard HTTP proxies will block the traffic. You have to set the DNS record to DNS Only (Grey Cloud).
Nginx Proxy Manager (NPM)
You can’t just use standard Proxy Hosts in NPM. You have to use the Streams tab feature to port forward the raw streams correctly:
-
21115 TCP →
<HA_IP>:21115 -
21116 TCP / UDP →
<HA_IP>:21116 -
21117 TCP →
<HA_IP>:21117
Supported architectures
Right now it builds for:
-
amd64(Intel/AMD mini PCs and VMs) -
aarch64(Pi 4/5 64-bit etc.)
A couple of common gotchas
- “ID Does Not Exist” error?
This almost always means the target pc (the one you are trying to connect to) hasn’t been configured to use your self-hosted server yet. Every machine needs to know about your ID Server and Key.
- Where are the keys?
Just leave private_key and public_key blank in the add-on config. The add-on takes care of generating them on the fly, you just need to grab the public key from the logs.
I’ve put together some more docs on the repo with NGINX snippets and other details here: DOCS.md
Let me know if you run into any issues or have questions! Hope someone else finds this helpful to add to their HA setup. ![]()