Self-hosting
RustDesk on Raspberry Pi
RustDesk on a Raspberry Pi means running hbbs and hbbr on the Pi’s ARM Linux system, either with the ARM build of the rustdesk/rustdesk-server image or with the ARM release binaries. That is a reasonable small server when the power supply, storage, and uplink are up to the sessions that actually relay. It is a poor fit for many simultaneous relays. This guide does not publish Pi model benchmarks, frame rates, or a maximum client count.
rasdesc.com is independent of the RustDesk project and of Raspberry Pi Ltd. Hardware limits below are operational cautions, not measurements taken for this page.
What a Pi is good at in this design
The ID service is the lighter half. hbbs registers clients, takes heartbeats, runs the NAT type test, and helps two peers punch a hole. Documentation says hole punching works in the majority of cases, so a lot of sessions never put their media on the Pi. Those direct sessions travel between the two computers. The Pi only introduced them. A board that spends its day on registration, for a household or a small office whose networks punch cleanly, is doing a job that matches a small always-on computer.
The relay is the half that does not match a small board once the count climbs. hbbr carries the session when punching fails, when you set ALWAYS_USE_RELAY=Y, or when you choose the documented mode that publishes only TCP 443 and forces a WebSocket relay. Every one of those sessions consumes the Pi’s CPU and, more often, its uplink. A residential connection with a thin upstream will saturate before the SoC does. A handful of relayed sessions is a different problem from a help desk that relays all day. Pick the host for the second case on purpose, and read the architecture page before you assume the Pi will stay out of the media path.
Prerequisites
Use a Pi that stays powered. Undervoltage and a flaky supply look like random hbbs crashes, which clients report as “Not ready, please check your connection.” Use storage you are willing to back up. The public key id_ed25519.pub and its private counterpart land in the data directory on first start. An SD card that fails takes the key with it, and every client must be rekeyed. A USB SSD is a sturdier place for that directory if you already use one for other services. This page does not claim a particular card model is required.
The uplink has to match the relay load you expect, not the registration load. If most sessions are peer to peer, a modest upstream is enough for heartbeats. If mobile clients and strict NATs relay often, the upstream is the capacity plan. You need the ability to forward TCP 21115–21117 and UDP 21116, or you need every client on a private overlay so those ports are not public. The port map is the list. You need the official client on each computer, from the download page, not a build of unknown origin.
Pro on a Pi still needs outbound HTTPS for the license check. OSS does not. A Pi on a guest network that blocks outbound HTTPS can run OSS and cannot complete the standard Pro license model. An air-gapped Pro install is not the standard supported deployment.
Supported environment
The server processes are available for ARM through the Docker image or the release binaries in the rustdesk-server repository. Raspberry Pi OS and other ARM Linux systems that run Docker are the practical match for the official Compose file. That file uses network_mode: "host", which is a Linux behavior and is what you want on the Pi: hbbs should see real client addresses when it classifies NAT. Docker Desktop’s warning about removing --net=host applies to Windows and macOS desktops, not to Raspberry Pi OS. Keep host networking on the Pi.
The Pi can also be a client. That is a separate install of the desktop or the headless client, with its own Wayland or X11 limits, and it is not required to run the server. Do not confuse an ARM client package with hbbs. The server binaries and the client binaries ship from different repositories. iOS is irrelevant to hosting the server. Android as a host is a client-permission topic, not a Pi topic.
64-bit Raspberry Pi OS is the boring choice when the image you pull is a 64-bit ARM build. If Docker refuses the image, you are on a 32-bit userland or an unsupported board revision. Switch to a supported OS image or use the release binary that matches the CPU, from the GitHub releases for rustdesk-server. This guide does not invent file names for those binaries. Read the release assets for the architecture you actually have.
Install on the Pi
- Install Raspberry Pi OS, or another ARM Linux you already patch, and install Docker with Compose. Give the Pi a wired Ethernet connection if one is available. Wi-Fi adds loss and power draw the relay does not need.
- Create a directory on the storage you will back up. The Compose volume
./data:/rootwill putid_ed25519.pubthere. - Use the official Compose file, or the homepage OSS download after you have read it. Start the stack. Confirm both containers stay up across a reboot.
- Forward the native ports, or skip public forwarding if clients will reach the Pi only over a private network.
- Paste the public key and the Pi’s reachable name into each authorized client. Set the API server only if you installed Pro.
- Watch a real session. If the Pi’s uplink pegs, you are relaying more than this board should carry. Move
hbbror the whole pair to a larger host.
The Compose file from the Docker documentation is the one to keep on the Pi:
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
From that directory, start it with:
docker compose up -d
The homepage quick start is wget rustdesk.com/oss.yml -O compose.yml followed by docker compose up -d. Pro is the same with wget rustdesk.com/pro.yml -O compose.yml. Read the downloaded file. The publisher’s other quick start pipes a remote shell script into a shell. Read that script before you run it. A manual start, if you want to see each process once, is the official pair:
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
Pulling rustdesk/rustdesk-server on the Pi selects the image matching the Pi’s architecture when the registry has one. If the pull errors on architecture, stop and use the matching binary from the GitHub release instead of forcing a platform flag this guide does not document. Forcing every session through the Pi with ALWAYS_USE_RELAY=Y is optional and usually the wrong default on a small uplink. The Docker page shows that variable on the hbbs service. The Docker guide explains the flag. The setup guide explains client fields.
| Pi concern | Why it matters for hbbs and hbbr |
|---|---|
| Power | A brownout kills registration. Clients then sit on Not ready even though the firewall never changed. |
| Storage | The key directory has to survive reboots and card failures. Back up ./data. |
| Uplink | Relayed sessions use the Pi’s upstream. Direct sessions mostly do not. |
| Heat and load | Many simultaneous relays are a poor fit. This page states no numeric limit because none was measured here. |
What you should see
After the first hbbs start, ./data/id_ed25519.pub is present. docker logs hbbs and docker logs hbbr should show both processes staying up. A client pointed at the Pi’s public name, or at its private address if you are not publishing ports, should show Ready once UDP and TCP 21116 work. Ready on the LAN and Not ready from cellular means the forward, not the ARM image, is wrong.
A short authorized session between two computers that can punch through should connect without the Pi’s network graph looking like a full video stream. If every test session drives the upstream to its ceiling, those sessions are on hbbr. That is your signal to stop adding clients, not to overclock the board. This guide will not tell you a Pi 4 “handles” a specific number of relays. It does not have that measurement.
On Pro, the console is still TCP 21114, or HTTPS in front of it. The console is not the web client. Individual still does not add an extra admin user beyond the default admin, including when the console happens to be running on a Pi.
Troubleshooting a Pi server
Start with power and storage before you touch NAT theory. Undervoltage icons, filesystem remounts, and a data directory that comes back empty are Pi problems. An empty data directory means the next start minted a new key and your clients still hold the old one. Restore the backup or update every client to the new id_ed25519.pub. Do both only if you understand which key is current.
If the containers restart forever, read docker logs hbbs. An architecture mismatch, a full disk, and a port already taken by a previous binary install are the usual causes. Do not run the GitHub binary and the container on the same ports at the same time. If logs are quiet and clients stay Not ready, test UDP 21116 specifically. Forwarding TCP and forgetting UDP is common on home routers in front of a Pi.
If clients are Ready and sessions fail, hbbr or the punch is the problem. Confirm TCP 21117. Try one session with ALWAYS_USE_RELAY=Y as a test, then turn it off if the Pi’s uplink cannot carry it as a permanent policy. Clock sync still belongs on the list. A Pi without NTP can drift far enough to confuse registration while the process looks healthy.
Heat throttling and Wi-Fi retries make relayed sessions worse without changing a single RustDesk setting. Prefer Ethernet. Keep the board in open air. None of that raises a small uplink’s bitrate.
Security notes
A Pi on a shelf is physically easier to walk away with than a server in a rack. Whoever holds the board holds the private key in ./data. Use a case location you control, restrict SSH to the people who already administer it, and back the key directory up to a place with its own access control. Clients receive only the public half.
Publish the minimum native ports: TCP 21115–21117 and UDP 21116. Leave 21118 and 21119 closed. Those WebSocket ports trust X-Real-IP and X-Forwarded-For without validating them. A reverse proxy should be the only client of those ports, and only if you truly want the web client on a board this small. Forged headers spoof addresses in rate limits and logs. Pro’s license check, if you run Pro, needs outbound HTTPS. OSS skips that call.
Encrypted self-hosted use still depends on the key from this Pi’s id_ed25519.pub. The normal ID-based model is the one docs describe with NaCl end-to-end encryption. Direct IP access is a different, optional mode with a documented unencrypted path. Leave it off. The Pi does not make a session authorized. Connect only to computers you own or are allowed to administer. The security notes cover the difference between a public key and a password.
Frequently Asked Questions
Can a Raspberry Pi run a RustDesk server?
Yes, for a small deployment. Use the ARM Docker image or the ARM release binaries of hbbs and hbbr. Power, storage, and uplink have to be adequate. Many simultaneous relays are a poor fit, and this guide does not give a benchmark.
Should I force relay on a Pi?
Usually no. ALWAYS_USE_RELAY=Y sends session traffic through the Pi’s uplink. Leave it unset so hole punching can keep media between the endpoints. Turn it on only as a test or as a policy you have capacity for.
Do I use the same compose file as on a PC server?
Yes. The official file uses rustdesk/rustdesk-server:latest, network_mode: "host", the volume ./data:/root, and the commands hbbs and hbbr. Host networking is appropriate on Raspberry Pi OS. The Docker Desktop exception is for Windows and macOS.
What happens if the SD card dies?
You lose the key material in the data directory unless you have a backup. Clients configured with the old public key will not match a newly generated one. Restore ./data or update every authorized client.