doc.rustdesk.com/content/self-host/install/_index.en.md

145 lines
6.5 KiB
Markdown
Raw Normal View History

2022-04-11 11:05:11 +02:00
---
title: Installation
weight: 10
---
2022-04-24 04:59:53 +02:00
{{% notice note %}}
Self-hosted server software is not free, you can use demo license for trial.
{{% /notice %}}
2022-04-11 11:05:11 +02:00
## Set up your own cloud by following simple steps
-----------
### STEP-1 : Download server-side software programs
2022-04-19 07:35:45 +02:00
[Download](https://github.com/rustdesk/rustdesk-server/) or use docker [rustdesk/rustdesk-server](https://hub.docker.com/r/rustdesk/rustdesk-server/tags).
2022-04-19 07:32:08 +02:00
<!-- **Note:** You need [buy license](https://rustdesk.com/server/) When using this software -->
2022-04-11 11:05:11 +02:00
Platform versions provided:
2022-04-11 11:05:11 +02:00
- Linux
- Windows
Below tutorial is based on Linux build.
2022-04-12 20:13:52 +02:00
There are two executables and a folder:
- hbbs - RustDesk ID/Rendezvous server
- hbbr - RustDesk relay server
- static - this folder contains all web console files
2022-04-11 11:05:11 +02:00
They are built on Centos7, tested on Centos7/8, Ubuntu 18/20.
2022-04-11 15:56:34 +02:00
#### Server Requirements
The hardware requirements are very low, the minimum configuration of the cloud server is enough, and the CPU and memory requirements are the minimum. Regarding the network size, if the TCP hole punching direct connection fails, the relay traffic will be consumed. The traffic of a relay connection is between 30k-3M/s (1920x1080 screen), depending on the resolution settings and screen update。 If it is only for office work demand, the traffic is around 100K/s.
2022-04-11 11:05:11 +02:00
### STEP-2 : Run hbbs and hbbr on server
Run hbbs/hbbr on your server (Centos or Ubuntu). We suggust you use [pm2](https://pm2.keymetrics.io/) managing your service.
2022-04-11 15:56:34 +02:00
```
2022-04-19 07:32:08 +02:00
./hbbs -r <relay-server-ip> -m <registered_email>
./hbbr -m <registered_email>
2022-04-11 15:56:34 +02:00
```
2022-04-19 07:32:08 +02:00
2022-04-22 11:47:47 +02:00
or run hbbs/hbbr with pm2
2022-04-19 07:32:08 +02:00
2022-04-22 11:47:47 +02:00
```
pm2 start hbbs -- -r <relay-server-ip> -m <registered_email>
pm2 start hbbr -- -m <registered_email>
```
<a name="demo"></a>
2022-04-11 15:56:34 +02:00
{{% notice note %}}
2022-04-22 11:47:47 +02:00
**Please input `demo` for <registered_email> for trial**
pm2 requires nodejs v16+, if you fail to run pm2 (e.g. you can not see hbbs/hbbr in `pm2 list`), please download and install LTS version nodejs from https://nodejs.org. If you wanna make hbbs/hbbr auto-run after reboot, please check out `pm2 save` and `pm2 startup`. More about [pm2](https://pm2.keymetrics.io/docs/usage/quick-start/). Another good tool for you log is [pm2-logrotate](https://github.com/keymetrics/pm2-logrotate).
The `-r` parameter of hhbs is not necessary, it is just convenient for you not to specify a relay server on the client side. The relay server specified by the client has a higher priority than this.
2022-04-11 15:56:34 +02:00
{{% /notice %}}
2022-04-11 13:23:47 +02:00
By default, hbbs listens on 21114(tcp), 21115(tcp) and 21116(tcp/udp), 21118(tcp), hbbr listens on 21117(tcp), 21119(tcp). Be sure to open these ports in the firewall. **Please note that 21116 should be enabled both for TCP and UDP**. 21114 is for web console + API, 21115 is used for NAT type test, 21116/UDP is used for ID registration and heartbeat service, 21116/TCP is used for TCP hole punching and connection service, 21117 is used for Relay services, 21118 and 21119 are used to support web clients. If you do not need web console + API (21114) or web client (21118, 21119) support, the corresponding ports can be disabled.
2022-04-11 11:05:11 +02:00
2022-04-22 11:47:47 +02:00
- TCP(**21114, 21115, 21116, 21117, 21118, 21119**)
- UDP(**21116**)
2022-04-11 11:05:11 +02:00
Please run with "-h" option to see help if you wanna choose your own port.
#### Docker example
2022-04-12 19:29:05 +02:00
##### Linux/amd64
2022-04-11 11:05:11 +02:00
```
sudo docker image pull rustdesk/rustdesk-server
2022-04-19 19:05:02 +02:00
sudo docker run --name hbbs -p 21114:21114 -p 21115:21115 -p 21116:21116 -p 21116:21116/udp -p 21118:21118 -v `pwd`:/root -it --net=host --rm rustdesk/rustdesk-server hbbs -r <relay-server-ip> -m <registered_email>
sudo docker run --name hbbr -p 21117:21117 -p 21119:21119 -v `pwd`:/root -it --net=host --rm rustdesk/rustdesk-server hbbr -m <registered_email>
2022-04-11 11:05:11 +02:00
```
2022-04-12 19:29:05 +02:00
##### Linux/arm64v8
```
sudo docker image pull rustdesk/rustdesk-server:latest-arm64v8
2022-04-19 19:05:02 +02:00
sudo docker run --name hbbs -p 21114:21114 -p 21115:21115 -p 21116:21116 -p 21116:21116/udp -p 21118:21118 -v `pwd`:/root -it --net=host --rm rustdesk/rustdesk-server:latest-arm64v8 hbbs -r <relay-server-ip> -m <registered_email>
sudo docker run --name hbbr -p 21117:21117 -p 21119:21119 -v `pwd`:/root -it --net=host --rm rustdesk/rustdesk-server:latest-arm64v8 hbbr -m <registered_email>
2022-04-12 19:29:05 +02:00
```
2022-04-20 21:36:57 +02:00
<a name="net-host"></a>
2022-04-19 19:05:02 +02:00
{{% notice note %}}
2022-04-20 21:36:57 +02:00
--net=host only works on Linux so far as I know, which make hbbs/hbbr can see the real incomming ip rather than container ip (172.17.0.1).
If --net=host works fine, -p options are useless.
2022-04-19 19:05:02 +02:00
2022-04-24 10:40:43 +02:00
**Please remove --net=host if see connection problem on your platform**
2022-04-19 19:05:02 +02:00
{{% /notice %}}
2022-04-11 11:05:11 +02:00
### STEP-3 : Set hbbs/hbbr address on client-side
2022-04-11 22:17:51 +02:00
{{% notice note %}}
2022-04-11 22:24:26 +02:00
For Windows clients, you can choose the [Windows EXE](/docs/en/self-host/console/#windows-exe) solution to avoid filling in custom server configuration.
2022-04-11 22:17:51 +02:00
{{% /notice %}}
2022-04-11 11:05:11 +02:00
Click on menu button on the right side of ID as below, choose "ID/Relay Server".
![](/docs/en/self-host/install/images/server-set-menu.png)
2022-04-11 13:23:47 +02:00
Enter the hbbs host or ip address in the ID server input box (local side + remote side), the other two addresses can be left blank, RustDesk will automatically deduce (if not specially set), and the relay server refers to hbbr ( 21116 port), the API server refers to above web console + API (21114) port.
2022-04-11 15:56:34 +02:00
{{% notice note %}}
The Key in the picture does not refer to the registered email address, the [next section](#key) will explain in detail.
{{% /notice %}}
2022-04-11 11:05:11 +02:00
e.g.
```
hbbs.yourhost.com
```
or
```
hbbs.yourhost.com:21116
```
2022-04-11 13:23:47 +02:00
![](/docs/en/self-host/install/images/server-set-window.png)
## Key
-----------
2022-04-21 14:42:16 +02:00
Different from the old version, the key in this version is mandatory, but you don't need to set it yourself. When hbbs runs for the first time, it will automatically generate a pair of encrypted private key and public key (respectively located in the `id_ed25519` and `id_ed25519.pub` files in the running directory), the main purpose is for communication encryption.
If you did not fill in the `Key:` (the content in the public key file `id_ed25519.pub`) in the previous step, it does not affect the connection, but the connection cannot be encrypted.
2022-04-11 13:23:47 +02:00
````
cat ./id_ed25519.pub
````
2022-04-21 14:42:16 +02:00
If you wanna prohibit users without key from establishing non-encrypted connections, please add the `-k _` parameter when running hbbs and hbbr, for example:
2022-04-11 13:23:47 +02:00
````
./hbbs -r <address of the host where hbbr is running> -k _
./hbbr -k _
````
2022-04-21 14:42:16 +02:00
If you wanna change key, please remove `id_ed25519` and `id_ed25519.pub` files and restart hbbs/hbbrhbbs will generate new key pair.
2022-04-21 09:33:05 +02:00
2022-04-11 15:56:34 +02:00
{{% notice note %}}
2022-04-21 14:42:16 +02:00
Key can also be seen on the [console](/docs/en/self-host/console/#console-home) welcome page (Click on Windows EXE).
2022-04-19 07:32:08 +02:00
{{% /notice %}}