RustDesk Server OSS on Windows Server 2025 on Azure User Guide
Overview
This guide covers the deployment and use of RustDesk Server OSS on Windows Server 2025 on Microsoft Azure, using cloudimg's virtual machine image from the Azure Marketplace.
RustDesk is an open-source remote desktop tool. RustDesk clients find each other through a rendezvous (ID) server and, when a direct peer-to-peer connection is not possible, pass the session through a relay server. This image runs your own copy of both, the open-source RustDesk Server OSS 1.1.16 (rustdesk/rustdesk-server), on Windows Server 2025 Datacenter, so your remote support sessions are brokered by a server in your own Azure subscription instead of RustDesk's public servers.
What's included:
- RustDesk Server OSS 1.1.16, the unmodified upstream Windows release (
rustdesk-server-windows-x86_64-unsigned.zip):hbbs.exe(the ID/rendezvous server),hbbr.exe(the relay server) andrustdesk-utils.exe, inC:\Program Files\RustDesk Server, with the AGPL-3.0 licence and a link to the source - Two Windows services, run by WinSW 2.12.0. Both face the internet, so neither runs as LocalSystem: each runs as its own low-privilege virtual service account,
NT SERVICE\RustDeskHbbsandNT SERVICE\RustDeskHbbr, which has no password and no rights beyond the RustDesk data folder: - RustDesk ID Server (hbbs), service name
RustDeskHbbs: TCP 21115, 21116 and 21118, UDP 21116. Starts automatically at boot - RustDesk Relay Server (hbbr), service name
RustDeskHbbr: TCP 21117 and 21119. Starts automatically (delayed start, after hbbs) with-k _, so it uses the same key as hbbs - Both restart automatically if they stop
- A key pair made on your VM. hbbs generates its Ed25519 key pair the first time your VM starts, in
C:\ProgramData\RustDesk Server. No key is in the image, so no two deployments share one. Only SYSTEM, Administrators and the two RustDesk service accounts have any access to that folder (hbbs can change it, hbbr can only read it); ordinary users cannot read the key - The key is enforced. A RustDesk client must be configured with this server's public key to register or connect through it; a client with any other key is refused
- Windows Firewall inbound rules for the RustDesk ports (group RustDesk Server: TCP 21115-21119 and UDP 21116, every profile)
- Windows Server 2025 Datacenter, Desktop Experience, Gen2, x64, built from Microsoft's own Azure Marketplace image (
MicrosoftWindowsServer:WindowsServer:2025-datacenter-g2, version26100.33828.261112). Windows Update ran during the build and reported nothing pending when the image was captured on 1 December 2026 - Microsoft Defender Antivirus and Windows Firewall on; the Azure VM agent, so Azure features such as Reset password and Run command work
- OpenSSH Server, which Microsoft's Azure image starts, is stopped and disabled, so nothing listens on TCP 22 (see Managing the Services to turn SSH on)
- cloudimg's support team is on hand 24 hours a day by email (support@cloudimg.co.uk), with a guaranteed response within 24 hours
This is the open-source server. It is not RustDesk Server Pro (a separate paid product with a web console, user accounts and address books), and it has no web interface and no password of its own: you manage it through Windows.
Platform: Microsoft Azure (Gen2 Hyper-V; standard or Trusted Launch, SCSI or NVMe disks)
Administrator account: the Windows user name and password you choose when you deploy the VM. There is no default password on this image.
Program folder: C:\Program Files\RustDesk Server Data folder (keys, database, logs): C:\ProgramData\RustDesk Server
Prerequisites
- An Azure subscription where you can create virtual machines
- The public IP addresses (or address ranges) of the networks your RustDesk clients connect from, and your own address for Remote Desktop
- A Remote Desktop client (Windows
mstsc, Windows App on macOS, or Remmina on Linux) - The RustDesk client on the machines you want to support or control (rustdesk.com or GitHub releases)
Recommended VM size: Standard_B2ms (2 vCPUs, 8 GiB). The ID server needs very little; relayed sessions use network bandwidth, so choose a larger size for many simultaneous relayed sessions.
Step 1: Deploy the Virtual Machine
Option A: Azure Portal
- In the Azure Marketplace, search for "RustDesk Server OSS on Windows Server 2025 cloudimg"
- Select the offer and click Create
- Configure the basics:
- Subscription and Resource group: select or create
- Virtual machine name and Region: your choice
- Size:
Standard_B2msrecommended - Under Administrator account, enter a Username and a Password that you choose. Azure refuses reserved names such as "administrator", "admin" and "guest"
- Under Inbound port rules, allow RDP (3389). Azure then opens port 3389 to the whole internet, so restrict it straight after deployment (step 7)
- Click Review + create, then Create
- When the deployment finishes, open the VM's Networking (Network settings) page:
- edit the inbound rule for port 3389 and set Source to My IP address (or your office or VPN address range)
- add an inbound rule for TCP destination ports
21115-21119and one for UDP destination port21116, with Source set to the address ranges your RustDesk clients connect from (or Any if your clients roam; the key still keeps out every client that does not hold it)
Option B: Azure CLI
Accept the offer terms once per subscription, then create the VM with no inbound rules. Leave out --admin-password and the CLI asks for the password, which keeps it out of your shell history:
az vm image terms accept --urn cloudimg1647283583153:rustdesk-server-windows-server:default:latest
az vm create \
--resource-group myResourceGroup \
--name my-rustdesk \
--image cloudimg1647283583153:rustdesk-server-windows-server:default:latest \
--size Standard_B2ms \
--admin-username <your-admin-name> \
--public-ip-sku Standard \
--nsg-rule NONE
Then open Remote Desktop to your own address only, the RustDesk ports to your clients' networks, and read the VM's public IP:
az network nsg rule create \
--resource-group myResourceGroup \
--nsg-name my-rustdeskNSG \
--name allow-rdp-from-my-ip \
--priority 1000 \
--direction Inbound --access Allow --protocol Tcp \
--destination-port-ranges 3389 \
--source-address-prefixes <your-public-ip>/32
az network nsg rule create \
--resource-group myResourceGroup \
--nsg-name my-rustdeskNSG \
--name allow-rustdesk-tcp \
--priority 1010 \
--direction Inbound --access Allow --protocol Tcp \
--destination-port-ranges 21115-21119 \
--source-address-prefixes <client-network-range>
az network nsg rule create \
--resource-group myResourceGroup \
--nsg-name my-rustdeskNSG \
--name allow-rustdesk-udp \
--priority 1020 \
--direction Inbound --access Allow --protocol Udp \
--destination-port-ranges 21116 \
--source-address-prefixes <client-network-range>
az vm show --resource-group myResourceGroup --name my-rustdesk --show-details --query publicIps -o tsv
The ports, and what uses them:
| Port | Protocol | Service | Used for |
|---|---|---|---|
| 3389 | TCP | Remote Desktop | Your administration of the server. Allow from your own address only |
| 21115 | TCP | hbbs | NAT type test |
| 21116 | TCP and UDP | hbbs | ID registration, heartbeat and hole punching (UDP); connection requests (TCP) |
| 21117 | TCP | hbbr | Relay, when a direct connection is not possible |
| 21118 | TCP | hbbs | WebSocket, for the RustDesk web client |
| 21119 | TCP | hbbr | WebSocket relay, for the RustDesk web client |
If none of your clients use the web client, you can leave TCP 21118 and 21119 closed in the network security group.
Step 2: Connect with Remote Desktop
- Open your Remote Desktop client and connect to the VM's public IP address
- Windows: run
mstsc, enter the IP address and click Connect - macOS: in Windows App, add a PC with the IP address
- Linux: in Remmina, create an RDP connection to the IP address
- Sign in as
<your-admin-name>with the password you set at deployment. On Windows, choose More choices, then Use a different account - Accept the certificate warning: the VM uses a self-signed Remote Desktop certificate
Step 3: Check the services and read your server's public key
Open PowerShell (right-click Start, Terminal (Admin) or Windows PowerShell (Admin)) and run:
Get-Service RustDesk* | Format-Table Status, StartType, Name, DisplayName -AutoSize
Status StartType Name DisplayName
------ --------- ---- -----------
Running Automatic RustDeskHbbr RustDesk Relay Server (hbbr)
Running Automatic RustDeskHbbs RustDesk ID Server (hbbs)
Read the public key. This is the value every RustDesk client needs:
Get-Content 'C:\ProgramData\RustDesk Server\id_ed25519.pub'
psbMGe7UdPloQPc9VfCCUE6SUiMspDc+cbeWTUyWonk=
Your key is different: it was generated on your VM the first time it started. Copy it (select it in the console and press Enter, or open the file in Notepad). Never copy or share id_ed25519 (without .pub): that is the private key.

