RustDesk Self-Hosted: Client Fails to Connect Despite Open Ports #643
-
Summary of the Issue
RequestAny guidance on why the client cannot complete the connection (despite successful TCP connectivity) would be appreciated. Environment
Docker Compose SetupI created the following services:
hbbs:
container_name: hbbs
image: docker.io/rustdesk/rustdesk-server:1.1.15
command: hbbs
volumes:
- ./data:/root
depends_on:
- hbbr
restart: unless-stopped
environment:
- RUST_LOG=debug
- ALWAYS_USE_RELAY=Y
- RELAY-SERVERS=localhost
- RENDEZVOUS-SERVERS=localhost
network_mode: host
hbbr:
container_name: hbbr
image: docker.io/rustdesk/rustdesk-server:1.1.15
command: hbbr
volumes:
- ./data:/root
restart: unless-stopped
environment:
- RUST_LOG=debug
network_mode: hostFirewall CheckVerified that the macOS firewall is disabled $ /usr/libexec/ApplicationFirewall/socketfilterfw --getglobalstate
Firewall is disabled. (State = 0)Running the ServicesStarted the Server and Relay containers $ docker compose run --rm --service-ports --pull always hbbs
[+] create 0/1
[+] 2/2t 2/22r.io/rustdesk/rustdesk-server:1.1.15 Pulling 3.7s
✔ Image docker.io/rustdesk/rustdesk-server:1.1.15 Pulled 3.7s
✔ Container hbbr Started 0.1s
Image docker.io/rustdesk/rustdesk-server:1.1.15 Pulling
Image docker.io/rustdesk/rustdesk-server:1.1.15 Pulling
Image docker.io/rustdesk/rustdesk-server:1.1.15 Pulled
Image docker.io/rustdesk/rustdesk-server:1.1.15 Pulled
WARN[0004] No services to build
Container rustdesk-hbbs-run-bd37cde62bf0 Creating
Container rustdesk-hbbs-run-bd37cde62bf0 Created
[2026-04-14 14:19:02.336174 +00:00] INFO [libs/hbb_common/src/config.rs:895] Generated new keypair for id:
[2026-04-14 14:19:02.340149 +00:00] INFO [src/common.rs:147] Private/public key written to id_ed25519/id_ed25519.pub
[2026-04-14 14:19:02.340162 +00:00] DEBUG [src/common.rs:148] Public key: wUrf0XQ0jTpxorpiLZWXBPRwD0R5y4ngMKgN7kaP4Ag=
[2026-04-14 14:19:02.340556 +00:00] INFO [src/rendezvous_server.rs:1251] Key: wUrf0XQ0jTpxorpiLZWXBPRwD0R5y4ngMKgN7kaP4Ag=
[2026-04-14 14:19:02.340566 +00:00] INFO [src/peer.rs:84] DB_URL=./db_v2.sqlite3
[2026-04-14 14:19:02.342270 +00:00] DEBUG [/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/hyper-0.14.32/src/client/connect/dns.rs:122] resolving host="api.rustdesk.com"
[2026-04-14 14:19:02.342284 +00:00] DEBUG [src/database.rs:58] MAX_DATABASE_CONNECTIONS=1
[2026-04-14 14:19:02.347730 +00:00] DEBUG [<unnamed>:0] PRAGMA page_size = 4096; …; rows affected: 0, rows returned: 2, elapsed: 4.763ms
PRAGMA page_size = 4096;
PRAGMA locking_mode = NORMAL;
PRAGMA journal_mode = WAL;
PRAGMA foreign_keys = ON;
PRAGMA synchronous = FULL;
PRAGMA auto_vacuum = NONE;
[2026-04-14 14:19:02.359522 +00:00] DEBUG [<unnamed>:0] create table if not …; rows affected: 0, rows returned: 0, elapsed: 11.491ms
create table if not exists peer (
guid blob primary key not null,
id varchar(100) not null,
uuid blob not null,
pk blob not null,
created_at datetime not null default(current_timestamp),
user blob,
status tinyint,
note varchar(300),
info text not null
) without rowid;
create unique index if not exists index_peer_id on peer (id);
create index if not exists index_peer_user on peer (user);
create index if not exists index_peer_created_at on peer (created_at);
create index if not exists index_peer_status on peer (status);
[2026-04-14 14:19:02.359547 +00:00] INFO [src/rendezvous_server.rs:107] serial=0
[2026-04-14 14:19:02.359594 +00:00] INFO [src/common.rs:45] rendezvous-servers=["localhost"]
[2026-04-14 14:19:02.359600 +00:00] INFO [src/rendezvous_server.rs:109] Listening on tcp/udp :21116
[2026-04-14 14:19:02.359601 +00:00] INFO [src/rendezvous_server.rs:110] Listening on tcp :21115, extra port for NAT test
[2026-04-14 14:19:02.359602 +00:00] INFO [src/rendezvous_server.rs:111] Listening on websocket :21118
[2026-04-14 14:19:02.359609 +00:00] DEBUG [libs/hbb_common/src/udp.rs:36] Receive buf size of udp [::]:21116: Ok(212992)
[2026-04-14 14:19:02.359628 +00:00] DEBUG [src/rendezvous_server.rs:1357] listen on udp Some([::]:21116)
[2026-04-14 14:19:02.359641 +00:00] INFO [src/rendezvous_server.rs:146] mask: None
[2026-04-14 14:19:02.359642 +00:00] INFO [src/rendezvous_server.rs:147] local-ip: ""
[2026-04-14 14:19:02.359658 +00:00] INFO [src/common.rs:45] relay-servers=["localhost"]
[2026-04-14 14:19:02.359676 +00:00] DEBUG [src/rendezvous_server.rs:1369] listen on tcp Ok([::]:21116)
[2026-04-14 14:19:02.359690 +00:00] DEBUG [src/rendezvous_server.rs:1369] listen on tcp Ok([::]:21115)
[2026-04-14 14:19:02.359697 +00:00] DEBUG [src/rendezvous_server.rs:1369] listen on tcp Ok([::]:21118)
[2026-04-14 14:19:02.359698 +00:00] INFO [src/rendezvous_server.rs:161] ALWAYS_USE_RELAY=Y
[2026-04-14 14:19:02.359707 +00:00] INFO [src/rendezvous_server.rs:193] Start
[2026-04-14 14:19:02.359722 +00:00] DEBUG [libs/hbb_common/src/udp.rs:36] Receive buf size of udp [::]:0: Ok(212992)
[2026-04-14 14:19:02.361504 +00:00] DEBUG [/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/hyper-0.14.32/src/client/connect/http.rs:542] connecting to 49.12.46.241:443
[2026-04-14 14:19:02.424698 +00:00] DEBUG [/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/hyper-0.14.32/src/client/connect/http.rs:545] connected to 49.12.46.241:443
[2026-04-14 14:19:02.424730 +00:00] DEBUG [/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rustls-0.21.12/src/client/hs.rs:73] No cached session for DnsName("api.rustdesk.com")
[2026-04-14 14:19:02.424797 +00:00] DEBUG [/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rustls-0.21.12/src/client/hs.rs:132] Not resuming any session
[2026-04-14 14:19:02.487632 +00:00] DEBUG [/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rustls-0.21.12/src/client/hs.rs:615] Using ciphersuite TLS13_AES_256_GCM_SHA384
[2026-04-14 14:19:02.487652 +00:00] DEBUG [/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rustls-0.21.12/src/client/tls13.rs:142] Not resuming
[2026-04-14 14:19:02.487760 +00:00] DEBUG [/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rustls-0.21.12/src/client/tls13.rs:381] TLS1.3 encrypted extensions: [ServerNameAck, Protocols([ProtocolName(687474702f312e31)])]
[2026-04-14 14:19:02.487779 +00:00] DEBUG [/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rustls-0.21.12/src/client/hs.rs:472] ALPN protocol is Some(b"http/1.1")
[2026-04-14 14:19:02.489695 +00:00] DEBUG [/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/hyper-0.14.32/src/proto/h1/io.rs:352] flushed 583 bytes
[2026-04-14 14:19:02.554802 +00:00] DEBUG [/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/hyper-0.14.32/src/proto/h1/io.rs:211] parsed 9 headers
[2026-04-14 14:19:02.554861 +00:00] DEBUG [/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/hyper-0.14.32/src/proto/h1/conn.rs:224] incoming body is content-length (73 bytes)
[2026-04-14 14:19:02.554907 +00:00] DEBUG [/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/hyper-0.14.32/src/proto/h1/conn.rs:300] incoming body completed
[2026-04-14 14:19:02.554987 +00:00] DEBUG [/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/hyper-0.14.32/src/client/pool.rs:380] pooling idle connection for ("https", api.rustdesk.com)Key Observations from Logs
Port Connectivity TestOn another terminal, verify all required ports appear reachable locally: $ nc -v -w 1 localhost 21115
Connection to localhost port 21115 [tcp/*] succeeded!
$ nc -v -w 1 localhost 21116
Connection to localhost port 21116 [tcp/*] succeeded!
$ nc -v -w 1 -u localhost 21116
Connection to localhost port 21116 [udp/*] succeeded!
$ nc -v -w 1 localhost 21117
Connection to localhost port 21117 [tcp/*] succeeded!
$ nc -v -w 1 localhost 21118
Connection to localhost port 21118 [tcp/*] succeeded!
HJ
idjtw99rmb6*Client ConfigurationConfigured the client manually using ID Server and Key
Client UI
Server Logs During Client AttemptsEach client attempt results in a short-lived TCP connection: [2026-04-14 14:19:18.722947 +00:00] DEBUG [src/rendezvous_server.rs:1143] Tcp connection from [::1]:38376, ws: false
[2026-04-14 14:19:18.723942 +00:00] DEBUG [src/rendezvous_server.rs:1199] Tcp connection from [::1]:38376 closed
[2026-04-14 14:20:20.902202 +00:00] DEBUG [src/rendezvous_server.rs:1143] Tcp connection from [::1]:58324, ws: false
[2026-04-14 14:20:21.722775 +00:00] DEBUG [src/rendezvous_server.rs:1143] Tcp connection from [::1]:58326, ws: false
[2026-04-14 14:20:21.723320 +00:00] DEBUG [src/rendezvous_server.rs:1199] Tcp connection from [::1]:58326 closed
[2026-04-14 14:20:21.913355 +00:00] DEBUG [src/rendezvous_server.rs:1199] Tcp connection from [::1]:58324 closed
[2026-04-14 14:21:07.938607 +00:00] DEBUG [src/rendezvous_server.rs:1143] Tcp connection from [::1]:48276, ws: false
[2026-04-14 14:21:08.947254 +00:00] DEBUG [src/rendezvous_server.rs:1199] Tcp connection from [::1]:48276 closed
[2026-04-14 14:21:22.724163 +00:00] DEBUG [src/rendezvous_server.rs:1143] Tcp connection from [::1]:53340, ws: false
[2026-04-14 14:21:22.724730 +00:00] DEBUG [src/rendezvous_server.rs:1199] Tcp connection from [::1]:53340 closed
[2026-04-14 14:22:26.723989 +00:00] DEBUG [src/rendezvous_server.rs:1143] Tcp connection from [::1]:48848, ws: false
[2026-04-14 14:22:26.724796 +00:00] DEBUG [src/rendezvous_server.rs:1199] Tcp connection from [::1]:48848 closed
[2026-04-14 14:23:27.724178 +00:00] DEBUG [src/rendezvous_server.rs:1143] Tcp connection from [::1]:46810, ws: false
[2026-04-14 14:23:27.724818 +00:00] DEBUG [src/rendezvous_server.rs:1199] Tcp connection from [::1]:46810 closed
[2026-04-14 14:25:24.897200 +00:00] DEBUG [src/rendezvous_server.rs:1143] Tcp connection from [::1]:58400, ws: false
[2026-04-14 14:25:24.897714 +00:00] DEBUG [src/rendezvous_server.rs:1199] Tcp connection from [::1]:58400 closed
[2026-04-14 14:26:25.901243 +00:00] DEBUG [src/rendezvous_server.rs:1143] Tcp connection from [::1]:38400, ws: false
[2026-04-14 14:26:25.901966 +00:00] DEBUG [src/rendezvous_server.rs:1199] Tcp connection from [::1]:38400 closed
[2026-04-14 14:27:28.902146 +00:00] DEBUG [src/rendezvous_server.rs:1143] Tcp connection from [::1]:52576, ws: false
[2026-04-14 14:27:28.902845 +00:00] DEBUG [src/rendezvous_server.rs:1199] Tcp connection from [::1]:52576 closed
[2026-04-14 14:28:31.902305 +00:00] DEBUG [src/rendezvous_server.rs:1143] Tcp connection from [::1]:36200, ws: false
[2026-04-14 14:28:31.903039 +00:00] DEBUG [src/rendezvous_server.rs:1199] Tcp connection from [::1]:36200 closed
[2026-04-14 14:29:32.902085 +00:00] DEBUG [src/rendezvous_server.rs:1143] Tcp connection from [::1]:53684, ws: false
[2026-04-14 14:29:32.903013 +00:00] DEBUG [src/rendezvous_server.rs:1199] Tcp connection from [::1]:53684 closed
[2026-04-14 14:30:33.902034 +00:00] DEBUG [src/rendezvous_server.rs:1143] Tcp connection from [::1]:60916, ws: false
[2026-04-14 14:30:33.902629 +00:00] DEBUG [src/rendezvous_server.rs:1199] Tcp connection from [::1]:60916 closedThis repeats periodically, suggesting:
Additional Notes
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 9 replies
-
|
same here |
Beta Was this translation helpful? Give feedback.
-
|
Has anyone fixed this issue? ----- UPDATE ----- I was running a VPN service alongside the hbbs server, and I used the tun0 interface to handle all traffic. Since the heartbeat packet traffic for hbbs was handled by tun0, the heartbeat packets were sent in the wrong direction. You can try using the following command to check if the database path is correct, to better identify the issue.
|
Beta Was this translation helpful? Give feedback.
-
|
Your TCP tests are all green, but the part of the RustDesk handshake that actually makes a client go "ready" — ID registration and heartbeat — runs over UDP/21116, not TCP. The short TCP connections you see opening and closing are normal: those are the client's NAT-test / connection probes (the TCP listener on 21116 only handles NAT-test and "online" queries). The registration that has to succeed before the client is "ready" comes in on UDP ( 1.
|
Beta Was this translation helpful? Give feedback.





Thanks for the detailed follow-up — and the good news first: your config is correct now. The startup log confirms
relay-servers=[],rendezvous-servers=[],ALWAYS_USE_RELAY=N, you're publishing UDP/21116, and the client points at the LAN IP. So config is off the table, and your two attachments actually pin down where it's stuck.Both files agree on one thing: your client's packets reach the server's port, but the server replies to none of them.
The pcap
Every UDP flow to
:21116is one-way: