You are not logged in.

#1 2025-02-21 21:48:47

MAYBL8
Member
Registered: 2022-01-14
Posts: 320

[SOLVED WITH QUESTION] Self Hosted Rustdesk Server

I am trying to get a self hosted Rustdesk server running in Arch Linux.
I haven't found much about geting it working after you get it installed.
I installed it from the AUR and launced the .hbbr and .hbbs. scripts.
I have the ports routing through my router which I'm sure I need for it to work on my local lan. But I do want to have it working for people on the internet.

I think I am having issues with the keys . Where to put them and filling out the screens with the correct info.

As far as I understand it , I should be able to launch the client on 2 computer and connect them through the self hosted server.
If someone has done this on Arch Linux I would appreciate some help.

Let me know what info you need me to provide.
Thanks

Last edited by MAYBL8 (2025-02-26 22:05:27)

Online

#2 2025-02-21 22:45:29

jonno2002
Member
Registered: 2016-11-21
Posts: 774

Re: [SOLVED WITH QUESTION] Self Hosted Rustdesk Server

i use rustdesk on an arch server under docker and another on debian server so both are different to how yours is configured but all you really need to know is the public key which looking at the aur package seems to be in:

/opt/rustdesk-server/data

your looking for the contents of a file named "id_ed*****.pub" which is the public key that you need to set in all your clients under "settings>network>key" also make sure your server address is under "id server" on that same network config page, the other 2 fields can be left blank.
that should be it, its pretty simple, let me know if you get stuck

Offline

#3 2025-02-22 00:33:16

MAYBL8
Member
Registered: 2022-01-14
Posts: 320

Re: [SOLVED WITH QUESTION] Self Hosted Rustdesk Server

To try to test it. I installed it to my Downloads folder in a amd64 folder:
This is what is in that folder.

[demo@arch-linux amd64]$ ls -la
total 13200
drwxr-xr-x 2 demo demo    4096 Feb 20 11:55 .
drwx------ 3 demo demo    4096 Feb 20 11:55 ..
-rw-r--r-- 1 root root    4096 Feb 20 11:55 db_v2.sqlite3
-rw-r--r-- 1 root root   32768 Feb 20 13:43 db_v2.sqlite3-shm
-rw-r--r-- 1 root root   82432 Feb 20 13:39 db_v2.sqlite3-wal
-rwxr-xr-x 1 demo demo 3320736 Jan 25 08:01 hbbr
-rwxr-xr-x 1 demo demo 9467120 Jan 25 08:01 hbbs
-rw-r--r-- 1 root root      88 Feb 20 11:55 id_ed25519
-rw-r--r-- 1 root root      44 Feb 20 11:55 id_ed25519.pub
-rwxr-xr-x 1 demo demo  584056 Jan 25 08:01 rustdesk-utils

I don't have anything in the /opt/rustdesk-server/data folder

Here is what the .hbbr and .hbbs shows:

