Install and Configure a Self-Hosted RustDesk Server

Install RustDesk Server (Hbbs & Hbbr)

RustDesk has two main components:

  • Hbbs (ID Server)
  • Hbbr (Relay Server)

🔹 On Ubuntu / Debian

1️⃣ Update your system:

sudo apt update && sudo apt upgrade -y

2️⃣ Download RustDesk Server binaries:

wget <https://github.com/rustdesk/rustdesk/releases/latest/download/rustdesk-server-linux-amd64.zip>

3️⃣ Extract the files:

sudo apt install unzip -y
unzip rustdesk-server-linux-amd64.zip
cd rustdesk-server-linux-amd64

4️⃣ Start the RustDesk server:

sudo ./hbbs &
sudo ./hbbr &

🔹 On Windows Server

1️⃣ Download RustDesk Server from GitHub: https://github.com/rustdesk/rustdesk/releases

2️⃣ Extract the ZIP file to C:\\RustDesk-Server

3️⃣ Open PowerShell as Administrator and navigate to the folder:

cd C:\\RustDesk-Server

4️⃣ Run the ID Server (Hbbs) and Relay Server (Hbbr):

./hbbs.exe
./hbbr.exe

Step 3: Configure Firewall Rules

For RustDesk to function properly, allow these ports:

  • UDP & TCP 21115-21119 (ID Server and Relay)

Ubuntu/Linux:

sudo ufw allow 21115:21119/tcp
sudo ufw allow 21115:21119/udp
sudo ufw enable

Windows Server:

New-NetFirewallRule -DisplayName "RustDesk Ports" -Direction Inbound -Protocol TCP -LocalPort 21115-21119 -Action Allow
New-NetFirewallRule -DisplayName "RustDesk Ports" -Direction Inbound -Protocol UDP -LocalPort 21115-21119 -Action Allow

Step 4: Configure RustDesk Clients to Use Your Server

To use your self-hosted server, configure RustDesk clients manually:

  1. Open RustDesk
  2. Go to Settings > Network
  3. Enter your Server IP in the ID Server and Relay Server fields
  4. Click OK

Alternatively, deploy RustDesk with the correct config automatically:

  • Windows:
msiexec /i rustdesk.msi ID_SERVER=your_server_ip RELAY_SERVER=your_server_ip /qn

  • Linux:
echo -e "[network]\\nid_server=your_server_ip
relay_server=your_server_ip" > ~/.config/rustdesk/RustDesk.toml

Troubleshooting & Common Issues

❌ RustDesk Clients Cannot Connect

✅ Check if the server is running:

ps aux | grep hbbs
ps aux | grep hbbr

If not running, restart them.

✅ Check if firewall ports are open:

sudo ufw status

Ensure ports 21115-21119 are allowed.

✅ Verify server logs:

tail -f /var/log/syslog

❌ RustDesk Clients Show Wrong ID

✅ Ensure clients are set to your correct server IP.

❌ RustDesk Disconnects Frequently

✅ Use a stable internet connection and ensure no double NAT or VPN issues.

Conclusion

Setting up a self-hosted RustDesk server enhances security and privacy by giving you full control over remote access. Once configured, you can mass-deploy it across your organization, ensuring all users connect through your private server.

Happy remote accessing! 🚀


Comments

4 responses to “Install and Configure a Self-Hosted RustDesk Server”

  1. Graham Gibby Avatar
    Graham Gibby

    In other guides, TCP port 8000 and UDP 21116 are configured, which you leave out.

    Do they need to be opened?

  2. I used to be very happy to search out this internet-site.I wished to thanks in your time for this excellent learn!! I undoubtedly having fun with each little little bit of it and I’ve you bookmarked to check out new stuff you weblog post.

  3. Right here is the perfect blog for anyone who hopes to understand this topic.
    You realize so much its almost hard to argue with you (not that I actually will need to…HaHa).

    You definitely put a brand new spin on a topic
    which has been written about for decades. Wonderful
    stuff, just wonderful!

  4. Wow, awesome blog layout! How long have you been blogging for?
    you made blogging look easy. The overall look of
    your site is wonderful, as well as the content!

Leave a Reply

Your email address will not be published. Required fields are marked *