2023-08-21 21:46:01 +02:00
---
title: Docker
weight: 6
---
### Docker
2023-08-27 21:01:27 +02:00
Install Docker with this [guide ](https://docs.docker.com/engine/install ) to ensure its the most up to date!
2023-08-21 21:46:01 +02:00
2023-10-19 09:34:56 +02:00
Run the following commands (s6 image may need ./data:/data instead of ./data:/root):
2023-09-05 00:14:23 +02:00
```sh
2023-08-21 21:46:01 +02:00
sudo docker image pull rustdesk/rustdesk-server-pro
2023-10-19 09:34:15 +02:00
sudo docker run --name hbbs -v ./data:/root -td --net=host --restart unless-stopped rustdesk/rustdesk-server-pro hbbs
sudo docker run --name hbbr -v ./data:/root -td --net=host --restart unless-stopped rustdesk/rustdesk-server-pro hbbr
2023-08-21 21:46:01 +02:00
```
2023-09-05 00:14:23 +02:00
2023-08-21 21:46:01 +02:00
{{% notice note %}}
2023-08-27 21:01:27 +02:00
The above example uses `sudo` and `--net=host` , this will not work on Windows please remove these commands, if you remove `--net=host` please check below.
2023-08-21 21:46:01 +02:00
{{% /notice %}}
2023-09-05 00:14:23 +02:00
```sh
2023-08-21 21:46:01 +02:00
macaddrhbbs=$(echo -n A0-62-2F; dd bs=1 count=3 if=/dev/random 2>/dev/null |hexdump -v -e '/1 "-%02X"')
sudo docker image pull rustdesk/rustdesk-server-pro
2023-10-19 09:34:15 +02:00
sudo docker run --name hbbs -p 21114:21114 -p 21115:21115 -p 21116:21116 -p 21116:21116/udp -p 21118:21118 -v ./data:/root -td --mac-address="$macaddrhbbs" --restart unless-stopped rustdesk/rustdesk-server-pro hbbs
sudo docker run --name hbbr -p 21117:21117 -p 21119:21119 -v ./data:/root -td --restart unless-stopped rustdesk/rustdesk-server-pro hbbr
2023-08-21 21:46:01 +02:00
```
### Docker Compose
2023-08-28 21:50:59 +02:00
With Docker Compose you HAVE to use `network_mode: "host"` to ensure licensing works. Install Docker using this [guide ](https://docs.docker.com/engine/install ) to ensure its the most up to date!
2023-08-21 21:46:01 +02:00
2023-08-27 21:01:27 +02:00
Copy the below into `docker-compose.yml` .
2023-08-21 21:46:01 +02:00
```yaml
version: '3'
services:
hbbs:
container_name: hbbs
image: rustdesk/rustdesk-server-pro:latest
command: hbbs
volumes:
- ./data:/root
network_mode: "host"
depends_on:
- hbbr
restart: unless-stopped
hbbr:
container_name: hbbr
image: rustdesk/rustdesk-server-pro:latest
command: hbbr
volumes:
- ./data:/root
network_mode: "host"
restart: unless-stopped
```
2023-09-05 00:14:23 +02:00
The run `docker compose up -d` .