demo@arch-linux amd64]$ sudo ./hbbs
[sudo] password for demo: 
[2025-02-20 13:43:06.124190 -05:00] INFO [src/common.rs:121] Private key comes from id_ed25519
[2025-02-20 13:43:06.124217 -05:00] INFO [src/rendezvous_server.rs:1205] Key: g8PF9h9pDYw0Km1SpdjjTwz5LgBtMy4Nd3jjlxp9GtI=
[2025-02-20 13:43:06.124221 -05:00] INFO [src/peer.rs:84] DB_URL=./db_v2.sqlite3
[2025-02-20 13:43:06.125134 -05:00] INFO [src/rendezvous_server.rs:99] serial=0
[2025-02-20 13:43:06.125149 -05:00] INFO [src/common.rs:45] rendezvous-servers=[]
[2025-02-20 13:43:06.125152 -05:00] INFO [src/rendezvous_server.rs:101] Listening on tcp/udp :21116
[2025-02-20 13:43:06.125163 -05:00] INFO [src/rendezvous_server.rs:102] Listening on tcp :21115, extra port for NAT test
[2025-02-20 13:43:06.125165 -05:00] INFO [src/rendezvous_server.rs:103] Listening on websocket :21118
[2025-02-20 13:43:06.125236 -05:00] INFO [src/rendezvous_server.rs:138] mask: None
[2025-02-20 13:43:06.125258 -05:00] INFO [src/rendezvous_server.rs:139] local-ip: ""
[2025-02-20 13:43:06.125263 -05:00] INFO [src/common.rs:45] relay-servers=[]
[2025-02-20 13:43:06.125359 -05:00] INFO [src/rendezvous_server.rs:153] ALWAYS_USE_RELAY=N
[2025-02-20 13:43:06.125379 -05:00] INFO [src/rendezvous_server.rs:185] Start
[demo@arch-linux amd64]$ sudo ./hbbr
[sudo] password for demo: 
[2025-02-20 13:42:55.026490 -05:00] INFO [src/relay_server.rs:61] #blacklist(blacklist.txt): 0
[2025-02-20 13:42:55.026503 -05:00] INFO [src/relay_server.rs:76] #blocklist(blocklist.txt): 0
[2025-02-20 13:42:55.026519 -05:00] INFO [src/relay_server.rs:82] Listening on tcp :21117
[2025-02-20 13:42:55.026521 -05:00] INFO [src/relay_server.rs:84] Listening on websocket :21119
[2025-02-20 13:42:55.026526 -05:00] INFO [src/relay_server.rs:87] Start
[2025-02-20 13:42:55.026614 -05:00] INFO [src/relay_server.rs:105] DOWNGRADE_THRESHOLD: 0.66
[2025-02-20 13:42:55.026666 -05:00] INFO [src/relay_server.rs:115] DOWNGRADE_START_CHECK: 1800s
[2025-02-20 13:42:55.026668 -05:00] INFO [src/relay_server.rs:125] LIMIT_SPEED: 4Mb/s
[2025-02-20 13:42:55.026670 -05:00] INFO [src/relay_server.rs:136] TOTAL_BANDWIDTH: 1024Mb/s
[2025-02-20 13:42:55.026672 -05:00] INFO [src/relay_server.rs:146] SINGLE_BANDWIDTH: 16Mb/s

I will try to put the .pub contents as you have said to do.  I will post what I get when I try to connect to the rustdesk client.

Would it be better to set it up in Docker?
Thanks

Online

#4 2025-02-22 00:56:11

jonno2002
Member
Registered: 2016-11-21
Posts: 774

Re: [SOLVED WITH QUESTION] Self Hosted Rustdesk Server

the key is right there:

[src/rendezvous_server.rs:1205] Key: g8PF9h9pDYw0Km1SpdjjTwz5LgBtMy4Nd3jjlxp9GtI=

so the key is: "g8PF9h9pDYw0Km1SpdjjTwz5LgBtMy4Nd3jjlxp9GtI="

since youve posted the key here, i would recommend deleting the keys and starting again, it should generate new keys

up to you if you want to use docker, only reason i did is because i already had docker running on that server and needed to test rustdesk out quickly when i was learning to use it, i would say if you have docker on your server already then go ahead but if you dont then it would be a waste of resources for such a small program like hbbs/hbbr.

Offline

#5 2025-02-22 01:47:16

MAYBL8
Member
Registered: 2022-01-14
Posts: 320

Re: [SOLVED WITH QUESTION] Self Hosted Rustdesk Server

On both computers that I am testing with I have in the ID/Relay server screen:
ID server :  192.168.68.xx    (local server IP Address)
Relay Server : Blank
API Server: Blank
Key:   (the .pub Key)

I get the following error from trying to connect from either side.
Connection error
Remote desktop is offline.

Last edited by MAYBL8 (2025-02-22 01:47:34)

Online

#6 2025-02-22 03:15:50

jonno2002
Member
Registered: 2016-11-21
Posts: 774

Re: [SOLVED WITH QUESTION] Self Hosted Rustdesk Server

in your server logs are you getting the peer updates from the clients:

[src/peer.rs:102] update_pk ........

should show the unique id of the client and the ip address

Offline

#7 2025-02-22 13:27:51

MAYBL8
Member
Registered: 2022-01-14
Posts: 320

Re: [SOLVED WITH QUESTION] Self Hosted Rustdesk Server

I hate to say this but trying to make something work I have further complicated things.
I have installed tailscale on all of the machines and I still get key mismatch.

This must be too complicated for me to figure out.

I am about to quit.

Last edited by MAYBL8 (2025-02-22 17:13:08)

Online

#8 2025-02-22 17:14:11

MAYBL8
Member
Registered: 2022-01-14
Posts: 320

Re: [SOLVED WITH QUESTION] Self Hosted Rustdesk Server

jonno2002 wrote:

in your server logs are you getting the peer updates from the clients:

[src/peer.rs:102] update_pk ........

should show the unique id of the client and the ip address

What log file am I supposed to see this in.

Online

#9 2025-02-22 20:48:21