The two services in the Services console:

Neither service runs as LocalSystem. Each has its own virtual service account (the Log On As column), and only SYSTEM, Administrators and those two accounts can open the key files: hbbs can change them, hbbr can only read them, and ordinary users have no access. To check:
Get-CimInstance Win32_Service -Filter "Name LIKE 'RustDesk%'" | Format-Table Name, State, StartMode, StartName -AutoSize
(Get-Acl 'C:\ProgramData\RustDesk Server\id_ed25519').Access | Format-Table IdentityReference, FileSystemRights, AccessControlType -AutoSize
Name State StartMode StartName
---- ----- --------- ---------
RustDeskHbbr Running Auto NT SERVICE\RustDeskHbbr
RustDeskHbbs Running Auto NT SERVICE\RustDeskHbbs
IdentityReference FileSystemRights AccessControlType
----------------- ---------------- -----------------
NT AUTHORITY\SYSTEM FullControl Allow
BUILTIN\Administrators FullControl Allow
NT SERVICE\RustDeskHbbs Modify, Synchronize Allow
NT SERVICE\RustDeskHbbr ReadAndExecute, Synchronize Allow
Keep it that way: never change either service to LocalSystem or another account, or widen the folder's permissions. Both services are reachable from the internet, and a low-privilege account limits what a fault in either could reach.
To see which ports the two servers listen on:
$p = @{}; Get-Process hbbs, hbbr | ForEach-Object { $p[$_.Id] = $_.ProcessName }
Get-NetTCPConnection -State Listen | Where-Object { $p.ContainsKey([int]$_.OwningProcess) } |
Select-Object @{n='Process';e={$p[[int]$_.OwningProcess]}}, LocalAddress, LocalPort | Sort-Object LocalPort | Format-Table -AutoSize
Get-NetUDPEndpoint | Where-Object { $p.ContainsKey([int]$_.OwningProcess) } |
Select-Object @{n='Process';e={$p[[int]$_.OwningProcess]}}, LocalAddress, LocalPort | Format-Table -AutoSize
Process LocalAddress LocalPort
------- ------------ ---------
hbbs :: 21115
hbbs :: 21116
hbbr :: 21117
hbbs :: 21118
hbbr :: 21119
Process LocalAddress LocalPort
------- ------------ ---------
hbbs :: 60238
hbbs :: 21116
The second UDP port (60238 here) is one Windows picks for hbbs each time it starts. RustDesk clients never connect to it, so it needs no firewall or network security group rule.
Step 4: Point your RustDesk clients at your server
On each machine running the RustDesk client:
- Open RustDesk, click the menu (⋮) next to your ID, then Network
- Click Unlock network settings (Windows asks for administrator approval), then ID/Relay server
- Set:
- ID server: the VM's public IP address or a DNS name that points to it
- Relay server: leave empty (the client uses the same host on port 21117), or enter the same address
- API server: leave empty (the open-source server has no API server)
- Key: the public key from Step 3
- Click OK. At the bottom of the main window the status changes to Ready once the client has registered with your server
Do this on both sides of a connection: the machine you control and the machine you connect from. Both must use the same ID server and key. A client with no key, or another key, cannot use your server: it never shows Ready, and a connection attempt reports a key mismatch.
To roll the settings out to many machines, RustDesk's documentation describes configuration strings and renamed installers: RustDesk client deployment.
Step 5: Check the server's log
hbbs writes its log to C:\ProgramData\RustDesk Server\logs\RustDeskHbbs.out.log (hbbr to RustDeskHbbr.out.log). The first lines show the key pair being generated on your VM and the ports opening:
Get-Content 'C:\ProgramData\RustDesk Server\logs\RustDeskHbbs.out.log' -Tail 20
[2026-12-01 04:10:25.279948 +00:00] INFO [src\common.rs:147] Private/public key written to id_ed25519/id_ed25519.pub
[2026-12-01 04:10:25.316901 +00:00] INFO [src\rendezvous_server.rs:1243] Key: <the public key from Step 3>
[2026-12-01 04:10:25.361185 +00:00] INFO [src\peer.rs:84] DB_URL=C:\ProgramData\RustDesk Server\db_v2.sqlite3
[2026-12-01 04:10:25.977168 +00:00] INFO [src\rendezvous_server.rs:107] serial=0
[2026-12-01 04:10:25.977200 +00:00] INFO [src\common.rs:45] rendezvous-servers=[]
[2026-12-01 04:10:25.977203 +00:00] INFO [src\rendezvous_server.rs:109] Listening on tcp/udp :21116
[2026-12-01 04:10:25.977205 +00:00] INFO [src\rendezvous_server.rs:110] Listening on tcp :21115, extra port for NAT test
[2026-12-01 04:10:25.977206 +00:00] INFO [src\rendezvous_server.rs:111] Listening on websocket :21118
[2026-12-01 04:10:25.990304 +00:00] INFO [src\rendezvous_server.rs:146] mask: None
[2026-12-01 04:10:25.990316 +00:00] INFO [src\rendezvous_server.rs:147] local-ip: ""
[2026-12-01 04:10:25.990358 +00:00] INFO [src\common.rs:45] relay-servers=[]
[2026-12-01 04:10:25.990582 +00:00] INFO [src\rendezvous_server.rs:161] ALWAYS_USE_RELAY=N
[2026-12-01 04:10:25.991099 +00:00] INFO [src\rendezvous_server.rs:193] Start

