This repository provides a PowerShell script that automatically downloads, configures, and launches the RustDesk Windows x64 portable client, using only your self-hosted ID server and public key.
It is ideal for:
- π§ Mass deployment (RMM, GPO, Intune, etc.)
- π§° Technicians who need a ready-to-use portable RustDesk client
- πΌ Environments where software installation is restricted
Note
This script configures the client only.
It does not install or manage a RustDesk server.
For server setup, refer to the official RustDesk documentation.
Official PowerShell script (published as a Gist):
π RustDeskPortable.ps1:
https://gist.github.com/michele-tn/8a824d6257147718fd8384da0fa13f7a
You can:
- download it as a single
.ps1file, - include it in deployment packages,
- or run it remotely using PowerShell (
Invoke-WebRequest,Invoke-RestMethod, etc.)
- π Automatically fetches the latest RustDesk release tag from GitHub.
- πΎ Downloads the corresponding Windows x64 portable executable.
- βοΈ Creates a valid RustDesk configuration file with:
rendezvous_serverkey
- π§± Uses the official RustDesk config path for the current user:
%AppData%\RustDesk\config\RustDesk2.toml - πͺΆ No installation required β fully portable.
- π§Ύ Logs download and update information.
βΆοΈ Launches RustDesk automatically once configured.
-
Operating System:
Windows 10 / 11 (64-bit) -
PowerShell:
- Windows PowerShell 5.1+ or
- PowerShell 7+
-
Network:
Outbound HTTPS access to:api.github.comgithub.com
-
Server:
Self-hosted RustDesk hbbs (ID server) and a valid public key (id_ed25519.pub).
param(
[string]$ServerIP = "192.168.1.100", # ID server (hbbs)
[string]$Key = "MY_PUBLIC_KEY" # Full contents of id_ed25519.pub
)- ServerIP β Address or hostname of your RustDesk ID server (hbbs)
- Key β The full public key string used by your RustDesk server
The script writes this configuration file to:
%AppData%\RustDesk\config\RustDesk2.toml
Example contents:
rendezvous_server = 'rustdesk.yourdomain.com'
nat_type = 1
serial = 0
[options]
custom-rendezvous-server = 'rustdesk.yourdomain.com'
key = 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMyExampleKey1234567890...'Only ID server and key are configured β no relay or API server entries are set.
- Detects the script execution directory.
- Creates a clean portable folder (
RustDeskPortable) and user config directory. - Fetches the latest tag from the official RustDesk GitHub repository.
- Locates the Windows x64 portable executable (no installer, no server build).
- Downloads and verifies it.
- Generates a RustDesk2.toml file with your provided
ServerIPandKey. - Updates the local
update.logwith tag and timestamp. - Starts RustDesk automatically, ready to connect.
Invoke-WebRequest `
-Uri "https://gist.github.com/michele-tn/8a824d6257147718fd8384da0fa13f7a/raw/RustDeskPortable.ps1" `
-OutFile "RustDeskPortable.ps1"powershell.exe -ExecutionPolicy Bypass -File .\RustDeskPortable.ps1 `
-ServerIP "rustdesk.yourdomain.com" `
-Key "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMyExampleKey1234567890..."Or as a one-liner for deployment systems (RMM / GPO / Intune):
powershell.exe -ExecutionPolicy Bypass -NoProfile `
-File "C:\Tools\RustDesk\RustDeskPortable.ps1" `
-ServerIP "rustdesk.yourdomain.com" `
-Key "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMyExampleKey1234567890..."After successful execution:
- β
RustDeskPortable\rustdesk.exedownloaded - β
RustDeskPortable\update.logupdated - β
%AppData%\RustDesk\config\RustDesk2.tomlcreated - π RustDesk automatically launched and ready to use
You can automate this for:
-
Group Policy (GPO):
Assign as a startup/logon script -
RMM / MDM / Intune:
Deploy remotely with PowerShell scripting -
USB Toolkit:
Carry and run from a USB drive for field operations
| Problem | Cause | Solution |
|---|---|---|
| Download fails | GitHub not reachable | Check proxy/firewall or GitHub access |
| No portable exe found | GitHub release format changed | Verify latest release manually |
| Config not applied | Existing TOML not replaced | Script removes old config automatically |
| Connection error | Wrong ServerIP or invalid Key |
Double-check your RustDesk server setup |
- Keep your public/private key pairs secure.
- Use HTTPS for your RustDesk server.
- Verify script integrity before deploying.
- Restrict outbound access to trusted domains only.
This script is provided "as-is", with no warranty.
Always test it in a controlled environment before mass deployment.
Author: Michele TN (original Gist)