### Install RustDesk Server Pro with Docker Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/self-host/rustdesk-server-pro/_index.en.md This snippet installs Docker and then deploys RustDesk Server Pro using a Docker Compose file. It's the recommended method for a quick and easy setup. ```bash bash <(wget -qO- https://get.docker.com) wget rustdesk.com/pro.yml -O compose.yml sudo docker compose up -d ``` -------------------------------- ### Install Docker and Run RustDesk Server Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/self-host/rustdesk-server-oss/install/_index.en.md Installs Docker and then deploys RustDesk Server using a compose file. Ensure you have Docker installed first. ```bash bash <(wget -qO- https://get.docker.com) wget rustdesk.com/oss.yml -O compose.yml sudo docker compose up -d ``` -------------------------------- ### Install RustDesk on Windows using Batch Script Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/self-host/client-deployment/_index.en.md This script automates the download, silent installation, and service setup of RustDesk on Windows. It also generates a random password and applies configuration strings. ```bat @echo off REM Assign the value random password to the password variable setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION set alfanum=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 set rustdesk_pw= for /L %%b in (1, 1, 12) do ( set /A rnd_num=!RANDOM! %% 62 for %%c in (!rnd_num!) do ( set rustdesk_pw=!rustdesk_pw!!alfanum:~%%c,1! ) ) REM Get your config string from your Web portal and Fill Below set rustdesk_cfg="configstring" REM ############################### Please Do Not Edit Below This Line ######################################### if not exist C:\Temp\ md C:\Temp\ cd C:\Temp\ curl -L "https://github.com/rustdesk/rustdesk/releases/download/1.2.6/rustdesk-1.2.6-x86_64.exe" -o rustdesk.exe rustdesk.exe --silent-install timeout /t 20 cd "C:\Program Files\RustDesk\" rustdesk.exe --install-service timeout /t 20 for /f "delims=" %%i in ('rustdesk.exe --get-id ^| more') do set rustdesk_id=%%i rustdesk.exe --config %rustdesk_cfg% rustdesk.exe --password %rustdesk_pw% echo ............................................... REM Show the value of the ID Variable echo RustDesk ID: %rustdesk_id% REM Show the value of the Password Variable echo Password: %rustdesk_pw% echo ............................................... ``` -------------------------------- ### Silent Install with Custom Parameters Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/client/windows/MSI/_index.en.md Use this command for a silent installation, specifying the installation path, start menu shortcut, desktop shortcut, and printer installation. Includes detailed logging. ```bash msiexec /i RustDesk-1.msi /qn INSTALLFOLDER="D:\Program Files\RustDesk" CREATESTARTMENUSHORTCUTS="Y" CREATEDESKTOPSHORTCUTS="N" INSTALLPRINTER="N" /l*v install.log ``` -------------------------------- ### Install Docker with a Single Command Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/self-host/rustdesk-server-pro/installscript/Docker/_index.en.md This command installs Docker on a Linux system. It's a convenient way to get Docker up and running for self-hosting RustDesk Server Pro. ```bash bash <(wget -qO- https://get.docker.com) ``` -------------------------------- ### Start RustDesk Services with NSSM Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/self-host/rustdesk-server-oss/windows/_index.en.md Starts the previously installed hbbs and hbbr Windows services. Replace the service names with the ones you defined during installation. ```cmd nssm start nssm start ``` -------------------------------- ### Install RustDesk Server Pro using install.sh Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/self-host/rustdesk-server-pro/installscript/_index.en.md Installs RustDesk Server Pro on Linux by downloading and executing the install script. This method creates native systemd services. Use with caution if unfamiliar with Linux administration. ```bash bash <(wget -qO- https://raw.githubusercontent.com/rustdesk/rustdesk-server-pro/main/install.sh) ``` -------------------------------- ### Install RustDesk Server Pro Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/self-host/rustdesk-server-pro/installscript/Script/_index.en.md Execute this command in your Linux terminal to install RustDesk Server Pro. It handles dependencies, firewall setup, service creation, and optional HTTPS configuration. ```bash wget -qO- https://raw.githubusercontent.com/rustdesk/rustdesk-server-pro/main/install.sh | bash ``` -------------------------------- ### Install Nginx on openSUSE Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/self-host/rustdesk-server-pro/faq/_index.en.md Installs Nginx web server on openSUSE. ```shell sudo zypper install nginx ``` -------------------------------- ### Automated RustDesk Client Deployment with PowerShell Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/self-host/client-deployment/_index.ro.md This script automates the download, silent installation, and service setup of RustDesk. It checks for the latest version on GitHub, installs the client, and configures it with provided credentials. Ensure you run this script with administrator privileges. ```powershell $ErrorActionPreference= 'silentlycontinue' # Assign the value random password to the password variable $rustdesk_pw=(-join ((65..90) + (97..122) | Get-Random -Count 12 | % {[char]$_})) # Get your config string from your Web portal and Fill Below $rustdesk_cfg="configstring" ################################## Please Do Not Edit Below This Line ######################################### # Run as administrator and stays in the current directory if (-Not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { if ([int](Get-CimInstance -Class Win32_OperatingSystem | Select-Object -ExpandProperty BuildNumber) -ge 6000) { Start-Process PowerShell -Verb RunAs -ArgumentList "-NoProfile -ExecutionPolicy Bypass -Command `"cd '$pwd'; & '$PSCommandPath';`""; Exit; } } # This function will return the latest version and download link as an object function getLatest() { $Page = Invoke-WebRequest -Uri 'https://github.com/rustdesk/rustdesk/releases/latest' -UseBasicParsing $HTML = New-Object -Com "HTMLFile" try { $HTML.IHTMLDocument2_write($Page.Content) } catch { $src = [System.Text.Encoding]::Unicode.GetBytes($Page.Content) $HTML.write($src) } # Current example link: https://github.com/rustdesk/rustdesk/releases/download/1.2.6/rustdesk-1.2.6-x86_64.exe $Downloadlink = ($HTML.Links | Where {$_.href -match '(.)+\/rustdesk\/rustdesk\/releases\/download\/\d{1}.\d{1,2}.\d{1,2}(.{0,3})\/rustdesk(.)+x86_64.exe'} | select -first 1).href # bugfix - sometimes you need to replace "about:" $Downloadlink = $Downloadlink.Replace('about:', 'https://github.com') $Version = "unknown" if ($Downloadlink -match './rustdesk/rustdesk/releases/download/(?.*)/rustdesk-(.)+x86_64.exe') { $Version = $matches['content'] } if ($Version -eq "unknown" -or $Downloadlink -eq "") { Write-Output "ERROR: Version or download link not found." Exit } # Create object to return $params += @{Version = $Version} $params += @{Downloadlink = $Downloadlink} $Result = New-Object PSObject -Property $params return($Result) } $RustDeskOnGitHub = getLatest $rdver = ((Get-ItemProperty "HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\RustDesk\").Version) if ($rdver -eq $RustDeskOnGitHub.Version) { Write-Output "RustDesk $rdver is the newest version." Exit } if (!(Test-Path C:\Temp)) { New-Item -ItemType Directory -Force -Path C:\Temp | Out-Null } cd C:\Temp Invoke-WebRequest $RustDeskOnGitHub.Downloadlink -Outfile "rustdesk.exe" Start-Process . ustdesk.exe --silent-install Start-Sleep -seconds 20 $ServiceName = 'Rustdesk' $arrService = Get-Service -Name $ServiceName -ErrorAction SilentlyContinue if ($arrService -eq $null) { Write-Output "Installing service" cd $env:ProgramFiles\RustDesk Start-Process . ustdesk.exe --install-service Start-Sleep -seconds 20 $arrService = Get-Service -Name $ServiceName } while ($arrService.Status -ne 'Running') { Start-Service $ServiceName Start-Sleep -seconds 5 $arrService.Refresh() } cd $env:ProgramFiles\RustDesk\ . ustdesk.exe --get-id | Write-Output -OutVariable rustdesk_id . ustdesk.exe --config $rustdesk_cfg . ustdesk.exe --password $rustdesk_pw Write-Output "...............................................". # Show the value of the ID Variable Write-Output "RustDesk ID: $rustdesk_id" # Show the value of the Password Variable Write-Output "Password: $rustdesk_pw" Write-Output "...............................................". ``` -------------------------------- ### Install and Run RustDesk Flatpak Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/client/linux/_index.en.md Adds the Flathub repository if needed, installs the RustDesk Flatpak package, and then runs it. ```sh flatpak --user remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo flatpak --user install ./rustdesk-.flatpak flatpak run com.rustdesk.RustDesk ``` -------------------------------- ### Install Nginx on Gentoo Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/self-host/rustdesk-server-pro/faq/_index.en.md Installs Nginx web server on Gentoo. ```shell sudo emerge -av nginx ``` -------------------------------- ### Install Debian Package Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/self-host/rustdesk-server-oss/install/_index.en.md Installs RustDesk Server from a downloaded .deb file on Debian-based systems using apt-get or dpkg. ```bash apt-get -f install .deb or dpkg -i .deb ``` -------------------------------- ### Install vcpkg dependencies for Windows Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/dev/build/windows/_index.en.md Clone and bootstrap vcpkg, then install static versions of libvpx, libyuv, opus, and aom for 64-bit Windows. Ensure Git Bash is used for these commands. ```shell git clone https://github.com/microsoft/vcpkg vcpkg/bootstrap-vcpkg.bat export VCPKG_ROOT=$PWD/vcpkg vcpkg/vcpkg install libvpx:x64-windows-static libyuv:x64-windows-static opus:x64-windows-static aom:x64-windows-static ``` -------------------------------- ### Start Hugo Development Server Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/README.md Start the Hugo server to preview the documentation locally. Changes made to the documentation will be reflected in real-time. ```sh hugo server ``` -------------------------------- ### Example Connection Audit Query Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/self-host/rustdesk-server-pro/console/_index.en.md An example command demonstrating how to view connection audits for a specific remote peer within the last 7 days. ```bash ./audits.py --url https://example.com --token view-conn --remote 123456789 --days-ago 7 ``` -------------------------------- ### Install RustDesk Server using Install Script Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/self-host/rustdesk-server-oss/install/_index.en.md Downloads and executes a script to set up RustDesk Server (hbbs and hbbr) as systemd services. The script is hosted on GitHub. ```bash wget https://raw.githubusercontent.com/techahold/rustdeskinstall/master/install.sh chmod +x install.sh ./install.sh ``` -------------------------------- ### Install and Configure vcpkg for Dependencies Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/dev/build/osx/_index.en.md Clones the vcpkg repository, checks out a specific version, bootstraps it, installs core C/C++ dependencies, and sets the VCPKG_ROOT environment variable. ```sh git clone https://github.com/microsoft/vcpkg cd vcpkg git checkout 2023.04.15 ./bootstrap-vcpkg.sh -disableMetrics ./vcpkg install libvpx libyuv opus aom export VCPKG_ROOT=~/repos/vcpkg ``` -------------------------------- ### Run RustDesk Server Pro hbbs and hbbr with Host Networking Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/self-host/rustdesk-server-pro/installscript/Docker/_index.en.md Starts the hbbs and hbbr services as Docker containers using host networking. This setup is recommended for licensing. Ensure the './data:/root' volume is correctly mapped. ```bash sudo docker run --name hbbs -v ./data:/root -td --net=host --restart unless-stopped docker.io/rustdesk/rustdesk-server-pro hbbs sudo docker run --name hbbr -v ./data:/root -td --net=host --restart unless-stopped docker.io/rustdesk/rustdesk-server-pro hbbr ``` -------------------------------- ### Install and Configure vcpkg Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/dev/build/linux/_index.en.md Clones the vcpkg repository, checks out a specific version, bootstraps it, and sets the VCPKG_ROOT environment variable. ```sh git clone --recurse-submodules https://github.com/microsoft/vcpkg cd vcpkg git checkout 2023.10.19 cd .. vcpkg/bootstrap-vcpkg.sh export VCPKG_ROOT=$PWD/vcpkg vcpkg/vcpkg install --x-install-root="$VCPKG_ROOT/installed" ``` -------------------------------- ### Example Hosts File Entry Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/self-host/nat-loopback-issues/_index.en.md An example of how to format an entry in the hosts file across different operating systems to map an IP address to a domain name. ```text 192.168.11.20 rustdesk.example.com ``` -------------------------------- ### Install macOS Build Tools with Homebrew Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/dev/build/osx/_index.en.md Installs necessary development tools such as Python, CMake, and Rustup using Homebrew. Ensure Homebrew is installed and accessible. ```sh brew install python3 create-dmg nasm cmake gcc wget ninja pkg-config wget rustup ``` -------------------------------- ### Install RustDesk on openSUSE Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/client/_index.en.md Install the RustDesk .rpm package on openSUSE (version Leap 15.0 and later) using zypper. Ensure to allow unsigned RPMs. ```bash sudo zypper install --allow-unsigned-rpm ./rustdesk--suse.rpm ``` -------------------------------- ### Install RustDesk in Nix User Profile Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/client/_index.en.md Install RustDesk into the current user's profile using the Nix package manager. ```bash nix profile install nixpkgs#rustdesk ``` -------------------------------- ### Install RustDesk System-Wide on NixOS Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/client/_index.en.md Configure NixOS to install RustDesk system-wide by adding it to the environment.systemPackages in configuration.nix and rebuilding the system. ```nix environment.systemPackages = with pkgs; [ ... rustdesk ]; ``` -------------------------------- ### Install Nginx on Alpine Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/self-host/rustdesk-server-pro/faq/_index.en.md Installs Nginx web server on Alpine Linux. ```shell sudo apk add --no-cache nginx ``` -------------------------------- ### Install RustDesk on Arch Linux/Manjaro Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/client/_index.en.md Install the RustDesk .pkg.tar.zst package on Arch Linux or Manjaro using pacman. ```bash sudo pacman -U ./rustdesk-.pkg.tar.zst ``` -------------------------------- ### Install Certbot using Snap Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/self-host/rustdesk-server-pro/faq/_index.en.md Installs Certbot, a tool for obtaining and renewing SSL certificates, using snap. ```shell sudo snap install certbot --classic ``` -------------------------------- ### Install Nginx on Debian/Ubuntu Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/self-host/rustdesk-server-pro/faq/_index.en.md Installs Nginx web server on Debian or Ubuntu-based systems. ```shell sudo apt-get install nginx ``` -------------------------------- ### Install RustDesk on macOS using Bash Script Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/self-host/client-deployment/_index.en.md This script automates the download, installation, and configuration of RustDesk on macOS. It handles DMG mounting, application copying, and applies a generated password and configuration string. ```sh #!/bin/bash # Assign the value random password to the password variable rustdesk_pw=$(openssl rand -hex 4) # Get your config string from your Web portal and Fill Below rustdesk_cfg="configstring" ################################## Please Do Not Edit Below This Line ######################################### # Root password request for privilege escalation [ "$UID" -eq 0 ] || exec sudo bash "$0" "$@" # Specify the mount point for the DMG (temporary directory) mount_point="/Volumes/RustDesk" # Download the rustdesk.dmg file echo "Downloading RustDesk Now" if [[ $(arch) == 'arm64' ]]; then rd_link=$(curl -sL https://github.com/rustdesk/rustdesk/releases/latest | grep -Eo "(http|https)://[a-zA-Z0-9./?=_-]*/\d{1}.\d{1,2}.\d{1,2}/rustdesk.\d{1}.\d{1,2}.\d{1,2}.aarch64.dmg") dmg_file=$(echo $rd_link | grep -Eo "rustdesk.\d{1}.\d{1,2}.\d{1,2}.aarch64.dmg") curl -L "$rd_link" --output "$dmg_file" else rd_link=$(curl -sL https://github.com/rustdesk/rustdesk/releases/latest | grep -Eo "(http|https)://[a-zA-Z0-9./?=_-]*/\d{1}.\d{1,2}.\d{1,2}/rustdesk.\d{1}.\d{1,2}.\d{1,2}.x86_64.dmg") dmg_file=$(echo $rd_link | grep -Eo "rustdesk.\d{1}.\d{1,2}.\d{1,2}.x86_64.dmg") curl -L "$rd_link" --output "$dmg_file" fi # Mount the DMG file to the specified mount point hdiutil attach "$dmg_file" -mountpoint "$mount_point" &> /dev/null # Check if the mounting was successful if [ $? -eq 0 ]; then # Move the contents of the mounted DMG to the /Applications folder cp -R "$mount_point/RustDesk.app" "/Applications/" &> /dev/null # Unmount the DMG file hdiutil detach "$mount_point" &> /dev/null else echo "Failed to mount the RustDesk DMG. Installation aborted." exit 1 fi # Run the rustdesk command with --get-id and store the output in the rustdesk_id variable cd /Applications/RustDesk.app/Contents/MacOS/ rustdesk_id=$(./RustDesk --get-id) # Apply new password to RustDesk ./RustDesk --server &> /dev/null /Applications/RustDesk.app/Contents/MacOS/RustDesk --password $rustdesk_pw &> /dev/null /Applications/RustDesk.app/Contents/MacOS/RustDesk --config $rustdesk_cfg # Kill all processes named RustDesk rdpid=$(pgrep RustDesk) kill $rdpid &> /dev/null echo "...............................................". # Check if the rustdesk_id is not empty if [ -n "$rustdesk_id" ]; then echo "RustDesk ID: $rustdesk_id" else echo "Failed to get RustDesk ID." fi # Echo the value of the password variable echo "Password: $rustdesk_pw" echo "...............................................". echo "Please complete install on GUI, launching RustDesk now." open -n /Applications/RustDesk.app ``` -------------------------------- ### Install Nginx on Arch Linux Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/self-host/rustdesk-server-pro/faq/_index.en.md Installs Nginx web server on Arch Linux. ```shell sudo pacman -S install nginx ``` -------------------------------- ### Install Nginx on Fedora/CentOS Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/self-host/rustdesk-server-pro/faq/_index.en.md Installs Nginx web server on Fedora or CentOS-based systems using dnf or yum. ```shell sudo dnf install nginx ``` ```shell sudo yum install nginx ``` -------------------------------- ### Install RustDesk on Ubuntu (>= 18) Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/client/linux/_index.en.md Use this command to install the .deb package on Ubuntu and Debian-based systems. Note that this may report incorrect disk usage. ```sh # please ignore the wrong disk usage report sudo apt install -fy ./rustdesk-.deb ``` -------------------------------- ### Install PM2 and PM2 Windows Startup Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/self-host/rustdesk-server-oss/windows/_index.en.md Installs PM2, a process manager for Node.js applications, and the PM2 Windows startup module globally using npm. This is a prerequisite for managing RustDesk server processes with PM2 on Windows. ```cmd npm install -g pm2 npm install pm2-windows-startup -g pm2-startup install ``` -------------------------------- ### Install RustDesk on Red Hat Derivatives Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/client/_index.en.md Install the RustDesk .rpm package on Red Hat-based Linux distributions using yum. ```bash sudo yum localinstall ./rustdesk-.rpm ``` -------------------------------- ### Convert from RustDesk Server Open Source to Pro Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/self-host/rustdesk-server-pro/installscript/Script/_index.en.md Execute this command in your Linux terminal to convert your existing RustDesk Server installation to the Pro version. Ensure you have `wget` installed. ```bash wget -qO- https://raw.githubusercontent.com/rustdesk/rustdesk-server-pro/main/convertfromos.sh | bash ``` -------------------------------- ### Install and Configure Rust Toolchain Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/dev/build/osx/_index.en.md Installs the Rust toolchain using rustup, sets a default Rust version (e.g., 1.75.0), and adds the rustfmt component. Ensure rustup is in your PATH. ```sh rustup-init rustup default 1.75.0 rustup component add rustfmt ``` -------------------------------- ### Set API Server Example Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/self-host/client-configuration/_index.en.md Configure the API Server address for Pro users. If your API server runs on a non-default port or uses HTTPS, specify the full URL. ```text https://hbbs.example.com ``` -------------------------------- ### Import Server Config Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/self-host/client-configuration/_index.en.md Use this option in the RustDesk client to import server configuration settings from the clipboard. This allows for quick setup on new clients. ```text Import Server Config ``` -------------------------------- ### Run RustDesk AppImage on Ubuntu Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/client/linux/_index.en.md Installs the necessary libfuse2 package and then runs the AppImage for portable usage on Ubuntu. ```sh # For Ubuntu sudo yum install libfuse2 ./rustdesk-.AppImage ``` -------------------------------- ### Install and Connect to Exchange Online Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/self-host/rustdesk-server-pro/smtp/microsoft-365/_index.en.md Installs the Exchange Online Management module and connects to your Microsoft 365 tenant. Use this to begin managing Exchange Online settings. ```powershell Install-Module -Name ExchangeOnlineManagement Import-Module ExchangeOnlineManagement Connect-ExchangeOnline ``` -------------------------------- ### Install RustDesk on Debian Derivatives Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/client/_index.en.md Use this command to install the RustDesk .deb package on Debian-based Linux distributions. Note that the disk usage report might be incorrect. ```bash sudo apt install -fy ./rustdesk-.deb ``` -------------------------------- ### Download RustDesk Source and Install Python Dependencies Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/dev/build/osx/_index.en.md Clones the RustDesk repository with submodules and installs Python dependencies using pip. Ensure python3 and pip are in your PATH. ```sh git clone --recurse-submodules https://github.com/rustdesk/rustdesk cd rustdesk/libs/portable/ python3 -m pip install --upgrade pip pip3 install -r requirements.txt ``` -------------------------------- ### Configure SELinux for RustDesk Server Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/self-host/rustdesk-server-pro/faq/_index.en.md Apply SELinux security contexts to RustDesk server binaries if SELinux is causing installation issues. ```shell sudo semanage fcontext -a -t NetworkManager_dispatcher_exec_t 'hbbs' sudo semanage fcontext -a -t NetworkManager_dispatcher_exec_t 'hbbr' sudo restorecon -v '/usr/bin/hbbs' sudo restorecon -v '/usr/bin/hbbr' ``` -------------------------------- ### Install Sciter Dynamic Library Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/dev/build/osx/_index.en.md Download the Sciter dynamic library for macOS. This is a prerequisite for building the Sciter version of RustDesk. ```sh wget https://github.com/c-smile/sciter-sdk/raw/master/bin.osx/libsciter.dylib ``` -------------------------------- ### Run RustDesk AppImage on Fedora Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/client/linux/_index.en.md Installs the necessary libnsl package and then runs the AppImage for portable usage on Fedora. ```sh # For Fedora sudo yum install libnsl ./rustdesk-.AppImage ``` -------------------------------- ### Install RustDesk Services with NSSM Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/self-host/rustdesk-server-oss/windows/_index.en.md Installs the hbbs and hbbr components of RustDesk Server as Windows services using the NSSM utility. Ensure you replace the paths and service names with your specific configuration. ```cmd nssm install "RustDesk hbbs service" "C:\Program Files\RustDesk Server\hbbs.exe" nssm install "RustDesk hbbr service" "C:\Program Files\RustDesk Server\hbbr.exe" ``` -------------------------------- ### Set ID Server Example Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/self-host/client-configuration/_index.en.md Specify the ID Server address, which is typically your hbbs host or IP. You can include the port if it's not the default. ```text hbbs.example.com ``` ```text hbbs.example.com:21116 ``` -------------------------------- ### Silent Upgrade with Modified Parameters Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/client/windows/MSI/_index.en.md Perform a silent upgrade while modifying installation options such as the installation folder, start menu shortcut, desktop shortcut, and printer installation. Includes detailed logging. ```bash msiexec /i RustDesk-1.msi /qn INSTALLFOLDER="C:\Program Files\RustDesk" CREATESTARTMENUSHORTCUTS="N" CREATEDESKTOPSHORTCUTS="N" INSTALLPRINTER="N" /l*v install.log ``` -------------------------------- ### Show Help for Device Management Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/self-host/rustdesk-server-pro/console/_index.en.md Displays available commands and options for the devices.py script. ```bash ./devices.py -h ``` -------------------------------- ### Control RustDesk Services with Systemd Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/self-host/rustdesk-server-pro/faq/_index.en.md Commands to start, stop, and restart RustDesk services (hbbs and hbbr) when installed via script using systemd. ```bash sudo systemctl stop|start|restart rustdesk-hbbs|rustdesk-hbbr ``` ```bash sudo systemctl restart rustdesk-hbbs ``` -------------------------------- ### Deploy RustDesk Client on Windows Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/self-host/client-deployment/_index.en.md Run this command in Command Prompt or PowerShell as Administrator on Windows to deploy a new client. Ensure you have an API token with 'Devices' Read and write permissions. ```bat rustdesk --deploy --token ``` -------------------------------- ### Install Arch Linux Build Dependencies Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/dev/build/linux/_index.en.md Installs required compiler and desktop development packages for Arch Linux (Manjaro). ```sh sudo pacman -Syu --needed unzip git cmake gcc curl wget yasm nasm zip make pkg-config clang gtk3 xdotool libxcb libxfixes alsa-lib pulseaudio ``` -------------------------------- ### Install Fedora Build Dependencies Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/dev/build/linux/_index.en.md Installs necessary compiler and desktop development packages for Fedora 28 (CentOS 8). ```sh sudo yum -y install gcc-c++ git curl wget nasm yasm gcc gtk3-devel clang libxcb-devel libxdo-devel libXfixes-devel pulseaudio-libs-devel cmake alsa-lib-devel ``` -------------------------------- ### Install Ubuntu Build Dependencies Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/dev/build/linux/_index.en.md Installs essential compiler and desktop development packages for Ubuntu 18 (Debian 10). ```sh sudo apt install -y g++ gcc git curl wget nasm yasm libgtk-3-dev clang libxcb-randr0-dev libxdo-dev libxfixes-dev libxcb-shape0-dev libxcb-xfixes0-dev libasound2-dev libpulse-dev cmake ``` -------------------------------- ### Create New User Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/self-host/rustdesk-server-pro/console/_index.en.md Create a new user account with a username, password, and assign them to a group. Email and notes are optional. ```bash ./users.py --url --token new --name username --password 'password123' --group_name Default [--email user@example.com] [--note "note"] ``` -------------------------------- ### Install Certbot Nginx plugin with yum Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/self-host/rustdesk-server-pro/faq/_index.en.md Installs Certbot's Nginx plugin using yum, suitable for CentOS 7. ```shell sudo yum install certbot-nginx ``` -------------------------------- ### Navigate to Documentation Folder Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/README.md Change the current directory to the cloned documentation folder to access its files and run commands. ```sh cd docs.rustdesk.com ``` -------------------------------- ### Deploy RustDesk Client on macOS/Linux Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/self-host/client-deployment/_index.en.md Execute this command with sudo on macOS or Linux to deploy a new client. An API token with 'Devices' Read and write permissions is required. ```sh sudo rustdesk --deploy --token ``` -------------------------------- ### Install Certbot with python3-certbot-nginx Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/self-host/rustdesk-server-pro/faq/_index.en.md Installs Certbot's Nginx plugin using the system's package manager, suitable for Ubuntu. ```shell sudo apt-get install python3-certbot-nginx ``` -------------------------------- ### Show Help for Device Group Management Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/self-host/rustdesk-server-pro/console/_index.en.md Displays available commands and options for the device_group.py script. ```bash ./device_group.py -h ``` -------------------------------- ### Build RustDesk Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/dev/build/linux/_index.en.md Installs Rust via rustup, sources the cargo environment, clones the RustDesk repository, prepares the target directory, downloads the Sciter library, and runs the cargo build command. ```sh curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh source $HOME/.cargo/env git clone --recurse-submodules https://github.com/rustdesk/rustdesk cd rustdesk mkdir -p target/debug wget https://raw.githubusercontent.com/c-smile/sciter-sdk/master/bin.lnx/x64/libsciter-gtk.so mv libsciter-gtk.so target/debug # Note: VCPKG_ROOT still set cargo run ``` -------------------------------- ### Install Flutter Rust Bridge Codegen Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/dev/build/osx/_index.en.md Install the flutter_rust_bridge_codegen tool with a specific version and features. This tool is used to generate code for binding Rust and Flutter. ```sh cargo install flutter_rust_bridge_codegen --version "1.80.1" --features "uuid" ``` -------------------------------- ### Install FVM and Cocoapods Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/dev/build/osx/_index.en.md Install Flutter Version Manager (FVM) and Cocoapods using Homebrew. FVM is used to manage different Flutter SDK versions. ```sh brew tap leoafarias/fvm brew install fvm cocoapods ``` -------------------------------- ### Configure Proxy via .env File Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/self-host/rustdesk-server-pro/license/_index.en.md Alternatively, set the proxy for license verification by adding the proxy setting to the .env file in the working directory. This is useful if you prefer configuration file management. ```bash proxy=http://username:password@example.com:8080 ``` -------------------------------- ### View Help for Users Script Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/self-host/rustdesk-server-pro/console/_index.en.md Display help information for the `users.py` script to understand available commands and options. ```bash ./users.py -h ``` -------------------------------- ### Import RustDesk Configuration File Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/client/_index.en.md Import settings from a RustDesk configuration file (RustDesk2.toml) using the `--import-config` command-line argument. This is an alternative to using encrypted strings. ```bash rustdesk.exe --import-config ``` -------------------------------- ### Build RustDesk on Windows Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/dev/build/windows/_index.en.md Clone the RustDesk repository with submodules, navigate to the directory, download sciter.dll, move it to the target debug directory, and then run the cargo build command. This process assumes all prior dependencies are met. ```shell git clone --recurse-submodules https://github.com/rustdesk/rustdesk cd rustdesk mkdir -p target/debug wget https://raw.githubusercontent.com/c-smile/sciter-sdk/master/bin.win/x64/sciter.dll mv sciter.dll target/debug cargo run ``` -------------------------------- ### Command Line Configuration Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/self-host/client-configuration/_index.en.md Configure RustDesk client using the command line with the `--config` flag. This method is useful for automated deployments or scripting. ```bash rustdesk.exe --config ``` -------------------------------- ### Linux RustDesk Deployment Script Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/self-host/client-deployment/_index.en.md This bash script automates the installation of RustDesk on Debian/Ubuntu or CentOS/RHEL/Fedora systems. It generates a random password, applies a provided configuration string, and restarts the RustDesk service. Ensure you replace 'configstring' with your actual configuration string. ```bash #!/bin/bash # Assign a random value to the password variable rustdesk_pw=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 8 | head -n 1) # Get your config string from your Web portal and Fill Below rustdesk_cfg="configstring" ################################## Please Do Not Edit Below This Line ######################################### # Check if the script is being run as root if [[ $EUID -ne 0 ]]; then echo "This script must be run as root." exit 1 fi # Identify OS if [ -f /etc/os-release ]; then # freedesktop.org and systemd . /etc/os-release OS=$NAME VER=$VERSION_ID UPSTREAM_ID=${ID_LIKE,,} # Fallback to ID_LIKE if ID was not 'ubuntu' or 'debian' if [ "${UPSTREAM_ID}" != "debian" ] && [ "${UPSTREAM_ID}" != "ubuntu" ]; then UPSTREAM_ID="$(echo ${ID_LIKE,,} | sed s/"//g | cut -d' ' -f1)" fi elif type lsb_release >/dev/null 2>&1; then # linuxbase.org OS=$(lsb_release -si) VER=$(lsb_release -sr) elif [ -f /etc/lsb-release ]; then # For some versions of Debian/Ubuntu without lsb_release command . /etc/lsb-release OS=$DISTRIB_ID VER=$DISTRIB_RELEASE elif [ -f /etc/debian_version ]; then # Older Debian, Ubuntu, etc. OS=Debian VER=$(cat /etc/debian_version) elif [ -f /etc/SuSE-release ]; then # Older SuSE etc. OS=SuSE VER=$(cat /etc/SuSE-release) elif [ -f /etc/redhat-release ]; then # Older Red Hat, CentOS, etc. OS=RedHat VER=$(cat /etc/redhat-release) else # Fall back to uname, e.g. "Linux ", also works for BSD, etc. OS=$(uname -s) VER=$(uname -r) fi # Install RustDesk echo "Installing RustDesk" if [ "${ID}" = "debian" ] || [ "$OS" = "Ubuntu" ] || [ "$OS" = "Debian" ] || [ "${UPSTREAM_ID}" = "ubuntu" ] || [ "${UPSTREAM_ID}" = "debian" ]; then wget https://github.com/rustdesk/rustdesk/releases/download/1.2.6/rustdesk-1.2.6-x86_64.deb apt-get install -fy ./rustdesk-1.2.6-x86_64.deb > null elif [ "$OS" = "CentOS" ] || [ "$OS" = "RedHat" ] || [ "$OS" = "Fedora Linux" ] || [ "${UPSTREAM_ID}" = "rhel" ] || [ "$OS" = "Almalinux" ] || [ "$OS" = "Rocky*" ] ; then wget https://github.com/rustdesk/rustdesk/releases/download/1.2.6/rustdesk-1.2.6-0.x86_64.rpm yum localinstall ./rustdesk-1.2.6-0.x86_64.rpm -y > null else echo "Unsupported OS" # here you could ask the user for permission to try and install anyway # if they say yes, then do the install # if they say no, exit the script exit 1 fi # Run the rustdesk command with --get-id and store the output in the rustdesk_id variable rustdesk_id=$(rustdesk --get-id) # Apply new password to RustDesk rustdesk --password $rustdesk_pw &> /dev/null rustdesk --config $rustdesk_cfg systemctl restart rustdesk echo "...............................................") # Check if the rustdesk_id is not empty if [ -n "$rustdesk_id" ]; then echo "RustDesk ID: $rustdesk_id" else echo "Failed to get RustDesk ID." fi # Echo the value of the password variable echo "Password: $rustdesk_pw" echo "...............................................") ``` -------------------------------- ### PowerShell Script for RustDesk Client Deployment Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/self-host/client-deployment/_index.en.md This script automates the deployment of RustDesk clients on Windows. It checks for the latest version, downloads and installs it, manages the RustDesk service, and configures the client with a provided configuration string and a randomly generated or custom password. It also outputs the client ID and password. ```powershell $ErrorActionPreference= 'silentlycontinue' # Assign the value random password to the password variable $rustdesk_pw=(-join ((65..90) + (97..122) | Get-Random -Count 12 | % {[char]$_})) # Get your config string from your Web portal and Fill Below $rustdesk_cfg="configstring" ################################## Please Do Not Edit Below This Line ######################################### # Run as administrator and stays in the current directory if (-Not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { if ([int](Get-CimInstance -Class Win32_OperatingSystem | Select-Object -ExpandProperty BuildNumber) -ge 6000) { Start-Process PowerShell -Verb RunAs -ArgumentList "-NoProfile -ExecutionPolicy Bypass -Command \"cd '$pwd'; & '$PSCommandPath';\""; Exit; } } # This function will return the latest version and download link as an object function getLatest() { $Page = Invoke-WebRequest -Uri 'https://github.com/rustdesk/rustdesk/releases/latest' -UseBasicParsing $HTML = New-Object -Com "HTMLFile" try { $HTML.IHTMLDocument2_write($Page.Content) } catch { $src = [System.Text.Encoding]::Unicode.GetBytes($Page.Content) $HTML.write($src) } # Current example link: https://github.com/rustdesk/rustdesk/releases/download/1.2.6/rustdesk-1.2.6-x86_64.exe $Downloadlink = ($HTML.Links | Where {$_.href -match '(.)+\/rustdesk\/rustdesk\/releases\/download\/\d{1}.\d{1,2}.\d{1,2}(.{0,3})\/rustdesk(.)+x86_64.exe'} | select -first 1).href # bugfix - sometimes you need to replace "about:" $Downloadlink = $Downloadlink.Replace('about:', 'https://github.com') $Version = "unknown" if ($Downloadlink -match './rustdesk/rustdesk/releases/download/(?.*)/rustdesk-(.)+x86_64.exe') { $Version = $matches['content'] } if ($Version -eq "unknown" -or $Downloadlink -eq "") { Write-Output "ERROR: Version or download link not found." Exit } # Create object to return $params += @{Version = $Version} $params += @{Downloadlink = $Downloadlink} $Result = New-Object PSObject -Property $params return($Result) } $RustDeskOnGitHub = getLatest $rdver = ((Get-ItemProperty "HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\RustDesk\").Version) if ($rdver -eq $RustDeskOnGitHub.Version) { Write-Output "RustDesk $rdver is the newest version." Exit } if (!(Test-Path C:\Temp)) { New-Item -ItemType Directory -Force -Path C:\Temp | Out-Null } cd C:\Temp Invoke-WebRequest $RustDeskOnGitHub.Downloadlink -Outfile "rustdesk.exe" Start-Process . ustdesk.exe --silent-install Start-Sleep -seconds 20 $ServiceName = 'Rustdesk' $arrService = Get-Service -Name $ServiceName -ErrorAction SilentlyContinue if ($arrService -eq $null) { Write-Output "Installing service" cd $env:ProgramFiles\RustDesk Start-Process . ustdesk.exe --install-service Start-Sleep -seconds 20 $arrService = Get-Service -Name $ServiceName } while ($arrService.Status -ne 'Running') { Start-Service $ServiceName Start-Sleep -seconds 5 $arrService.Refresh() } cd $env:ProgramFiles\RustDesk\ . ustdesk.exe --get-id | Write-Output -OutVariable rustdesk_id . ustdesk.exe --config $rustdesk_cfg . ustdesk.exe --password $rustdesk_pw Write-Output "...............................................") # Show the value of the ID Variable Write-Output "RustDesk ID: $rustdesk_id" # Show the value of the Password Variable Write-Output "Password: $rustdesk_pw" Write-Output "...............................................") ``` -------------------------------- ### Enable Automatic Disconnect Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/self-host/client-configuration/advanced-settings/_index.en.md Automatically disconnects incoming sessions after a period of user inactivity. This setting requires installation. ```INI allow-auto-disconnect=Y ``` -------------------------------- ### Assign User to Device via Command Line Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/self-host/rustdesk-server-pro/console/_index.en.md Use the RustDesk executable with the --assign parameter to assign a user to a device. Ensure you have a valid API token with user assignment permissions. ```bash "C:\\Program Files\\RustDesk\\rustdesk.exe" --assign --token --user_name ``` -------------------------------- ### Control Connection with Window Open Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/self-host/client-configuration/advanced-settings/_index.en.md Restricts incoming connections to only occur when the RustDesk window is open. This setting requires installation. ```INI allow-only-conn-window-open=N ``` -------------------------------- ### Command Line Parameters for Device Assignment Source: https://github.com/rustdesk/doc.rustdesk.com/blob/master/content/self-host/rustdesk-server-pro/console/_index.en.md This table lists the supported command-line parameters for assigning users, strategies, address books, and device groups to a device using the RustDesk executable. ```bash Parameter | Description | RustDesk Server Pro | RustDesk Client \ --user_name | Assign a user to the device | | \ --strategy_name | Assign a strategy to the device | | \ --address_book_name | Assign device to an address book | | \ --address_book_tag | Assign with address book tag | | \ --address_book_alias | Assign with address book alias | 1.5.8 | 1.4.1 \ --address_book_password | Set password for the address book entry | 1.6.6 | 1.4.3 \ --address_book_note | Set note for the address book entry | 1.6.6 | 1.4.3 \ --device_group_name | Assign device to a device group | | \ --note | Add note to the device | 1.6.6 | 1.4.3 \ --device_username | Set the device username | 1.6.6 | 1.4.3 \ --device_name | Set the device name | 1.6.6 | 1.4.3 \ [--deploy](/docs/en/self-host/client-deployment/#explicit-deployment-for-new-devices) | Register a new device when **Require deployment for new devices** is enabled. Requires an API token with **Devices** permission set to **Read and write**. | 1.8.3 | 1.4.7 ```