jonno2002
Member
Registered: 2016-11-21
Posts: 774

Re: [SOLVED WITH QUESTION] Self Hosted Rustdesk Server

hbbs.log

Offline

#10 2025-02-22 23:04:22

MAYBL8
Member
Registered: 2022-01-14
Posts: 320

Re: [SOLVED WITH QUESTION] Self Hosted Rustdesk Server

jonno2002 wrote:

hbbs.log

for some reason that log is not on the system anywhere.

I did the command   sudo find / -name hbbs.log
and nothing was returned.

Online

#11 2025-02-23 03:07:34

jonno2002
Member
Registered: 2016-11-21
Posts: 774

Re: [SOLVED WITH QUESTION] Self Hosted Rustdesk Server

so are you just running them like in post #3 ?? if so that output is what would be in the log, just looking at the aur package systemd files it seems there is no log output defined so you would have to change that, for example:
add these 2 lines to the "[service]" section of the "rustdesk-server-hbbs.service" and "rustdesk-server-hbbr.service"

StandardOutput=append:/var/log/rustdesk-server/hbbs.log
StandardError=append:/var/log/rustdesk-server/hbbs.error

and

StandardOutput=append:/var/log/rustdesk-server/hbbr.log
StandardError=append:/var/log/rustdesk-server/hbbr.error

but we're getting off track here, still need to figure out why its not working for you, so check those outputs like in post #3 and see if you can see the clients communicating with the server.

EDIT:
i just tried running it locally the exact same way your doing it and it all worked perfectly, both clients could connect to each other and the output from the server showed the clients ip addresses and unique ids (update_pk)

Last edited by jonno2002 (2025-02-23 03:29:07)

Offline

#12 2025-02-23 03:59:30

MAYBL8
Member
Registered: 2022-01-14
Posts: 320

Re: [SOLVED WITH QUESTION] Self Hosted Rustdesk Server

When I added those lines in the rustdesk service file the service wouldn't start.

I had to manually start the rustdesk with the .hbbs and .hbbr

I see no log files in the var/log directory.

I see no communication with the 2 machines I am trying to connect.

Online

#13 2025-02-23 04:30:35

jonno2002
Member
Registered: 2016-11-21
Posts: 774

Re: [SOLVED WITH QUESTION] Self Hosted Rustdesk Server

you need to create the directory:

mkdir -p /var/log/rustdesk-server/

looks like output goes strait to the journal by default anyway so thats where your logs are.

im struggling to understand why your having so much trouble, its really the simplest thing ever, i didnt have to set up anything anywhere, i just downloaded the rustdesk-server zip file and extracted the amd64 folder same as you, then simply ran the hbbs binary and copied the key from the output and entered it into the 2 clients on seperate machines and entered the IP of the server into the clients as well and it all just works.....

Offline

#14 2025-02-23 04:48:02

MAYBL8
Member
Registered: 2022-01-14
Posts: 320

Re: [SOLVED WITH QUESTION] Self Hosted Rustdesk Server

i just downloaded the rustdesk-server zip file



Could it be because I did this:

I installed it from the AUR


I am going to uninstall and reinstall rustdesk

Last edited by MAYBL8 (2025-02-23 05:05:58)

Online

#15 2025-02-23 06:10:45

jonno2002
Member
Registered: 2016-11-21
Posts: 774

Re: [SOLVED WITH QUESTION] Self Hosted Rustdesk Server

it doesnt matter if its installed or not, were just trying to figure out why you cant get clients to connect, it really doesnt matter where why or how your running the binaries, just so long as youve got hbbs running and showing output like in post #3

Offline

#16 2025-02-23 12:55:15

MAYBL8
Member
Registered: 2022-01-14
Posts: 320

Re: [SOLVED WITH QUESTION] Self Hosted Rustdesk Server

Still not working.
Now after reinstall I can't get the service to start and the files are there.
I keep getting this error

Failed to enable unit: Unit rustdesk-server-hbbs.service does not exist

Here is the files:

[demo@arch-linux multi-user.target.wants]$ ls
iptables.service  php-fpm.service   rustdesk-server-hbbr.service  tailscaled.service
iwd.service       pmlogger.service  rustdesk-server-hbbs.service
mariadb.service   pmproxy.service   sshd.service
nginx.service     remote-fs.target  systemd-networkd.service

Online

#17 2025-02-23 18:50:12

jonno2002
Member
Registered: 2016-11-21
Posts: 774

Re: [SOLVED WITH QUESTION] Self Hosted Rustdesk Server