Step 6: The firewall rules
The image creates two inbound rules in the RustDesk Server group, enabled on every network profile, and leaves Windows Defender Firewall on for every profile, so anything else arriving at the VM is blocked unless a rule allows it. Azure's network security group decides who can reach the VM at all; these rules let the RustDesk traffic through Windows once it arrives.
Get-NetFirewallProfile -PolicyStore ActiveStore | Format-Table Name, Enabled, DefaultInboundAction -AutoSize
Get-NetFirewallRule -Group 'RustDesk Server' | ForEach-Object {
$p = $_ | Get-NetFirewallPortFilter
[pscustomobject]@{ Rule = $_.DisplayName; Enabled = $_.Enabled; Direction = $_.Direction; Action = $_.Action; Profile = $_.Profile; Protocol = $p.Protocol; LocalPort = $p.LocalPort }
} | Format-Table -AutoSize
Name Enabled DefaultInboundAction
---- ------- --------------------
Domain True Block
Private True Block
Public True Block
Rule Enabled Direction Action Profile Protocol LocalPort
---- ------- --------- ------ ------- -------- ---------
RustDesk Server (TCP 21115-21119) True Inbound Allow Any TCP 21115-21119
RustDesk Server (UDP 21116) True Inbound Allow Any UDP 21116

