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...
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:
- A Linux VPS (from Cloud VPS with L3/L4/L7 Anycast Anti-DDoS) running Ubuntu 20.04+ or CentOS 8+.
- A static IP address and root access.
- System time synchronized via NTP.
- An SSL/TLS certificate for secure connections (you can use automated ACME SSL/TLS certificate renewal with ECDSA P-256 and non-disruptive Nginx reload).
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
authfield inconfig.jsonto 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:
- Start the IDRelay server and check its status:
- Test the connection from a client machine:
- Attempt to connect from another machine using the RustDesk client with the private IDRelay server configuration.
sudo systemctl status rustdesk-idrelay
curl -v https://your-server-ip:21115
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
authvalue inconfig.jsonmatches the key entered in the client.
References
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.
VPS-3E
10% VAT included
- CPU: 2 vCPU
- RAM: 4 GB
- SSD: 50 GB NVMe