MAYBL8 wrote:

To try to test it. I installed it to my Downloads folder in a amd64 folder:
This is what is in that folder.

[demo@arch-linux amd64]$ ls -la
total 13200
drwxr-xr-x 2 demo demo    4096 Feb 20 11:55 .
drwx------ 3 demo demo    4096 Feb 20 11:55 ..
-rw-r--r-- 1 root root    4096 Feb 20 11:55 db_v2.sqlite3
-rw-r--r-- 1 root root   32768 Feb 20 13:43 db_v2.sqlite3-shm
-rw-r--r-- 1 root root   82432 Feb 20 13:39 db_v2.sqlite3-wal
-rwxr-xr-x 1 demo demo 3320736 Jan 25 08:01 hbbr
-rwxr-xr-x 1 demo demo 9467120 Jan 25 08:01 hbbs
-rw-r--r-- 1 root root      88 Feb 20 11:55 id_ed25519
-rw-r--r-- 1 root root      44 Feb 20 11:55 id_ed25519.pub
-rwxr-xr-x 1 demo demo  584056 Jan 25 08:01 rustdesk-utils

I don't have anything in the /opt/rustdesk-server/data folder

Here is what the .hbbr and .hbbs shows:

demo@arch-linux amd64]$ sudo ./hbbs
[sudo] password for demo: 
[2025-02-20 13:43:06.124190 -05:00] INFO [src/common.rs:121] Private key comes from id_ed25519
[2025-02-20 13:43:06.124217 -05:00] INFO [src/rendezvous_server.rs:1205] Key: g8PF9h9pDYw0Km1SpdjjTwz5LgBtMy4Nd3jjlxp9GtI=
[2025-02-20 13:43:06.124221 -05:00] INFO [src/peer.rs:84] DB_URL=./db_v2.sqlite3
[2025-02-20 13:43:06.125134 -05:00] INFO [src/rendezvous_server.rs:99] serial=0
[2025-02-20 13:43:06.125149 -05:00] INFO [src/common.rs:45] rendezvous-servers=[]
[2025-02-20 13:43:06.125152 -05:00] INFO [src/rendezvous_server.rs:101] Listening on tcp/udp :21116
[2025-02-20 13:43:06.125163 -05:00] INFO [src/rendezvous_server.rs:102] Listening on tcp :21115, extra port for NAT test
[2025-02-20 13:43:06.125165 -05:00] INFO [src/rendezvous_server.rs:103] Listening on websocket :21118
[2025-02-20 13:43:06.125236 -05:00] INFO [src/rendezvous_server.rs:138] mask: None
[2025-02-20 13:43:06.125258 -05:00] INFO [src/rendezvous_server.rs:139] local-ip: ""
[2025-02-20 13:43:06.125263 -05:00] INFO [src/common.rs:45] relay-servers=[]
[2025-02-20 13:43:06.125359 -05:00] INFO [src/rendezvous_server.rs:153] ALWAYS_USE_RELAY=N
[2025-02-20 13:43:06.125379 -05:00] INFO [src/rendezvous_server.rs:185] Start

go to your downloads/amd64 folder that you described here and run the hbbs binary in a terminal window and leave it there displaying the output and copy the key from the output, then go to your 2 clients and input the key and the LOCAL server ip address of the server, after that hit "apply" and on your main rustdesk screen there should be a green dot at the bottom of the window saying "ready" and you should see "update_pk" pop up in the hbbs output on the server

this assumes your doing all this on a local network with all the devices local

Offline

#18 2025-02-23 21:34:03

MAYBL8
Member
Registered: 2022-01-14
Posts: 320

Re: [SOLVED WITH QUESTION] Self Hosted Rustdesk Server

I had all of that correct as far as the settings went.
What didn't happen was getting the "Ready" green .  I had to click the start service link.

[2025-02-23 16:28:15.035146 -05:00] INFO [src/peer.rs:102] update_pk 517532696 [::ffff:192.168.68.21]:60577 b"fb7cb0c0736f44bba24263df018c9e4e" b"z\x91WS\x8ac\x8e[e\xbeI\x9bMF\x96.\x9f\x0f\xb6\x16\xd2(*\xbf\x91r\x97\x97x\x0c\xf0V"

Now how can I get the .hbbs to run at startup . The startup service that was working before?

Thank for sticking with me on this.

Online

#19 2025-02-24 04:44:02

jonno2002
Member
Registered: 2016-11-21
Posts: 774

Re: [SOLVED WITH QUESTION] Self Hosted Rustdesk Server