Server Components
| Component | Version | Where |
|---|---|---|
| RustDesk Server OSS (hbbs, hbbr, rustdesk-utils) | 1.1.16 | C:\Program Files\RustDesk Server |
| WinSW service wrapper | 2.12.0 (.NET Framework 4.6.1 build) | C:\Program Files\RustDesk Server\RustDeskHbbs.exe, RustDeskHbbr.exe |
| Windows Server 2025 Datacenter, Desktop Experience | 24H2, build 26100.33828 |
Filesystem Layout
| Path | What it holds |
|---|---|
C:\Program Files\RustDesk Server\hbbs.exe, hbbr.exe, rustdesk-utils.exe |
The RustDesk Server programs |
C:\Program Files\RustDesk Server\RustDeskHbbs.exe / .xml, RustDeskHbbr.exe / .xml |
The two WinSW service wrappers and their settings (program, arguments, working folder, logs, restart policy) |
C:\Program Files\RustDesk Server\LICENSE-rustdesk-server.txt, LICENSE-WinSW.txt, README.txt |
Licences and where the source is |
C:\ProgramData\RustDesk Server\id_ed25519.pub |
This server's public key: give it to your clients |
C:\ProgramData\RustDesk Server\id_ed25519 |
This server's private key: keep it secret, back it up |
C:\ProgramData\RustDesk Server\db_v2.sqlite3 |
hbbs's database of registered client IDs |
C:\ProgramData\RustDesk Server\logs\ |
The service logs (RustDeskHbbs.out.log, RustDeskHbbr.out.log, .err.log and the wrapper logs), rolled at 10 MB, 8 kept |
Managing the Services
From an elevated PowerShell prompt:
Restart-Service RustDeskHbbs # the ID server
Restart-Service RustDeskHbbr # the relay
Stop-Service RustDeskHbbr, RustDeskHbbs
Start-Service RustDeskHbbs, RustDeskHbbr
Or use the Services console (services.msc). Start hbbs before hbbr: hbbr loads the key hbbs keeps.
Back up your key. Copy id_ed25519 and id_ed25519.pub from C:\ProgramData\RustDesk Server somewhere safe (for example an Azure Key Vault secret or a protected storage account). If you rebuild the server, stop both services, copy (not move) the two files back into that folder, so they take on its permissions, and start them again, and your clients keep working without being reconfigured.
Change the key. Stop both services, delete id_ed25519 and id_ed25519.pub, and start RustDeskHbbs then RustDeskHbbr: hbbs generates a new pair, and every client must be given the new public key.
Change hbbs or hbbr options (for example -r <relay host> so clients are told a DNS name for the relay): edit the <arguments> line of RustDeskHbbs.xml or RustDeskHbbr.xml in C:\Program Files\RustDesk Server, then restart that service. Keep -k _ on hbbr. The options are listed by & 'C:\Program Files\RustDesk Server\hbbs.exe' --help.
Turn on SSH. OpenSSH Server is installed but stopped and disabled. To use it, start it, then open TCP 22 in the network security group from your own address only (Windows Firewall already has the OpenSSH rule):
Set-Service sshd -StartupType Automatic
Start-Service sshd
Scripts and Log Files
| File | Written by | Holds |
|---|---|---|
C:\ProgramData\RustDesk Server\logs\RustDeskHbbs.out.log |
hbbs | Key generation, listening ports, client registrations |
C:\ProgramData\RustDesk Server\logs\RustDeskHbbr.out.log |
hbbr | The key it loaded, relay sessions |
C:\ProgramData\RustDesk Server\logs\RustDeskHbbs.wrapper.log, RustDeskHbbr.wrapper.log |
WinSW | Service starts, stops and restarts |
| Windows Event Viewer, Windows Logs > Application | WinSW | Service start and stop events |
On Startup
When the VM starts, Windows starts RustDeskHbbs, then RustDeskHbbr (delayed start, and it depends on hbbs). On the very first start of a new VM, hbbs finds no key in C:\ProgramData\RustDesk Server and generates a new Ed25519 key pair there; on every later start it reuses it. Nothing else runs at startup: there is no first-boot script to turn off.
Troubleshooting
The RustDesk client does not show "Ready"
- Check both services are running (Step 3)
- Check the network security group allows TCP 21115-21119 and UDP 21116 from the client's network. UDP 21116 is what clients register on; a rule for TCP only is the most common cause
- Check the Key in the client is exactly the content of
id_ed25519.pub, with no space or line break added
"Key mismatch" when connecting
One of the two clients has another key, or none. Both the controlling and the controlled machine must use the same ID server and key.
Connections are slow or always relayed
Direct connections need UDP hole punching through both sides' NAT. When that fails RustDesk uses the relay on TCP 21117 of this server; relayed sessions use this VM's bandwidth. A larger VM size gives more network bandwidth.
Remote Desktop does not connect
Check the network security group allows TCP 3389 from your current public IP address. If you forgot the password, use Reset password on the VM's page in the Azure portal.
Security Recommendations
- Keep Remote Desktop (TCP 3389) open to your own address range only, or use Azure Bastion
- Open the RustDesk ports only to the networks your clients use where you can; the enforced key keeps out clients without it either way
- Treat
id_ed25519as a secret and back it up (Managing the Services) - Keep Windows updated: Windows Update is on, as in Microsoft's image
- Watch for new RustDesk Server releases at github.com/rustdesk/rustdesk-server/releases. To update, stop both services, replace
hbbs.exe,hbbr.exeandrustdesk-utils.exeinC:\Program Files\RustDesk Serverwith the new release's files, and start the services; the key and database stay inC:\ProgramData\RustDesk Server
Licensing
RustDesk Server OSS is open-source software under the GNU Affero General Public License v3.0; the image ships the unmodified upstream Windows binaries, and the source is at github.com/rustdesk/rustdesk-server. WinSW is under the MIT licence. The Windows Server licence is included in the Azure VM price and billed by Microsoft. cloudimg's hourly charge ($0.04 per vCPU per hour) covers only cloudimg's additions: the packaging and services, the per-VM key set-up, the updates and checks at build, this guide and support.
cloudimg is not affiliated with or endorsed by the RustDesk project. Microsoft and Windows Server are trademarks of the Microsoft group of companies; cloudimg is not affiliated with or endorsed by Microsoft.
Support
cloudimg's support team is on hand 24 hours a day by email (support@cloudimg.co.uk), with a guaranteed response within 24 hours, for this image: deployment, the RustDesk services and keys, Remote Desktop sign-in and Windows updates. You can also reach us at www.cloudimg.co.uk/support.