Enhanced Security Measures and Nginx Configuration for RustDesk With Vultr


While RustDesk server Ubuntu provides a secure remote desktop solution, deploying it in a production environment requires additional security measures. This section focuses on enhancing security measures and configuring Nginx as a reverse proxy to ensure secure access to RustDesk services through a subdomain.


Before proceeding with the security enhancements, ensure that you have completed the initial setup of RustDesk as outlined in the previous section. Additionally, make sure you have administrative access to your Ubuntu server and familiarity with basic server administration tasks.

Enhanced Security Measures

  • Allow Nginx Communication on HTTP Port 80:
    Start by allowing Nginx communication on HTTP port 80 through the Uncomplicated Firewall (UFW). This step is crucial for Nginx to serve requests through the default HTTP port.
    Use the following command to allow HTTP traffic:

$ sudo ufw allow 80/tcp

Reload the firewall rules to apply the changes:

$ sudo ufw reload

Nginx Configuration for RustDesk:

Next, create a new Nginx configuration file dedicated to RustDesk. This configuration file will specify the subdomain and proxy settings for RustDesk, enabling secure access to its services.

Create the Nginx configuration file using the following command:

$ sudo touch /etc/nginx/conf.d/rustdesk.example.conf

Open the newly created configuration file in a text editor:

$ sudo nano /etc/nginx/conf.d/rustdesk.example.conf

Add the following configuration to the file, replacing rustdesk.example.com with your desired subdomain:

server {

    listen 80;

    listen [::]:80;

    # Set your subdomain

    server_name rustdesk.example.com;

    # Proxy Requests to the RustDesk host port

    location / {


      proxy_set_header Host $host;

      proxy_set_header X-Real-IP $remote_addr;



  • Save the changes and exit the text editor.
  • Verify Nginx Configuration and Restart Nginx:
    Before applying the Nginx configuration changes, it’s essential to verify the configuration for any syntax errors. Use the following command to perform a syntax check:

$ sudo nginx -t

If the configuration test is successful, restart Nginx to apply the changes:

$ sudo systemctl restart nginx

  • Nginx is now configured as a reverse proxy, securely forwarding requests to the RustDesk server running on port 21117. This setup enhances the security of your RustDesk deployment, ensuring encrypted and authenticated access to its services.


In conclusion, this section has outlined enhanced security measures and Nginx configuration for RustDesk on Ubuntu. By following these steps, you’ve strengthened the security of your RustDesk installation, making it suitable for production environments.

Ensure to regularly update and monitor your server’s security posture to mitigate potential vulnerabilities and maintain a secure remote desktop environment.