Docker
Here is another good tutorial: Building Your Own Remote Desktop Solution: RustDesk Self-Hosted on Cloud with Docker (Hetzner)
Install your own server with Docker
Requirements
You need to have Docker/Podman installed to run a rustdesk-server as a Docker container. If in doubt, install Docker with this guide to ensure it’s the most up to date!
Be sure to open these ports in the firewall:
hbbs:21114(TCP): used for web console, only available inProversion.21115(TCP): used for the NAT type test.21116(TCP/UDP): Please note that21116should be enabled both for TCP and UDP.21116/UDPis used for the ID registration and heartbeat service.21116/TCPis used for TCP hole punching and connection service.21118(TCP): used to support web clients.
hbbr:21117(TCP): used for the Relay services.21119(TCP): used to support web clients.
If you do not need web client support, the corresponding ports 21118, 21119 can be disabled.
Docker examples
sudo docker image pull rustdesk/rustdesk-server
sudo docker run --name hbbs -v ./data:/root -td --net=host --restart unless-stopped rustdesk/rustdesk-server hbbs
sudo docker run --name hbbr -v ./data:/root -td --net=host --restart unless-stopped rustdesk/rustdesk-server hbbrNote
--net=host only works on Linux, which makes hbbs/hbbr see the real incoming IP Address rather than the Container IP (172.17.0.1).
If --net=host works fine, the -p options are not used. If on Windows, leave out sudo and --net=host.
Please remove --net=host if you are having connection problems on your platform.
Note
-td, you can see logs via docker logs hbbs. Or you can run with -it, hbbs/hbbr will not run as daemon mode.Docker Compose examples
For running the Docker files with the compose.yml as described here you need to have Docker Compose installed.
services:
hbbs:
container_name: hbbs
image: rustdesk/rustdesk-server:latest
command: hbbs
volumes:
- ./data:/root
network_mode: "host"
depends_on:
- hbbr
restart: unless-stopped
hbbr:
container_name: hbbr
image: rustdesk/rustdesk-server:latest
command: hbbr
volumes:
- ./data:/root
network_mode: "host"
restart: unless-stoppedIf you need to make config changes e.g. set ALWAYS_USE_RELAY=Y you can use environment in the docker-compose.yml
services:
hbbs:
container_name: hbbs
image: rustdesk/rustdesk-server:latest
environment:
- ALWAYS_USE_RELAY=Y
command: hbbs
volumes:
- ./data:/root
network_mode: "host"
depends_on:
- hbbr
restart: unless-stopped
hbbr:
container_name: hbbr
image: rustdesk/rustdesk-server:latest
command: hbbr
volumes:
- ./data:/root
network_mode: "host"
restart: unless-stoppedPodman Quadlet examples
If you would like to run the containers with Podman as a systemd service you can use these sample Podman Quadlet configurations:
[Container]
AutoUpdate=registry
Image=ghcr.io/rustdesk/rustdesk-server:latest
Exec=hbbs
Volume=/path/to/rustdesk-server/data:/root
Network=host
[Service]
Restart=always
[Install]
WantedBy=default.targetor
[Container]
AutoUpdate=registry
Image=ghcr.io/rustdesk/rustdesk-server:latest
Exec=hbbr
Volume=/path/to/rustdesk-server/data:/root
Network=host
[Service]
Restart=always
[Install]
WantedBy=default.target