
Deploy RustDesk Server
RustDesk Server OSS self-hosted: hbbs (ID server) + hbbr (relay).
Just deployed
/root
Just deployed
Deploy and Host RustDesk Server on Railway
RustDesk Server OSS is the self-hosted backend of the open-source RustDesk remote desktop app. It ships two tiny services: hbbs, the ID/rendezvous server where your devices register, and hbbr, the relay that carries session traffic when peers cannot connect directly. Your own TeamViewer-style server — no third-party accounts involved.
About Hosting RustDesk Server
Hosting RustDesk Server means running both components side by side. hbbs holds the Ed25519 encryption key and the device registry on a persistent volume; hbbr re-emits encrypted session traffic between peers. Each service gets a public TCP proxy on Railway (ports 21116 and 21117). Because Railway does not expose UDP, all sessions flow through the relay over TCP — fully functional, slightly less efficient than direct P2P. Keys are generated automatically on first boot, printed in the logs, and shared between services over Railway's private network, so setup is just three values pasted into your RustDesk clients.
Common Use Cases
- Remote support for family and friends without third-party accounts or subscriptions
- Secure access to your home or office machines from anywhere (PC ↔ mobile)
- Privacy-first alternative to commercial tools: sessions only touch your own server
Dependencies for RustDesk Server Hosting
- RustDesk client apps (Windows/macOS/Linux/Android/iOS) configured with your ID server endpoint, relay endpoint and public key
- Persistent volume attached to
hbbs(keeps keys and SQLite registry across deploys) - One public TCP proxy per service (created automatically by this template)
Implementation Details
- One image, two roles: both services deploy the same Docker image; each picks its role from the Railway-injected
RAILWAY_SERVICE_NAME(hbbr→ relay, otherwise ID server). No start commands needed. - Zero-config key sharing:
hbbsgenerates the keypair on first boot, prints the public key in its logs and serves it privately athbbs.railway.internal:8080;hbbrfetches it automatically at startup. - Self-wiring relay:
hbbsgetsRELAY_ADDR=${{hbbr.RAILWAY_TCP_PROXY_DOMAIN}}:${{hbbr.RAILWAY_TCP_PROXY_PORT}}, so every client learns the relay address by itself. - Persistence: 0.5GB volume mounted at
/rootstoresid_ed25519*anddb_v2.sqlite3.
Why Deploy RustDesk Server on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying RustDesk Server on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
Template Content
