Back to articles
Security & Anti-DDoS

Deploy RustDesk with a Private IDRelay Server: High-Performance and Secure Remote Computer Control

A detailed guide to deploying RustDesk with a private IDRelay server for high-performance, secure remote computer control without relying on third-party relay services. Covers...

DPTCloud Engineering4 min read
Deploy RustDesk with a Private IDRelay Server: High-Performance and Secure Remote Computer Control

Introduction to RustDesk and Private IDRelay Server

RustDesk is an open-source remote desktop solution that enables users to access and control computers remotely via secure connections. While the default RustDesk deployment uses a public relay server managed by RustDesk, deploying a private IDRelay server allows you to fully control data transmission, improve performance, and achieve maximum security.

This guide walks through setting up a private IDRelay server on a VPS, enabling high-performance, secure remote access without relying on third-party services. This solution is ideal for organizations requiring strict data control, robust security, and high-speed remote access.

Prerequisites and Installing the Private IDRelay Server

To deploy a private IDRelay server, you need:

Install required tools:

sudo apt update
sudo apt install -y git build-essential curl

Clone and configure the IDRelay server:

git clone https://github.com/rustdesk/rustdesk-idrelay.git
cd rustdesk-idrelay
# Create configuration file (config.json) with custom settings
cat > config.json << EOF
{
  "bind": "0.0.0.0:21115",
  "tls": true,
  "cert": "/path/to/cert.pem",
  "key": "/path/to/key.pem",
  "auth": "your_secret_key"
}
EOF

Configuring and Securing the IDRelay Server

To ensure security, consider the following:

  • Use SSL/TLS certificates signed by a trusted CA or self-signed (generated via Let's Encrypt or OpenSSL).
  • Set the auth field in config.json to a strong secret key.
  • Restrict connections to authorized IP addresses using a firewall or Nginx reverse proxy.
  • Configure the firewall (UFW or firewalld) to open port 21115 (or a custom port) and block unnecessary ports.

Run the IDRelay server as a systemd service for automatic startup:

sudo systemctl enable rustdesk-idrelay
sudo systemctl start rustdesk-idrelay

Deploying RustDesk Client and Connecting

On the computer to be controlled (client), install RustDesk from the official site https://rustdesk.com.

In the installation wizard, select "Custom" and enter the private IDRelay server details:

  • Server Address: your-server-ip:21115
  • Auth Key: your_secret_key (from config.json)

On the controlling computer (host), install RustDesk and select "Server" mode. When prompted, enter the private IDRelay server address to connect.

Verification and Testing

To verify connectivity, perform the following steps:

  1. Start the IDRelay server and check its status:
  2. sudo systemctl status rustdesk-idrelay
  3. Test the connection from a client machine:
  4. curl -v https://your-server-ip:21115
  5. Attempt to connect from another machine using the RustDesk client with the private IDRelay server configuration.

Troubleshooting

  • Cannot connect: Check firewall rules, ensure port 21115 is open, and verify IDRelay server configuration.
  • SSL certificate errors: Ensure the certificate is valid and correctly placed at the specified path.
  • Authentication key mismatch: Verify that the auth value in config.json matches the key entered in the client.

References

DPTCloud Tier III Infrastructure

Recommended NVMe Cloud VPS Plans to Deploy This Setup

Enterprise RAID 10 NVMe SSDs, CMC & FPT District 9 uplinks with Anycast Anti-DDoS and 99.99% SLA.

View 22 VPS Plans
ECO · vn-02

VPS-2E

94.600 ₫ / mo

10% VAT included

  • CPU: 2 vCPU
  • RAM: 2 GB
  • SSD: 30 GB NVMe
ECO · vn-02Recommended

VPS-3E

170.500 ₫ / mo

10% VAT included

  • CPU: 2 vCPU
  • RAM: 4 GB
  • SSD: 50 GB NVMe
BASIC · vn-01Recommended

VPS-05

457.600 ₫ / mo

10% VAT included

  • CPU: 4 vCPU
  • RAM: 8 GB
  • SSD: 50 GB NVMe

Related Articles

View all
ZaloZalo SupportDiscord0384 753 478