Setting Up a RustDesk Server with Docker

h3x0rh3x0r
3 min read

Rustdesk

RustDesk is a fantastic tool for remote desktop management, providing a seamless experience for both users and administrators. Setting up your own RustDesk server can give you better control, privacy, and performance. Here’s a step-by-step guide to get your RustDesk server up and running using Docker.

Prerequisites

Before we start, ensure you have Docker installed on your system. If not, follow these steps to install Docker.

Installing Docker

  1. Download the Docker installation script:

    You can download the Docker installation script from the following link: Docker Installation Script

  2. Make the script executable:

    Open your terminal and run the following command to make the script executable:

     chmod +x ./docker-install.sh
    
  3. Run the Docker installation script:

    Execute the script to install Docker:

     ./docker-install.sh
    
  4. Verify Docker installation:

    After the installation is complete, verify that Docker is installed by checking the version:

     docker version
    

Setting Up RustDesk Server with Docker-Compose

  1. Create a directory for your Docker setup:

     mkdir rustdesk-docker
     cd rustdesk-docker
    
  2. Create and edit the docker-compose.yml file:

    Inside the rustdesk-docker directory, create a file named docker-compose.yml and paste the following configuration:

     version: '3.3'
    
     networks:
       rustdesk-net:
         external: false
    
     services:
       hbbs:
         container_name: hbbs
         ports:
           - 21115:21115
           - 21116:21116
           - 21116:21116/udp
           - 21118:21118
         image: rustdesk/rustdesk-server:latest
         command: hbbs -r rustdesk.example.com:21117
         volumes:
           - ./data:/root
         networks:
           - rustdesk-net
         depends_on:
           - hbbr
         restart: unless-stopped
    
       hbbr:
         container_name: hbbr
         ports:
           - 21117:21117
           - 21119:21119
         image: rustdesk/rustdesk-server:latest
         command: hbbr
         volumes:
           - ./data:/root
         networks:
           - rustdesk-net
         restart: unless-stopped
    

    You can adjust the ports and hostname as per your requirements. For now, we'll use the default settings.

  3. Start the RustDesk server:

    Run the following command to start the RustDesk server in detached mode:

     sudo docker-compose up -d
    
  4. Verify the containers are running:

    Check if the RustDesk server containers are running:

     sudo docker-compose ps
    
  5. Check the logs:

    To ensure everything is running smoothly, check the logs:

     sudo docker-compose logs -f
    

Configuring DNS

Since we are running the server locally, we need to add a new DNS record on the client-side to resolve the hostname to our server's IP address.

  1. Edit the hosts file:

    • On Windows: C:\Windows\System32\drivers\etc\hosts

    • On Linux: /etc/hosts

Add the following line:

    rustdesk.example.com 192.168.8.10

Replace 192.168.8.10 with your server's static IP address.

Client Configuration

On the client-side, configure the network settings in RustDesk:

  1. ID Server: Enter the address or IP of your RustDesk server.

  2. Key: Use the key generated during the setup (check the Docker logs for the key).

You should now have a fast and secure RustDesk server running on your own infrastructure. Enjoy the enhanced performance and control!

Happy remoting!

0
Subscribe to my newsletter

Read articles from h3x0r directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

h3x0r
h3x0r

An aspiring cybersecurity student with a passion for keeping people and data safe. Constantly learning and adapting to the ever-changing landscape of cybersecurity to become a valuable asset to any organization.