well if you installed the aur package correctly then it tells you what to do:

This package provides ID/Rendezvous Server and Relay Server
 To use run as ID/Rendezvous Server , you need to run 
 sudo systemctl enable --now  rustdesk-server-hbbs.service 
 To use run as Relay Server , you need to run 
 sudo systemctl enable --now  rustdesk-server-hbbr.service 

simple as that, i just did the whole lot from scratch in under 2 min

mkdir rustdesk
cd rustdesk/
wget https://aur.archlinux.org/cgit/aur.git/snapshot/rustdesk-server-bin.tar.gz
tar xvf rustdesk-server-bin.tar.gz
cd rustdesk-server-bin
makepkg -Ccfs
sudo pacman -U rustdesk-server-bin-1.1.13-1-x86_64.pkg.tar.zst 
sudo systemctl enable --now  rustdesk-server-hbbs.service
sudo systemctl enable --now  rustdesk-server-hbbr.service
journalctl -b

the last step "journalctl -b" should then verify that its working as the output will be there

Offline

#20 2025-02-24 13:48:33

MAYBL8
Member
Registered: 2022-01-14
Posts: 320

Re: [SOLVED WITH QUESTION] Self Hosted Rustdesk Server

Ok great we have success.

I reinstalled per your steps and it worked flawlessly as I'm sure you knew it would.
The only 2 things I did different was
I added the log file entries in the service files.
I made it easier to find the journal entries by adding | grep rustdesk

Now I want to be able to access from inside my lan and support other peoples computers.

Any setup advice for that?

To test I have my port forwards set like this:

rustdesk     192.168.68.33:21114-21119  tcp
rustdesk-udp   192.168.68.33:21116   udp  (fixed typo)

Since I want to connect to people from inside my network to someone outside my network what works is on rustdesk network show my lan ip 192.168.68.xx
and the public key.
This seems to be using my local rustdesk server.

On the computer I am connecting to they put in my public ip address and the key and it works.

However if I try to connect from the outside into my lan it times out and doesn't connect.

Last edited by MAYBL8 (2025-02-24 21:24:27)

Online

#21 2025-02-24 18:04:37

jonno2002
Member
Registered: 2016-11-21
Posts: 774

Re: [SOLVED WITH QUESTION] Self Hosted Rustdesk Server

yip you have it all correct, are you sure your ISP has given you a public ip and your not behind CGNAT ?

also if you altered those systemd service files just remember when/if you update the package it will overwrite them, you can use systemd drop in files to get around this.

EDIT: your 2116 udp should be 21116 but im sure thats just a typo, if not fix that

Last edited by jonno2002 (2025-02-24 18:07:11)

Offline

#22 2025-02-24 21:33:49

MAYBL8
Member
Registered: 2022-01-14
Posts: 320

Re: [SOLVED WITH QUESTION] Self Hosted Rustdesk Server

I know my ISP is not using CGNAT on me for 2 reasons.
1. I am running a mail server and 2 I have my own router connected straight to their modem.

Is there a way to test where the failure comes in when trying to connect to one of my Rustdesk clients when trying to access from the outside.
As I said I can connect from inside to outside just not outside to inside.

Thanks

Online

#23 2025-02-25 04:40:26

jonno2002
Member
Registered: 2016-11-21
Posts: 774

Re: [SOLVED WITH QUESTION] Self Hosted Rustdesk Server

it should be as simple as changing the "id server" field from an internal ip to the outside ip or domain name if you have that setup, only time this wont work is if your router doesnt do hairpinning.
and for remote machines it should just work.
you could try a port checking service to see if your ports are open.

Offline

#24 2025-02-25 13:51:47

MAYBL8
Member
Registered: 2022-01-14
Posts: 320

Re: [SOLVED WITH QUESTION] Self Hosted Rustdesk Server

This is what I see in the hbbr.log file when I try to connect from the outside to the inside.
Outside ID is my public ip on the computer trying to connect to inside

[2025-02-25 08:47:20.437091 -05:00] INFO [src/relay_server.rs:452] New relay request f857a13d-1f07-49f4-a883-d65cd9ca61fe from [::ffff:192.168.68.21]:44677

It looks like it gets the request but doesn't do anything with it.


Got this figured out but I can't explain why.

I set both machines ID to the public ip of my modem. Then it works from inside to inside.   Outside to inside and inside to outside.

Last edited by MAYBL8 (2025-02-25 14:33:56)

Online

Board footer

Powered by FluxBB