docs tidy etc

This commit is contained in:
daniel
2023-08-21 20:46:01 +01:00
parent 0e2eda8d14
commit b08f401daf
244 changed files with 1108 additions and 1160 deletions

View File

@@ -0,0 +1,113 @@
---
title: Windows und PM2 oder NSSM
weight: 20
---
## Optionen
Sie haben nun zwei Möglichkeiten, Sie können entweder PM2 (einfacher) oder NSSM (etwas schwieriger) verwenden, um den RustDesk-Server zu starten.
Die Verwendung von NSSM hat einige Vorteile:
- Abwärtskompatibilität mit älteren Windows-Versionen (Windows Server 2008 R2/Windows 7 und früher, obwohl nicht getestet).
- Ideal für Windows-Server
- Automatischer Start beim Booten ohne Anmeldung (Der Benutzer, der den Starteintrag erstellt hat, muss sich nicht anmelden, damit es startet).
- Beide Binärdateien werden als Dienste ausgeführt.
- Eigenständig (keine Abhängigkeit von Node.js)
Die Vorteile von PM2 sind unter anderem:
- Eine gute Idee, wenn Sie den Server auf demselben Computer wie Ihren Hauptarbeitsrechner betreiben.
- Sie melden sich regelmäßig mit dem Benutzer an, der den RustDesk-Starteintrag erstellt hat.
- Mehr Benutzerfreundlichkeit
## Installation mit NSSM
### Installation von NSSM
Bitte laden Sie [NSSM](https://nssm.cc/release/nssm-2.24.zip) herunter, extrahieren Sie es und wählen
Sie die entsprechende Architektur für Ihr Windows-System (für x86 verwenden Sie den Inhalt des
win32-Ordners, für x64 den Inhalt des win64-Ordners). Es ist auch sinnvoll, die Binärdatei von NSSM
nach `Program Files\NSSM` zu verschieben (Wenn NSSM einmal als Dienst gestartet wurde, kann es nicht
mehr aus dem Ordner verschoben werden, in dem es abgelegt wurde). Daher ist es am besten, sie
im Ordner "Program Files" Ihres Installationslaufwerks (in der Regel das Laufwerk C) zu verstauen.
Es ist auch ratsam, den Pfad (z. B. `C:\Program Files\NSSM`) in die Pfadvariable aufzunehmen.
### Prüfen, ob NSSM korrekt installiert ist
Wenn Sie alles richtig gemacht haben, sollte der Ordner `C:\Program Files\NSSM` (der Pfad ist frei wählbar)
nur die Datei `nssm.exe` enthalten.
In dieser Anleitung wird `C:\Program Files\NSSM` verwendet.
Öffnen Sie die Eingabeaufforderung und führen Sie `nssm` aus. Wenn Sie eine Hilfeseite sehen, können Sie mit dem nächsten Schritt fortfahren.
### hbbr und hbbs ausführen
Laden Sie die Windows-Version von [Serverprogramm](https://github.com/rustdesk/rustdesk-server/releases) herunter.
Entpacken Sie das Programm nach `C:\Program Files\RustDesk Server` oder wo immer Sie wollen. Stellen Sie nur sicher,
dass sich der Ort nach der Installation des Dienstes nicht ändert. Gehen Sie nun zurück zur Eingabeaufforderung.
In diesem Beispiel verwenden wir `C:\Program Files\RustDesk Server`.
```cmd
nssm install "RustDesk hbbs service" "C:\Program Files\RustDesk Server\hbbs.exe" -r 0.0.0.0 -k _
nssm install "RustDesk hbbr service" "C:\Program Files\RustDesk Server\hbbr.exe" -k _
```
**Hinweise:**
- Sie können `RustDesk hbbs service` in einen beliebigen Namen für den Dienst hbbs ändern.
- Sie können `RustDesk hbbr service` in einen beliebigen Namen für den Dienst hbbr ändern.
- Sie können `C:\Programme\RustDesk Server\hbbs.exe` in den Ort ändern, an dem Sie die RustDesk-Binärdateien abgelegt haben.
- Sie können `C:\Programme\RustDesk Server\hbbr.exe` in den Ort ändern, an dem Sie die RustDesk-Binärdateien abgelegt haben.
- Die Option `-k _` ist optional und dient nur der Sicherheit.
**Befehlsvorlagen:**
Die Befehlsvorlage ist für den Fall, dass Sie nur kopieren, einfügen und bearbeiten möchten.
```cmd
nssm install <Gewünschter hbbs-Dienstname> <RustDesk hbbs-Programmpfad> <RustDesk hbbs-Parameter>
nssm install <Gewünschter hbbr-Dienstname> <RustDesk hbbr-Programmpfad> <RustDesk hbbr-Parameter>
```
**Dienste starten**
Nach erfolgreicher Installation der Dienste müssen diese gestartet werden.
```cmd
nssm start <Gewünschter hbbs-Dienstname>
nssm start <Gewünschter hbbr-Dienstname>
```
**Fertig!**
(Die obige Methode wurde auf einem Windows Server Core 2022 Standard getestet).
## oder
## Installation mit PM2
### Node.js installieren
Bitte Node.js [herunterladen](https://nodejs.org/dist/v16.14.2/node-v16.14.2-x86.msi) und installieren.
Node.js ist die Laufzeitumgebung von PM2, Sie müssen also zuerst Node.js installieren.
### PM2 installieren
Öffnen Sie die Eingabeaufforderung und führen Sie Zeile für Zeile mit <kbd>Enter</kbd> aus.
```cmd
npm install -g pm2
npm install pm2-windows-startup -g
pm2-startup install
```
### hbbr und hbbs ausführen
Laden Sie die Windows-Version von [RustDesk Server](https://github.com/rustdesk/rustdesk-server/releases) herunter. Entpacken Sie das Programm auf Laufwerk C:. Führen Sie die folgenden vier Befehle aus und achten Sie darauf, den Parameter `-r` zu bearbeiten:
```cmd
cd c:\rustdesk-server-windows-x64
pm2 start hbbs.exe -- -r <Der Host, auf dem hbbr läuft>
pm2 start hbbr.exe
pm2 save
```
### Protokoll anzeigen
```cmd
pm2 log hbbr
pm2 log hbbs
```

View File

@@ -0,0 +1,113 @@
---
title: Windows & PM2 or NSSM
weight: 20
---
## A cross roads
You now either have two choices, you can either use PM2 (easier) or NSSM (a bit harder) to start the RustDesk server
There are some benefits to using NSSM:
- Backwards compatibility with older Windows (Windows Server 2008R2/Windows 7 and earlier although untested).
- Ideal for Windows Server
- Auto start on boot without login (The user who created the startup entry does not need to log on for it to start).
- Running both binaries as Services.
- Standalone (no dependency on Node.js)
While the benefits of PM2 include:
- Good idea if you run the server on the same computer as your main work computer
- You logon regularly to the user that created the rustdesk startup entry
- More user friendly
## Installing using NSSM
### Installing NSSM
Please [download](https://nssm.cc/release/nssm-2.24.zip) and extract NSSM select the appropriate
architecture to your Windows system (if x86 use the contents of the win32 folder, if x64 use the
contents of win64 folder). It is also best practice to move the binary of NSSM into the
`Program Files\NSSM` (NSSM once started as a service, it cannot be moved from the directory it was placed in.
thus it is best to tuck it away in Program files) directory of your Installation drive (Usually the C drive).
It is also advisable to add the path (such as `C:\Program Files\NSSM`) to the path variable.
### Checking if NSSM is installed properly
If you've done everything correctly the folder `C:\Program Files\NSSM` (in this example I use the C:
drive but you can use whatever drive you installed Windows to or whatever path you desire) should
only contain the file `nssm.exe`.
We will be using `C:\Program Files\NSSM` in this example
Open Command prompt and run `nssm` if you see a help page you are ready to move onto the next step
### Run hbbr and hbbs
Download the Windows version of [server program](https://github.com/rustdesk/rustdesk-server/releases).
Unzip the program to the `C:\Program Files\RustDesk Server` (or anywhere you desire just make sure it
doesn't change after the service is installed). now get back to Command prompt
We will be using `C:\Program Files\RustDesk Server` in this example
```cmd
nssm install "RustDesk hbbs service" "C:\Program Files\RustDesk Server\hbbs.exe" -r 0.0.0.0 -k _
nssm install "RustDesk hbbr Service" "C:\Program Files\RustDesk Server\hbbr.exe" -k _
```
**Note:**
- You can change `RustDesk hbbs service` to whatever you desire to name hbbs the service
- You can change `RustDesk hbbr service` to whatever you desire to name hbbr the service
- You can change `C:\Program Files\RustDesk Server\hbbs.exe` to wherever you placed the RustDesk binaries
- You can change `C:\Program Files\RustDesk Server\hbbr.exe` to wherever you placed the RustDesk binaries
- You do not need the `-k _` option which is optional, it's just for better security
**Command templates:**
The command template in case you just want to copy and paste and edit.
```cmd
nssm install <Desired hbbs servicename> <RustDesk hbbs binary path> <RustDesk hbbs arguments>
nssm install <Desired hbbr servicename> <RustDesk hbbr binary path> <RustDesk hbbr arguments>
```
**Start services**
After successful installation of services, they need to be started.
```cmd
nssm start <Desired hbbs servicename>
nssm start <Desired hbbr servicename>
```
**Done!**
(The method above has been tested on Windows Server Core 2022 Standard).
## or
## Installing using PM2
### Install Node.js
Please [download](https://nodejs.org/dist/v16.14.2/node-v16.14.2-x86.msi) and install Node.js.
Node.js is the runtime environment of PM2, so you need to install Node.js first。
### Install PM2
Enter belows in `cmd.exe`, press the <kbd>Enter</kbd> key for each line, and run them line by line.
```cmd
npm install -g pm2
npm install pm2-windows-startup -g
pm2-startup install
```
### Run hbbr and hbbs
Download the Windows version of [server program](https://github.com/rustdesk/rustdesk-server/releases). Unzip the program to the C: drive. Run the following four commands (take care to edit the `-r` parameter):
```cmd
cd c:\rustdesk-server-windows-x64
pm2 start hbbs.exe -- -r <The host where hbbr is running>
pm2 start hbbr.exe
pm2 save
```
### View the log
```cmd
pm2 log hbbr
pm2 log hbbs
```

View File

@@ -0,0 +1,32 @@
---
title: Windows & pm2
weight: 20
---
### Instalar NodeJs
Por favor [Download](https://nodejs.org/dist/v16.14.2/node-v16.14.2-x86.msi) e instalar
NodeJs es el entorno de tiempo de ejecución de pm2, por lo que primero debe instalar NodeJs。
### Instalar pm2
Ingrese los siguientes en cmd.exe, presione la tecla Intro para cada línea y ejecútelos línea por línea.
```
npm install -g pm2
npm install pm2-windows-startup -g
pm2-startup install
```
### Ejecutar hbbr y hbbs
Descargue la versión de Windows de [server program](https://github.com/rustdesk/rustdesk-server/releases), suponiendo que lo descomprima en la unidad C. Ejecute las siguientes cuatro líneas de comandos respectivamente.
```
cd c:\rustdesk-server-windows-x64
pm2 start hbbs.exe -- -r <The address of the host where hbbr is running>
pm2 start hbbr.exe
pm2 save
```
### Ver registro
```
pm2 log hbbr
pm2 log hbbs
```

View File

@@ -0,0 +1,32 @@
---
title: Windows & pm2
weight: 20
---
### Installer NodeJs
Veuillez [Télécharger](https://nodejs.org/dist/v16.14.2/node-v16.14.2-x86.msi) et installer.
NodeJs est l'environnement d'exécution de pm2, vous devez donc d'abord installer NodeJs。
### Installer pm2
Entrez ci-dessous dans cmd.exe, appuyez sur la touche Entrée pour chaque ligne et exécutez-les ligne par ligne.
```
npm install -g pm2
npm install pm2-windows-startup -g
pm2-startup install
```
### Exécutez hbbr et hbbs
Téléchargez la version Windows du [programme serveur](https://github.com/rustdesk/rustdesk-server/releases), en supposant que vous la décompressez sur le lecteur C. Exécutez respectivement les quatre lignes de commandes suivantes.
```
cd c:\rustdesk-server-windows-x64
pm2 start hbbr.exe
pm2 start hbbs.exe -- -r <L'adresse de l'hôte sur lequel hbbr est exécuté>
pm2 save
```
### Afficher le journal
```
pm2 log hbbr
pm2 log hbbs
```

View File

@@ -0,0 +1,6 @@
---
title: Windows & pm2
weight: 20
---
[English](/docs/en/self-host/windows)

View File

@@ -0,0 +1,32 @@
---
title: Windows & pm2
weight: 20
---
### NodeJs をインストール
[ダウンロード](https://nodejs.org/dist/v16.14.2/node-v16.14.2-x86.msi) してインストールしてください。
NodeJs は pm2 の実行環境ですので先にNodeJsをインストールする必要があります。
### pm2 をインストール
cmd.exe に下記を入力し1行ごとにEnterキーを押して1行ずつ実行します。
```
npm install -g pm2
npm install pm2-windows-startup -g
pm2-startup install
```
### hbbr と hbbs を実行
Windows版のサーバープログラムをダウンロードします。Cドライブに解凍するのであれば以下の4行のコマンドをそれぞれ実行します。
```
cd c:\rustdesk-server-windows-x64
pm2 start hbbs.exe -- -r <The address of the host where hbbr is running>
pm2 start hbbr.exe
pm2 save
```
### ログを確認
```
pm2 log hbbr
pm2 log hbbs
```

View File

@@ -0,0 +1,112 @@
---
title: Windows & pm2 of NSSM
weight: 20
---
## Een kruispunt
Je hebt nu twee keuzes, je kunt pm2 (makkelijker) of NSSM (iets moeilijker) gebruiken om de rustdesk server te starten.
Er zijn enkele voordelen aan het gebruik van NSSM:
- Achterwaartse compatibiliteit met oudere versies van Windows (Windows Server 2008R2/Windows 7 en eerder, hoewel niet getest).
- Ideaal voor Windows Server
- Automatisch starten bij het opstarten van de computer zonder inloggen (de gebruiker die het opstartgegeven heeft aangemaakt, hoeft niet in te loggen om het op te starten).
- Beide systemen draaien als Services.
- Alleenstaand (geen afhankelijkheid van nodejs)
Terwijl de voordelen van pm2 zijn:
- Goed idee als je de server op dezelfde computer draait als je werkcomputer.
- U logt regelmatig in op de gebruiker die de rustdesk opstart invoer heeft aangemaakt
- Gebruiksvriendelijker
## Installeren met NSSM
### NSSM Installeren
Ga naar [download](http://nssm.cc/release/nssm-2.24.zip) en pak NSSM uit, selecteer de juiste
architectuur van uw Windows systeem ( indien x86, gebruik de inhoud van de win32 map, indien x64, gebruik de
inhoud van de win64-map). Het is ook het beste om de bestanden van NSSM in de map
`Program Files\NSSM` (als NSSM als service is gestart, kan het niet meer verplaatst worden uit de map waarin het is geplaatst.
U kunt het dus het beste onderbrengen in de map Program files) van uw installatiestation (meestal station C).
Het is ook raadzaam om het path (zoals `C:\Program Files\NSSM`) toe te voegen aan de path variabele.
### Controleren of NSSM goed is aangemaakt
Als je alles goed hebt gedaan moet de map `C:\Program Files\NSSM` (in dit voorbeeld gebruik ik de C:
schijf, maar je kunt de schijf gebruiken waarop je Windows hebt staan of welk ander path je wilt).
alleen het bestand `nssm.exe` bevatten.
In dit voorbeeld gebruiken we `C:\Program Files\NSSM`.
Open het Commando prompt (CMD) en voer `nssm` uit, als je een help pagina ziet bent je klaar om naar de volgende stap te gaan
### Voer hbbr en hbbs uit
Download de Windows versie van het [serverprogramma] (https://github.com/rustdesk/rustdesk-server/releases).
Unzip het programma naar `C:\Program Files\RustDesk Server` (of waar je maar wilt, zorg ervoor dat
het niet verandert nadat de service is ingesteld). Ga nu terug naar de Command prompt
In dit voorbeeld gebruiken we `C:\Program Files\RustDesk Server`.
```cmd
nssm install "RustDesk hbbs service" "C:\Program Files\RustDesk Server\hbbs.exe" -r 0.0.0.0 -k _
nssm install "RustDesk hbbr Service" "C:\Program Files\RustDesk Server\hbbr.exe" -k _
```
**Merk op:**
- U kunt `RustDesk hbbs service` wijzigen in wat u wenst om de service hbbs te benoemen
- U kunt `RustDesk hbbr service` aanpassen in wat u wenst om hbbr de service te noemen.
- U kunt `C:\Program Files\RustDesk Server\hbbs.exe` veranderen naar waar u de rustdesk bestanden heeft geplaatst.
- U kunt `C:\Program Files\RustDesk Serverhbbr.exe` veranderen naar waar u de rustdesk bestanden hebt geplaatst
- U hebt de optie `-k _` niet nodig, die is optioneel, het is alleen voor een betere beveiliging
**Commando-sjablonen:**
De commando-sjabloon voor het geval u alleen maar wenst te kopieren en plakken, en te bewerken.
```cmd
nssm install <Desired hbbs servicename> <RustDesk hbbs binary path> <RustDesk hbbs arguments>
nssm install <Desired hbbr servicename> <RustDesk hbbr binary path> <RustDesk hbbr arguments>
```
**Start services**
Na een geslaagde installatie van de services moeten ze worden gestart.
```cmd
nssm start <Desired hbbs servicename>
nssm start <Desired hbbr servicename>
```
**Klaar !**
(De bovenstaande methode is getest op Windows Server Core 2022 Standaard).
## of
## Installeren met pm2
### Installeer NodeJs
Ga naar [download](https://nodejs.org/dist/v16.14.2/node-v16.14.2-x86.msi) en installeer Node.js.
NodeJs is de runtime-omgeving van pm2, dus u moet NodeJs eerst installeren。
### Installeer pm2
Voer de onderstaande regels in `cmd.exe` in, druk op de <kbd>Enter</kbd> toets voor elke regel, en voer ze regel voor regel uit.
```cmd
npm install -g pm2
npm install pm2-windows-startup -g
pm2-startup install
```
### Voer hbbr en hbbs uit
Download de Windows-versie van het [serverprogramma] (https://github.com/rustdesk/rustdesk-server/releases). Unzip het programma naar de C: drive. Voer de volgende vier commando's uit (let op de `-r` parameter):
```cmd
cd c:\rustdesk-server-windows-x64
pm2 start hbbs.exe -- -r <De host waar hbbr draait>
pm2 start hbbr.exe
pm2 save
```
### Bekijk het logbestand
```cmd
pm2 log hbbr
pm2 log hbbs
```

View File

@@ -0,0 +1,6 @@
---
title: Windows & pm2
weight: 20
---
[English](/docs/en/self-host/windows)

View File

@@ -0,0 +1,34 @@
---
title: Установка на Windows
weight: 20
---
### Установка Node.js
Скачайте [Node.js](https://nodejs.org/dist/v16.14.2/node-v16.14.2-x86.msi) и установите.
Node.js - это среда исполнения для pm2。
### Установка pm2
В консоли (cmd, PowerShell, и т.п.) используйте команды:
```
npm install -g pm2
npm install pm2-windows-startup -g
pm2-startup install
```
### Запуск hbbr и hbbs
Скачайте версию [сервера](https://github.com/rustdesk/rustdesk-server/releases) для Windows.
В консоли (cmd, PowerShell, и т.п.) используйте команды:
```
cd <каталог с распакованными файлами сервера>
pm2 start hbbs.exe -- -r <адрес ретранслятора>
pm2 start hbbr.exe
pm2 save
```
### Просмотр журнала
```
pm2 log hbbr
pm2 log hbbs
```

View File

@@ -0,0 +1,108 @@
---
title: WINDOWS & PM2 或者 NSSM
weight: 20
---
## 选择哪个?
现在您有两种选择,可以使用 PM2更简单或 NSSM更难来启动 RustDesk 服务器
使用 NSSM 有一些好处:
- 向后兼容旧版 WindowsWindows Server 2008R2/Windows 7 及更早版本,但未经测试)。
- 适用于 Windows 服务器
- 无需登录即可启动自动启动(创建启动项的用户无需登录即可启动)。
- 将两个二进制文件作为服务运行。
- 独立(不依赖 Node.js
PM2 的好处包括:
- 如果您在与主要工作计算机相同的计算机上运行服务器,这是个好主意
- 您定期登录创建 rustdesk 启动项的用户
- 更加用户友好
## 使用 NSSM 安装
### 安装 NSSM
请[下载](https://nssm.cc/release/nssm-2.24.zip)并解压NSSM选择合适的
体系结构到您的 Windows 系统(如果 x86 使用 win32 文件夹的内容,如果 x64 使用
win64 文件夹的内容)。 将 NSSM 的二进制文件移至
`Program Files\NSSM`NSSM 一旦作为服务启动,就无法从其所在的目录中移动。
因此最好将其存放在安装驱动器(通常是 C 驱动器)的 Program files目录中。
还建议将路径(例如`C:\Program Files\NSSM`)添加到路径变量中。
### 检查 NSSM 是否安装正确
如果您已正确完成所有操作,则文件夹`C:\Program Files\NSSM`(在本例中我使用 C:
驱动器,但您可以使用安装 Windows 的任何驱动器或您想要的任何路径)
仅包含文件`nssm.exe`
在本例中我们将使用`C:\Program Files\NSSM`
打开命令提示符并运行`nssm`,如果您看到帮助页面,则您已准备好进入下一步
### 运行 hbbr 和 hbbs
下载Windows版本的[服务器程序](https://github.com/rustdesk/rustdesk-server/releases)。
将程序解压缩到`C:\Program Files\RustDesk Server`(或您想要的任何地方,只需确保它
安装服务后不会改变)。 现在回到命令提示符
在此示例中,我们将使用`C:\Program Files\RustDesk Server`
```cmd
nssm install "RustDesk hbbs service" "C:\Program Files\RustDesk Server\hbbs.exe" -r 0.0.0.0 -k _
nssm install "RustDesk hbbr Service" "C:\Program Files\RustDesk Server\hbbr.exe" -k _
```
**笔记:**
- 您可以将 `RustDesk hbbs service` 更改为您想要将 hbbs 服务命名的任何内容
- 您可以将`RustDesk hbbr 服务`更改为您想要将 hbbr 服务命名为任何名称
- 您可以将 `C:\Program Files\RustDesk Server\hbbs.exe` 更改为放置 RustDesk 二进制文件的位置
- 您可以将 `C:\Program Files\RustDesk Server\hbbr.exe` 更改为放置 RustDesk 二进制文件的位置
- 你不需要`-k _`选项,它是可选的,它只是为了更好的安全性
**命令模板:**
如果您只想复制、粘贴和编辑,则使用命令模板。
```cmd
nssm install <hbbs 服务名称> <RustDesk hbbs.exe 路径> <RustDesk hbbs 参数>
nssm install <hbbr 服务名称> <RustDesk hbbr.exe 路径> <RustDesk hbbr 参数>
```
**启动服务**
成功安装服务后,需要启动它们。
```cmd
nssm start <hbbs 服务名称>
nssm start <hbbr 服务名称>
```
**完毕!**
以上方法已在Windows Server Core 2022 Standard上测试
## 或者
## 使用 PM2 安装
### 安装NodeJs
请点击[下载](https://nodejs.org/dist/v16.14.2/node-v16.14.2-x86.msi)安装,可能会有点慢,如果卡顿太久,尝试关掉重新安装。
NodeJs是pm2的运行时环境所以要先安装NodeJs。
### 安装pm2
在cmd.exe中分别输入下面三行每一行都要按回车键一行一行运行。
```
npm install -g pm2
npm install pm2-windows-startup -g
pm2-startup install
```
### 运行hbbr和hbbs
下载Windows版本[服务器程序](https://github.com/rustdesk/rustdesk-server/releases)假设你解压缩到了C盘下。分别运行下面四行命令。
```
cd c:\rustdesk-server-windows-x64
pm2 start hbbs.exe -- -r hbbr运行所在主机的地址
pm2 start hbbr.exe
pm2 save
```
### 查看log
```
pm2 log hbbr
pm2 log hbbs
```

View File

@@ -0,0 +1,112 @@
---
title: Windows & pm2
weight: 20
---
## 十字路口
您現在有兩個選擇,您可以使用 pm2 (較簡單) 或 NSSM (稍難) 來啟動 rustdesk 伺服器
使用 NSSM 的好處:
- Backwards compatibility with older windows (Windows Server 2008R2/Windows 7 and earlier although untested).
- Ideal for Windows Server
- Auto start on boot without login (The user who created the startup entry does not need to log on for it to start).
- Running both binaries as Services.
- Standalone (no dependency on nodejs)
使用 pm2 的好處:
- Good idea if you run the server on the same computer as your main work computer
- You logon regularly to the user that created the rustdesk startup entry
- 使用者友好
## 使用 NSSM 安裝
### 安裝 NSSM
Please [download](https://nssm.cc/release/nssm-2.24.zip) and extract NSSM select the appropriate
architecture to your windows system (if x86 use the contents of the win32 folder, if x64 use the
contents of win64 folder). It is also best practice to move the binary of NSSM into the
`Program Files\NSSM` (NSSM once started as a service, it cannot be moved from the directory it was placed in.
thus it is best to tuck it away in Program files) directory of your Installation drive (Usually the C drive).
It is also advisable to add the path (such as `C:\Program Files\NSSM`) to the path variable.
### Checking if NSSM is installed properly
If you've done everything correctly the folder `C:\Program Files\NSSM` (in this example I use the C:
drive but you can use whatever drive you installed windows to or whatever path you desire) should
only contain the file `nssm.exe`.
在此範例中,我們將使用 `C:\Program Files\NSSM`
Open Command prompt and run `nssm` if you see a help page you are ready to move onto the next step
### 執行 hbbr 和 hbbs
Download the Windows version of [server program](https://github.com/rustdesk/rustdesk-server/releases).
Unzip the program to the `C:\Program Files\RustDesk Server` (or anywhere you desire just make sure it
doesn't change after the service is installed). now get back to Command prompt
在此範例中,我們將使用 `C:\Program Files\RustDesk Server`
```cmd
nssm install "RustDesk hbbs service" "C:\Program Files\RustDesk Server\hbbs.exe" -r 0.0.0.0 -k _
nssm install "RustDesk hbbr Service" "C:\Program Files\RustDesk Server\hbbr.exe" -k _
```
**Note:**
- You can change `RustDesk hbbs service` to whatever you desire to name hbbs the service
- You can change `RustDesk hbbr service` to whatever you desire to name hbbr the service
- You can change `C:\Program Files\RustDesk Server\hbbs.exe` to wherever you placed the rustdesk binaries
- You can change `C:\Program Files\RustDesk Server\hbbr.exe` to wherever you placed the rustdesk binaries
- You do not need the `-k _` option which is optional, it's just for better security
**Command templates:**
The command template in case you just want to copy and paste and edit.
```cmd
nssm install <Desired hbbs servicename> <RustDesk hbbs binary path> <RustDesk hbbs arguments>
nssm install <Desired hbbr servicename> <RustDesk hbbr binary path> <RustDesk hbbr arguments>
```
**啟動服務**
成功安裝服務後,需要將其重新啟動。
```cmd
nssm start <Desired hbbs servicename>
nssm start <Desired hbbr servicename>
```
**大功告成!**
(上述方法已在 Windows Server Core 2022 Standard 上測試)。
## 或
## 使用 pm2 安裝
### 安裝 NodeJs
請[下載](https://nodejs.org/dist/v16.14.2/node-v16.14.2-x86.msi)並安裝 NodeJs。
NodeJs 是 pm2 的執行環境,所以要先安裝 NodeJs。
### 安裝 pm2
`cmd.exe` 中輸入下面三行指令,每一行都要按 <kbd>Enter</kbd> 鍵,並逐行執行。
```cmd
npm install -g pm2
npm install pm2-windows-startup -g
pm2-startup install
```
### 執行 hbbr 和 hbbs
下載 [伺服器程式](https://gitee.com/rustdesk/rustdesk-server/releases)的 Windows 版本,解壓縮到 C: 下。並執行下面四行指令 (記得編輯 `-r` 參數)
```cmd
cd c:\rustdesk-server-windows-x64
pm2 start hbbs.exe -- -r <hbbr 運行所在主機的地址>
pm2 start hbbr.exe
pm2 save
```
### 查看記錄
```
pm2 log hbbr
pm2 log hbbs
```