-
-
Save Lvdwardt/707d9c3fb4581d38102399f91a21c9c6 to your computer and use it in GitHub Desktop.
version: '3' | |
networks: | |
rustdesk-net: | |
external: false | |
services: | |
nginx-proxy-manager: | |
image: 'jc21/nginx-proxy-manager:latest' | |
restart: unless-stopped | |
ports: | |
# These ports are in format <host-port>:<container-port> | |
- '80:80' # Public HTTP Port | |
- '443:443' # Public HTTPS Port | |
- '8081:81' # Admin Web Port | |
# Add any other Stream port you want to expose | |
# - '21:21' # FTP | |
# Ports needed for Rustdesk: | |
- '21115:21115' | |
- '21116:21116' | |
- '21116:21116/udp' | |
- '21117:21117' | |
- '21118:21118' | |
- '21119:21119' | |
# Uncomment the next line if you uncomment anything in the section | |
# environment: | |
# Uncomment this if you want to change the location of | |
# the SQLite DB file within the container | |
# DB_SQLITE_FILE: "/data/database.sqlite" | |
# Uncomment this if IPv6 is not enabled on your host/ | |
# DISABLE_IPV6: 'true' | |
volumes: | |
- ./data:/data | |
- ./letsencrypt:/etc/letsencrypt | |
networks: | |
- rustdesk-net | |
hbbs: | |
container_name: hbbs | |
image: rustdesk/rustdesk-server:latest | |
command: hbbs -r rustdesk.yourDomain.com:21117 | |
volumes: | |
- ./data:/root | |
networks: | |
- rustdesk-net | |
depends_on: | |
- hbbr | |
restart: unless-stopped | |
hbbr: | |
container_name: hbbr | |
image: rustdesk/rustdesk-server:latest | |
command: hbbr | |
volumes: | |
- ./data:/root | |
networks: | |
- rustdesk-net | |
restart: unless-stopped |
itstueben
commented
Jun 2, 2023
- I forwarded the ports for a special URL in fritzbox to npm. Looks all good
- ok
> ## Ste```
ps:
> 1. Create a new stack, name is important because we need it later
> 2. Use the docker-compose above
> 3. Go to the proxy manager
> 4. Go to the tab streams
> 5. Create new streams for port 21115:21119 as shown in the image below.
> Make sure that port 21117 has both TCP and UDP selected.
> For port 21115, 21116 and 21118 use `hbbs.[your_stack_name]_rustdesk-net`.
> For port 21117 and 21119 use `hbbr.[your_stack_name]_rustdesk-net`.
> 6. The last thing you need to do is point a domain name to the server. For example rustdesk.yourdomain.com. No need to specify the port, Nginx and RustDesk will handle the rest.
Hello,
In the above instructions I am confused on # 6 where it says to have domain name point to my server. I am not sure if it was a given but how do I do that? Do I setup proxy host or do I do something else and point it to rustdesk? I am unsure on what you mean by that, it just seems vague compared to your other steps?
Please assist!
Thanks!
I know in the docker-compose file I set the domain I planned to use and then in cloudflare I set that as a CNAME DNS record. Is there more to it than that but it says it's successful when I add the host on the client but then it says "not ready. check network connection"????
Hi,
I think you need to point the domain you want to use to the correct IP with an A record, not a CNAME record.
Regards!
I thought of that too but when I did point it with an A record instead it still says not ready.
Can it be proxied by cloudflare or does that have to be disabled?
I do have it disabled
Good morning, I portforwarded on my firewall and went to streams and setup the streams I'm confused on the name there for the host. Am I using the server ip in ngnix proxymanger or the name you point out or my stack name with domain? because when I use that it shows up as offline. Also my nginix proxymanger is not on the same server as rustdesk.
Hi, I'm lost with this:
hbbs.[your_stack_name]_rustdesk-net
hbbr.[your_stack_name]_rustdesk-net
what would your_stack_name be? My domain?
Hey, The name you gave the stack in step 1.
Hi, I can't get the streams to work. I have rustdesk in a separate yml-file as above, since I have npm configured already. Ports bonded in original yml to npm, docker stack name is "docker" and network is npm_proxy. I use hbbr or hbbs .docker_npm_proxy for streams but it shows as offline. I'm not sure what is not working and would appreciate any help, thanks. Also thanks for putting up this guide!
Hi, I can't get the streams to work. I have rustdesk in a separate yml-file as above, since I have npm configured already. Ports bonded in original yml to npm, docker stack name is "docker" and network is npm_proxy. I use hbbr or hbbs .docker_npm_proxy for streams but it shows as offline. I'm not sure what is not working and would appreciate any help, thanks. Also thanks for putting up this guide!
hey, have you added this line in the npm stack as well?
networks: - rustdesk-net
It only works if they are all on the same "internal" network.
If that doesn't work I'd suggest moving your npm config over to the rustdesk stack.
I ended up giving hbbr and hbbs static IP on the npm network and that worked forwarding streams to those IPs. Not sure why it doesn't work with the setup you have described in the guide though. Thanks again!
how to create new stack bro?
Hi, I'm trying to configure everything, the file name is docker-compose.yml
In the destination I have hbbs.docker-compose_rustdesk-net but it tells me that it is offline
Okay so just spreading the knowledge I gained which wasnt clear to me from the start:
- The Adress you are supposed to enter in the NPM Streaming "forward host" field is hbbs."network".
To find out the Value of "network" you can simply run docker network ls and it will list all running networks. One of the networks will contain the network from your compose configuration (in the example above it is "nginx_rustdesk_rustdesk-net", in my case it was "documents_rustdesk-net") - You have to forward the Ports from your router to the Server running NPM. Dont forget that you will have to forward 21115-21119 TCP but also UDP Port 21116.
This is fantastic. Totally works with my nginx-proxy-manager setup on my proxmox. Thanks for posting :)
I messed up... the "-k _" disables encryption. Only use that for testing.
also I use "lazydocker" to quickly check log ands grab the key from the "hbbs" container.
- The Adress you are supposed to enter in the NPM Streaming "forward host" field is hbbs."network".
To find out the Value of "network" you can simply run docker network ls and it will list all running networks. One of the networks will contain the network from your compose configuration (in the example above it is "nginx_rustdesk_rustdesk-net", in my case it was "documents_rustdesk-net")
So in my case, my NPM is on a separate docker compose from my Rust Desk
services:
nginx-proxy:
image: 'jc21/nginx-proxy-manager:latest'
container_name: nginx-proxy
ports:
- '80:80'
- '443:443'
- '8080:81'
environment:
<REDACTED>
volumes:
- ./data:/data
- ./letsencrypt:/etc/letsencrypt
depends_on:
- mariadb
networks:
- frontend
restart: unless-stopped
mariadb:
image: 'jc21/mariadb-aria:latest'
container_name: nginx-proxy-database
environment:
<REDACTED>
volumes:
- ./mysql:/var/lib/mysql
networks:
- frontend
restart: unless-stopped
networks:
frontend:
driver: bridge
services:
hbbs:
container_name: hbbs
image: rustdesk/rustdesk-server:latest
command: hbbs
volumes:
- ./data:/root
# network_mode: "host"
networks:
- nginx-proxy_frontend
ports:
- 21115:21115
- 21116:21116
- 21116:21116/udp
- 21118:21118
depends_on:
- hbbr
restart: unless-stopped
hbbr:
container_name: hbbr
image: rustdesk/rustdesk-server:latest
command: hbbr
volumes:
- ./data:/root
# network_mode: "host"
networks:
- nginx-proxy_frontend
ports:
- 21117:21117
- 21119:21119
restart: unless-stopped
networks:
nginx-proxy_frontend:
external: true
$ docker network ls
NETWORK ID NAME DRIVER SCOPE
9add6d96f668 arr_default bridge local
e32bb266a5ef bridge bridge local
ee8ce530edcf host host local
9862a1c60ad9 nginx-proxy_frontend bridge local
51656e808010 none null local
I'd be using nginx-proxy_frontend, right?
6. The last thing you need to do is point a domain name to the server. For example rustdesk.yourdomain.com. No need to specify the port, Nginx and RustDesk will handle the rest.
So I only set that up in our DNS manager? Nothing to be done on Proxy Manager?
Also, since I'm using separate docker compose files, I'm supposed to be moving the port values to the NPM compose file, or I can leave it there?
Edit: turns out i had to put the ports in NGINX
And the DNS problem was me forgetting to apply the overrides
I seem to have stuck. I'm stuck because when my Rustdesk client is using the internal IP address where this Rustdesk Docker container is, the Rustdesk client is able to connect...meaning I'm seeing "READY". But when I change the ID/Relay server to point to rustdesk.mydomain.com, it just won't connect. I figured that it could very well be my firewall. I"m pointing my firewall to the IP address of the Docker host where Rustdesk is. I would love it if someone could tell if my Port Forwarding on Unifi Controller is correct. It should be but I may have missed something?
Thanks for the assistance.
I opened both protocols (TCP and UDP). It didn't work either. :(
And the DNS problem was me forgetting to apply the overrides
how did ya get this working
i'm also allready running a nginx docker separetly
how did ya get this working
if you want to test it out first, add the override in your router/DNS server
point the URL to your server's IP
Can't access webui. Tried my unraid server's IP and Hostname:21115-21119, also tried rustdesk.mydomain.com. Any ideas on what I can try?
What I've done:
My ports are forwarded.
My NPM streams are open and my hbbr and hbbs docker logs look good. I previously had NPM Streams working with the hbbs.rustdesk_network but set a static IP like the other user commented and changed to network_mode to be with my pre-existing NPM container.
I tried Proxy Hosts using 21117 too.
I'm starting to believe that rustdesk doesn't work for self hosted behind a router in a multi-layer environment. From all the videos and articles and posts, everyone who were successful, had hosted them with a cloud service (meaning, not hosted locally but with something like AWS, Digital Ocean, etc)
no it works. I rebuilt my NPM with rust desk like his example, and it's now working. It's a few steps. But I followed all above and it works for me. I host mine on my Proxmox, UDM, Spectrum and cloudflare dynamic dns solution.
I know this is fundamental question, but I really want to learn this. I'm ok with steps 2-6 as I have many docker images running (ollama, piwigo, nginx, searxng, frigate NVR). But the "create a stack" has me baffled. I have read all over the net, but I'm really confused.
Could you point me in the right direction or explain what creating a stack is? And how is it deployed?
Many thanks
I know this is fundamental question, but I really want to learn this. I'm ok with steps 2-6 as I have many docker images running (ollama, piwigo, nginx, searxng, frigate NVR). But the "create a stack" has me baffled. I have read all over the net, but I'm really confused.
Could you point me in the right direction or explain what creating a stack is? And how is it deployed? Many thanks
Hey!
I used portainer for this and there it is called a stack, but I believe it's the name of the folder you create your docker-compose in. To check you can do step two and then get the name by running docker network ls
and finding the one that has _rustdesk-net
after it.