Self-hosting

How to Set Up a Self-Hosted RustDesk Server

Reviewed November 30, 2026Independent reference, not the official RustDesk siteReport a correction

A RustDesk self-hosted server setup is the sequence of installing hbbs and hbbr on a host you administer, saving the public key those processes generate, and entering that ID server and key on every authorized client. The open-source path has no license fee. Server Pro uses the same rendezvous and relay roles and adds a console. This page is the install order. It is not a covert deployment guide, and it applies only to machines you own or are permitted to manage.

Commands below are the ones published in the RustDesk Docker documentation and the homepage compose quick start, as recorded in the facts for this guide. rasdesc.com is not the publisher and does not operate a server for you.

Decide what you are installing

Start by naming the edition. Server OSS, from the rustdesk-server repository, is AGPL-licensed software that gives you the ID service and the relay. Server Pro is commercial self-hosted software. Its docs live in the Pro self-host guide. Pro is not a hosted remote-desktop subscription, and its source is not described as AGPL.

Choose OSS when shared knowledge of an ID server address and a public key is enough. Choose Pro when you need the web console, an API, OIDC, LDAP, 2FA, an address book, logs, device management, or access control. Some of those organization features start on the Basic plan. The console documentation says the Individual plan does not create an additional user besides the default admin. Prices reviewed on November 30, 2026 are $0 for OSS, $11.88 per month billed annually for Individual, and $23.88 per month billed annually for Basic and the customized plans, plus the extra unit charges those customized plans publish. Confirm allowances on the pricing page. This guide does not invent included user or device counts.

The publisher’s homepage, when reviewed, attributed 113K+ GitHub stars to the project and described a survey of self-hosters. Treat that as the publisher’s statement. It is not a sizing formula for your host.

Prerequisites

You need a Linux host for the documented host-network container layout, or another environment where you have already accepted the Docker Desktop limitation described later. You need Docker installed if you follow the compose path, a directory that will hold keys across restarts, and permission to edit the host firewall. You need a DNS name or address that every client can resolve. You need the RustDesk client, from an official build, on each computer that will connect. Use the download page for those links. This site does not ship binaries.

Pro adds one network requirement OSS does not have: outbound HTTPS so the license can be validated. A permanently air-gapped Pro deployment is not the standard supported model. OSS has no license check. Both editions need you to keep the private key on the server after the first hbbs start. Clients receive only id_ed25519.pub.

Budget operator time as well as a machine. You will patch the host, back up the data directory, watch disk and bandwidth, and rotate access when staff change. The software license, even at $0, does not include that labor.

Supported environment

Client documentation names Windows, macOS, Debian derivatives including Ubuntu 16 and later, Red Hat derivatives including CentOS, Fedora 18 and later, and Rocky, Arch and Manjaro, openSUSE, NixOS, AppImage and Flatpak, Android, iOS as a controller only, and a web client on a qualifying Pro plan. The server side of this setup is the host running hbbs and hbbr. Ubuntu is a common choice because it is a Debian derivative with current Docker packages. The server does not have to be Ubuntu. It has to run the processes and pass the ports.

Hardware requirements are operational, not a published benchmark in this guide. The ID service is light when it is only registering and punching holes. The relay is the piece that burns bandwidth and CPU, and only for sessions that fail to go peer to peer. A small always-on machine is enough for a handful of computers. Many simultaneous relays are a different design. Put that traffic on a host with a real uplink, and read the architecture notes before you assume every session will be direct.

Host networking in Docker is a Linux behavior. Docker Desktop on Windows and macOS is different. The official Docker documentation says to remove --net=host when host networking causes trouble. If you are learning on a laptop, prefer a Linux virtual machine or a small VPS over fighting Docker Desktop’s network model.

Installation steps

  1. Install Docker on the Linux host, using Docker’s own install instructions for that distribution. Confirm docker compose works before you download a stack.
  2. Create an empty working directory that you can back up. The compose examples mount ./data at /root inside the container. That directory will hold the keys.
  3. Either write the compose file shown below or download the publisher’s file. If you download it, open it and read it before you start anything.
  4. Start the stack, confirm both processes stay up, and copy the public key to a password manager your operators already use.
  5. On each authorized client, set the ID server and the key. Set the relay only if you do not want the client to infer port 21117 on the same host. On Pro, also set the API server.
  6. From a second network, confirm the client reaches Ready and that an authorized session opens. Then close any port you do not need.

The publisher’s homepage quick start downloads a compose file and starts it:

wget rustdesk.com/oss.yml -O compose.yml
docker compose up -d

Pro uses the same shape with a different file:

wget rustdesk.com/pro.yml -O compose.yml
docker compose up -d

That homepage also offers a quick start that pipes a remote shell script into a shell. Piping a script you have not read is the publisher’s shortcut. Read the script first, or skip it and use the compose file. The explicit Compose file from the Docker documentation, which this guide treats as the readable OSS layout, is:

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

Place that file next to the data directory and run docker compose up -d. The image line pulls rustdesk/rustdesk-server:latest when Compose starts. An equivalent manual start, copied from the official 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

