Setup note
RustDesk with Tailscale
A RustDesk Tailscale integration is a way to reach your own hbbs and hbbr over a Tailscale network so the RustDesk ports do not have to be open on the public internet. Tailscale is a separate WireGuard-based mesh VPN at tailscale.com. RustDesk does not ship it, does not configure it, and does not treat a tailnet address as a special protocol. You install both products, put the server and the authorized clients on the tailnet, and type the tailnet address into the RustDesk ID server field.
rasdesc.com is not affiliated with RustDesk or with Tailscale. Tailscale’s own documentation is the source for tailnet setup, access control lists, and MagicDNS. This page only describes how that network can carry a self-hosted RustDesk server.
The pattern, without merging the products
Tailscale gives each enrolled machine an address on a private mesh and encrypts traffic on that mesh with WireGuard. RustDesk gives two clients a remote desktop session, coordinated by hbbs and, when a direct path fails, carried by hbbr. Putting the RustDesk host on the tailnet means a client that is also on the tailnet can open TCP 21115, TCP 21116, UDP 21116, and TCP 21117 without those sockets answering on your public router. The port numbers do not change. The interface they must answer on changes. The port guide lists what each socket does. The architecture page explains hole punching and relay once the packets have a path.
That is the whole integration. There is no RustDesk checkbox named Tailscale in the facts this guide relies on, and this page will not invent one. You join the server machine to the tailnet with Tailscale’s own client. You join each computer that should reach the server. You set RustDesk’s ID server to the tailnet IP or MagicDNS name of the machine running hbbs. You paste the key from id_ed25519.pub. You leave the relay blank if hbbr is on that same machine, because port 21117 is inferred, or you set the relay to the same tailnet name.
WireGuard encryption on the tailnet is Tailscale’s property. It is not a statement about the RustDesk session. Docs describe peer-to-peer end-to-end encryption based on NaCl for RustDesk’s normal ID-based connection model, and that self-hosted encrypted use still requires the public key from id_ed25519.pub. Direct IP access remains a different RustDesk mode with a documented unencrypted path. Do not skip the RustDesk key because “the VPN is encrypted.” Do not tell anyone that Tailscale encrypts the RustDesk session itself. Both layers have their own rules, and both have to be right.
Prerequisites
You need a Tailscale tailnet you are allowed to administer, with enough seats for the server and for every client that should see it. Tailscale’s pricing and device limits are Tailscale’s. This guide does not copy them. You need RustDesk Server already running, OSS or Pro, on a host that can also run the Tailscale client. The setup guide is that install. You need the data directory backed up, because the public key clients will use is id_ed25519.pub from the first hbbs start.
You need permission to install Tailscale and RustDesk only on machines your organization owns or is contracted to administer. A tailnet is not a warrant to add a personal laptop you do not manage, and a RustDesk ID is not a reason to bypass the host’s password or approval click. You need the official RustDesk client from the download page on those machines.
Pro still needs outbound HTTPS for its license check. The tailnet does not remove that call. OSS has no license check. If your exit node or firewall drops outbound HTTPS from the server, Pro will fail the license check while ping across the tailnet still works.
Supported environment
Tailscale publishes clients for the major desktop and mobile platforms and for Linux servers. Use their current install instructions. The RustDesk server side that matches the official Docker file is Linux with host networking. --net=host is a Linux behavior so hbbs sees real incoming addresses. Those addresses, in this design, are often tailnet addresses. Docker Desktop on Windows and macOS is different, and the official Docker page says to remove host networking when it causes trouble. A Linux VM or a small Linux host joined to the tailnet is the combination that matches both vendors’ usual server docs.
RustDesk clients in this pattern are the same clients as always: Windows, macOS, Linux, Android, and iOS as a controller. Each of them needs the Tailscale client as well, signed into a tailnet that is allowed to reach the server. MagicDNS names are easier to type than raw tailnet IPs, and they survive address changes. Confirm in Tailscale’s docs that MagicDNS is enabled before you put a name into the ID server field.
A subnet router or an exit node is optional and easy to confuse with this pattern. You do not need to advertise your whole LAN for the basic case. You need the RustDesk host and the controlling clients enrolled. Advertising a subnet so that off-tailnet devices can reach hbbs reopens a private path on purpose. Do that only with an ACL you have read. This guide does not walk through subnet-router flags.
Steps
- Install and start
hbbsandhbbron the Linux host. Keep the official volume./data:/rootso the key persists. Readid_ed25519.puband store the public half with your other admin secrets. - Install Tailscale on that host using Tailscale’s Linux instructions. Approve the node in the Tailscale admin console. Note its tailnet IP and MagicDNS name.
- In Tailscale’s access controls, allow the users and tags that should reach the RustDesk host on TCP 21115–21117 and UDP 21116. If you use the Pro console over the tailnet, allow TCP 21114 to those operators only. Do not allow the tailnet’s entire user list by habit.
- Confirm the host firewall allows those ports on the tailnet interface. Then remove any public port forward that existed only for RustDesk. The public router should not answer 21115–21117 for this design.
- Install Tailscale on each authorized client machine. Install or reconfigure RustDesk. Set the ID server to the tailnet name. Set the key. Leave the relay empty if it is the same host, or set it to the same tailnet name. On Pro, set the API server to the tailnet name and port 21114, or to an HTTPS URL that resolves only inside the tailnet.
- From a client that is on the tailnet and from one that is not, compare behavior. The enrolled client should reach Ready. The other should not, once public forwarding is gone.
The server start itself stays the official Compose file. Tailscale does not replace it:
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
docker compose up -d
You can also fetch the publisher’s file with wget rustdesk.com/oss.yml -O compose.yml or wget rustdesk.com/pro.yml -O compose.yml, then read it and run docker compose up -d. A homepage quick start that pipes a remote shell script should be read before it is run. Host networking matters here: the processes should observe the tailnet address Tailscale added to the host, which is a Linux host-network outcome. The manual form from the Docker page is:
sudo docker image pull rustdesk/rustdesk-server
sudo docker run --name hbbs -v ./data:/root -td --net=host --restart unless-stopped rustdesk/rustdesk-server hbbs
sudo docker run --name hbbr -v ./data:/root -td --net=host --restart unless-stopped rustdesk/rustdesk-server hbbr
The Docker page covers when to remove --net=host. On a Linux server that is also a Tailscale node, keep it so client addresses stay meaningful. ALWAYS_USE_RELAY=Y is still optional. Over a tailnet, many pairs can punch directly because both ends are on the mesh. Forcing relay sends that traffic through hbbr anyway. Leave the variable off unless you want the relay for policy reasons.
| Layer | What it encrypts or controls | What you configure |
|---|---|---|
| Tailscale | WireGuard protection for packets on the tailnet, plus ACLs for who may send them. | Node membership, tags, and ACL ports. Not the RustDesk key. |
| RustDesk ID model | Documented NaCl end-to-end encryption for the normal ID-based connection, when clients have id_ed25519.pub. | ID server, key, optional relay, and on Pro the API server. |
| RustDesk Direct IP access | A separate mode. The FAQ documents an unencrypted path. | Leave direct-server off. |
What you should see
The Tailscale admin page should list the server and the clients as connected nodes. That list is Tailscale’s, not a RustDesk dashboard. On the server, docker logs hbbs should show the ID service up, and id_ed25519.pub should be in the data directory. A RustDesk client on the tailnet, with the tailnet name in the ID server field and the matching public key, should show Ready. A client that still has your old public IP in the ID server field will stay on “Not ready, please check your connection” after you delete the public forward. Update the field. The public-server prompt some fresh installs show, inviting you to run your own server, is unrelated to Tailscale.
An authorized session between two enrolled machines should connect. If both ends and the relay are on the tailnet, a failed punch still falls back to hbbr under RustDesk’s rules. Success at the Tailscale ping level does not prove the session will be peer to peer. Pro’s web console, if you use it, should be opened through the tailnet on TCP 21114 or through an HTTPS name that only the tailnet resolves. The console remains the admin site. It is not the web client, and it is not a Tailscale login.
Troubleshooting
If Tailscale ping works and RustDesk stays Not ready, the ID server field is wrong, UDP 21116 is filtered on the host firewall, the key does not match, or hbbs is down. ACLs are the Tailscale-specific version of the firewall. A tag that can ping and cannot open UDP 21116 fails registration while every Tailscale status icon stays green. Fix the ACL and the host firewall together. Check the clock on the server. Check docker logs hbbs.
If Ready works and the session does not, TCP 21117 is the next socket, either in the ACL or in the host firewall. Forcing ALWAYS_USE_RELAY=Y tells you whether hbbr is reachable over the tailnet. Turn it off again if you only wanted the test. If nothing on the tailnet can resolve the MagicDNS name, use the tailnet IP until MagicDNS is enabled, then switch clients once. Mixing a public DNS name that still points at a closed router with a tailnet IP in different clients produces two populations, one Ready and one not.
Docker Desktop plus Tailscale plus host networking is a poor stack to debug. If the server is a Windows or Mac Docker Desktop host, remove host networking when connections fail, as the official Docker page says, or move hbbs and hbbr to a Linux node on the tailnet. Split-horizon DNS, where the same name is public and private, will send some clients to the public address you just closed. Prefer the MagicDNS name that exists only on the tailnet.
Security notes
The tailnet shrinks who can reach the ports. It does not decide who may control a desktop. RustDesk still requires a one-time password, a permanent password on a machine you administer, or an approval click. An ID whitelist is still not authentication, because the connecting client reports the ID. Keep permanent passwords in a password manager, not in a tailnet grant comment.
Close the public forwards. Leaving 21115–21117 open on the router after you move to Tailscale keeps the old exposure and adds the tailnet beside it. Close 21118 and 21119 everywhere they are not needed. If you run the web client, a reverse proxy should be the only client of those ports, because X-Real-IP and X-Forwarded-For are not validated. The tailnet does not fix header spoofing on a publicly exposed WebSocket. Minimum sockets, whether public or only on the tailnet interface, remain TCP 21115–21117 and UDP 21116 for native clients.
Share id_ed25519.pub with clients. Keep the private key on the server. The API server value for Pro is separate from the license key and from the Tailscale auth key you used to enroll the node. A Tailscale auth key is a Tailscale credential. It does not belong in a RustDesk config file. Pro’s outbound license check still uses HTTPS. OSS does not check a license. The security guide is the place for scam patterns and for the Direct IP warning. Use this design only for authorized administration.
Frequently Asked Questions
Does RustDesk include Tailscale?
No. Tailscale is a separate product. You install it yourself, enroll the RustDesk server and the authorized clients, and point RustDesk at the tailnet address. RustDesk’s own key and ports still apply.
Does Tailscale encrypt the remote desktop session?
Tailscale encrypts packets on the tailnet using WireGuard. RustDesk’s documented end-to-end encryption for the normal ID-based model is separate and still depends on id_ed25519.pub. One layer does not replace the other. Direct IP access stays a documented unencrypted RustDesk path.
Which address do I put in the ID server field?
The tailnet IP or MagicDNS name of the host running hbbs. After you remove public port forwards, a public IP in that field will fail. The relay can stay blank when hbbr is on the same host.
Can I close the public RustDesk ports?
Yes. That is the point of the pattern. Clients on the tailnet reach TCP 21115–21117 and UDP 21116 on the tailnet interface. Clients that are not on the tailnet will not reach the server, which is what you wanted when you closed the forwards.