233
6) Traefik: EntryPoints/Ports wirklich öffnen
Damit RustDesk über Traefik funktioniert, müssen die EntryPoints in Traefik existieren und die zugehörigen Ports am Host geöffnet sein (Firewall/NAT).
A) Traefik EntryPoints definieren
In deiner Traefik-Config (z. B. traefik.yml) müssen die in .env verwendeten EntryPoints angelegt sein, z. B.:
- UDP (RustDesk ID/Heartbeat): 21116/udp
- TCP:
- 21115/tcp (NAT Type Test)
- 21116/tcp (TCP Hole Punching)
- 21117/tcp (Relay)
- HTTPS (Download-Webseite): 443/tcp (sollte ja eigentlich schon sein )
Beispiel (schematisch, Namen müssen zu deiner .env passen):
nano /opt/containers/traefik-crowdsec-stack/data/traefik/traefik.yml
füge dort ein unter entryPoints :
hbbs-udp:
address: ":21116/udp"
hbbs-tcp-1:
address: ":21115/tcp"
hbbs-tcp-2:
address: ":21116/tcp"
hbbr-tcp-1:
address: ":21117/tcp"
So sieht es dann bei mir aus:
...
...
entryPoints:
ping:
address: ':88'
web:
address: ':80'
http:
redirections:
entryPoint:
to: websecure
scheme: https
websecure:
address: ':443'
http3: {}
http:
middlewares:
- crowdsec@file
- default@file
hbbs-udp:
address: ":21116/udp"
hbbs-tcp-1:
address: ":21115/tcp"
hbbs-tcp-2:
address: ":21116/tcp"
hbbr-tcp-1:
address: ":21117/tcp"
...
...
Anschließend passen wir die Docker Compose Datei noch an:
nano /opt/containers/traefik-crowdsec-stack/compose/traefik.yml
vorher:
...
...
ports:
- mode: host
target: 80
published: "80"
protocol: tcp
- mode: host
target: 443
published: "443"
protocol: tcp
- mode: host
target: 443
published: "443"
protocol: udp
restart: unless-stopped
...
...
nachher:
...
...
ports:
- mode: host
target: 80
published: "80"
protocol: tcp
- mode: host
target: 443
published: "443"
protocol: tcp
- mode: host
target: 443
published: "443"
protocol: udp
- mode: host
target: 21115
published: "21115"
protocol: tcp
- mode: host
target: 21116
published: "21116"
protocol: udp
- mode: host
target: 21116
published: "21116"
protocol: tcp
- mode: host
target: 21117
published: "21117"
protocol: tcp
restart: unless-stopped
...
...
Nun starten wir Traefik neu, damit alle Änderungen übernommen werden.
cd /opt/containers/traefik-crowdsec-stack/ docker compose up -d --force-recreate
B) Firewall / Security Groups / Router Port-Forwarding
Je nach Umgebung müssen die Ports auch “außen” erreichbar sein:
- Host-Firewall (z. B. ufw/iptables/nftables)
- Cloud Security Groups
- Router Port-Forwarding (bei Heimanschluss)
Mindestens erforderlich:
- 21116/udp
- 21115/tcp, 21116/tcp, 21117/tcp
- 443/tcp (nur wenn du die Download-Webseite über HTTPS bereitstellst)
Tipp: Wenn Verbindungen instabil sind, ist 21116/udp oft der erste Prüfpunkt.

Hallo
Frank, ich habe Rustdesk mal neu nach deiner Anleitung installiert und es hat alles geklappt. Ich kann Verbindungen aufbauen. Aber nur wenn ich den Relayserver mit eintrage. Auch die Webseite mit dem Clients ist echt super. Ich muss mich mal noch weiter damit beschäftigen. Aber vielen Dank für deine gute Anleitung.