On Windows, the same Docker page says to leave out sudo and --net=host. Remove host networking if connections fail on Docker Desktop. Further container behavior is on the Docker page. If you force every session through the relay, the Docker documentation shows an optional environment variable, ALWAYS_USE_RELAY=Y, on the hbbs service. Leave it unset unless you have a reason to skip direct connections.

Point the clients at the server

The public key is the contents of id_ed25519.pub in the data directory after the first hbbs run. Paste that value into the Key field. It is not the Pro license key, and it is not an API token.

Client fieldWhat to enterRequired
ID serverDNS name or address of the host running hbbs.Yes, for any self-hosted client.
KeyThe text of id_ed25519.pub.Yes, for encrypted self-hosted use.
Relay serverHost running hbbr. Port 21117 is inferred if you omit it.Optional when relay and ID server share a host.
API serverPro console address, port 21114, or an HTTPS URL in front of it.Pro login and web console. Leave it empty on OSS.

Set these values on both the controller and the host computer. A laptop that still points at the public servers cannot rendezvous with a desktop that points at yours. After the network settings are saved, the client registers again. Then use the client the way you would for any authorized session: an ID, plus a one-time password, a permanent password the owner set, or an approval click. The client setup guide covers the first connection. Permanent passwords belong on devices you administer. Do not collect them from people you do not support.

What the operator should see

The data directory gains id_ed25519.pub on the first successful hbbs start. docker logs hbbs is how you read that container if you started it detached. Both container names, hbbs and hbbr, should remain running after a reboot because the compose file sets restart: unless-stopped.

On the client, Ready means the ID server answered. The failure text “Not ready, please check your connection” means it did not. A public-server install can also show a sentence inviting you to set up your own server. Once your ID server is configured, judge success by registration, not by that public-server prompt. On Pro, the browser console on TCP 21114 should load for an operator who can reach that port. If you terminate Pro on HTTPS 443, 21114 does not have to be public.

Troubleshooting a new install

If the client stays Not ready, check the items the project’s own troubleshooting list implies. The ID server host name must be the one clients can resolve. TCP and UDP 21116 must both pass; opening only TCP is a common miss, and the port guide spells out the rest. The host clock should be synchronized. The key must be the public key from this server, not a key copied from a different install or from a screenshot of someone else’s demo. The process must be up.

If Ready appears and the session still fails, the rendezvous path is fine and the media path is not. Test TCP 21117, then decide whether the two networks can hole-punch. Forcing relay with ALWAYS_USE_RELAY=Y is a diagnostic and a policy choice. It sends session traffic through your uplink, so only turn it on when you accept that cost. Wrong edition is another stall: an OSS client with an API server filled in, or a Pro client with the API server empty, will not behave like a finished Pro login. The API server value remains separate from the license key you apply to the server itself.

This guide has no independently confirmed dashboard for the publisher’s public service. If you are still on the public servers, “Not ready” is a local path problem until you prove otherwise. After you self-host, the only status that matters is docker logs and whether your firewall answers.

Security notes for the new server

Close TCP 21118 and 21119 unless a reverse proxy is the only client of those ports. They serve the web client over WebSocket. On that path the server trusts X-Real-IP and X-Forwarded-For, and it does not validate them. Anyone who can connect directly can spoof a client address. Native clients do not need those ports. They need TCP 21115–21117 and UDP 21116.

Back up ./data with the same care as any private key. Losing it means every client must be updated to a newly generated public key. Copying the directory to a world-readable share defeats the point of generating the key on the server. Give the public half to clients. Keep the private half on the host.

Direct IP access listens, when enabled, on a different mode from ID connections. The documented default port for that mode is 21118, it is off until direct-server is turned on, and the FAQ documents an unencrypted path for it. Leave it off during a first setup. Encryption for the normal ID-based model still depends on the public key being the one from this hbbs. The security guide covers scam patterns and the limits of an ID whitelist: the connecting client reports the ID, so a whitelist is not authentication.

Every step on this page is for authorized administration. Do not install a service on a computer you are not allowed to manage, do not hide the session, and do not ask a stranger to read a one-time password to you.

Frequently Asked Questions

Where is the RustDesk server public key?

After hbbs runs the first time, read id_ed25519.pub in the data directory you mounted at /root. In the compose example that directory is ./data on the host. Paste the public key into the client Key field.

Can I set this up on Ubuntu?

Yes. Ubuntu is a Debian derivative covered by the client docs, and it is a normal Linux host for the Docker Compose example. The server packages are hbbs and hbbr, not the desktop client package. Install Docker, then use the compose file.

What are the hardware requirements?

This guide does not publish a benchmark. Plan for a stable host, disk for the key directory and logs, and uplink equal to the sessions that actually relay. Peer-to-peer sessions do not park their media on the server. A relay-heavy deployment needs more bandwidth than an ID-only workload.

Do I open every port in the documentation on day one?

No. Native clients need TCP 21115–21117 and UDP 21116. Add TCP 21114 for a Pro console you are not already publishing on HTTPS. Leave 21118 and 21119 closed until a reverse proxy is the only path to the web client.