DOGAI

DOGAI

分享高质量GitHub开源项目,低价高质量服务器请看:https://www.vps567.com 香港CN2服务器 高防美国和大陆服务器 还有全球CDN加速。

RustDesk Self-Built Relay Server Open Source Remote Control Software

RustDesk, as the name suggests, is an open-source remote desktop tool built on the efficient Rust language.

Advantages:

  1. Lightweight: Whether on the server or client side, regardless of the platform, the software is compact and fully functional.
  2. Cross-platform support: Supports bidirectional control on Android, Linux, and Windows, and unidirectional control on iOS.
  3. Secure and controllable: The software is open-source, the server can be self-built, and communication is encrypted.
  4. Efficient bandwidth: Only requires 2-3M for smooth 1080P, supports TCP hole punching for end-to-end P2P connections.

RustDesk official website: https://rustdesk.com/zh/

GitHub: https://github.com/rustdesk/rustdesk

Setup Tutorial#

First, we need to prepare a server with a public IP. I recommend Wu Liu Qi Cloud for the server: https://www.vps567.com Hong Kong 2H2G5M server for $20/month, with high-defense CDN acceleration starting at just $18/month.

Then install the Docker environment: Docker one-click installation script

And open the ports: 21115-21119. If you do not want to use the default ports, you can modify the mapped ports during the installation process.

Docker Pull#

sudo docker image pull rustdesk/rustdesk-server
sudo docker run --name hbbs -p 21115:21115 -p 21116:21116 -p 21116:21116/udp -p 21118:21118 -v `pwd`:/root -td --net=host rustdesk/rustdesk-server hbbs 
sudo docker run --name hbbr -p 21117:21117 -p 21119:21119 -v `pwd`:/root -td --net=host rustdesk/rustdesk-server hbbr

Docker Compose Pull#

networks:
  rustdesk-net:
    external: false

services:
  hbbs:
    container_name: hbbs
    ports:
      - 21115:21115
      - <hbbs_port>:21116 # Custom hbbs mapped port
      - <hbbs_port>:21116/udp # Custom hbbs mapped port
    image: rustdesk/rustdesk-server
    command: hbbs 
    volumes:
      - <mount_path>:/root # Custom mount directory
    networks:
      - rustdesk-net
    depends_on:
      - hbbr
    restart: unless-stopped
    deploy:
      resources:
        limits:
          memory: 64M

  hbbr:
    container_name: hbbr
    ports:
      - <hbbr_port>:21117 # Custom hbbr mapped port
    image: rustdesk/rustdesk-server
    command: hbbr
    volumes:
      - <mount_path>:/root # Custom mount directory
    networks:
      - rustdesk-net
    restart: unless-stopped
    deploy:
      resources:
        limits:
          memory: 64M

Note: –net=host is only applicable to Linux, allowing hbbs/hbbr to see each other's real IP instead of the fixed container ip (172.17.0.1). If –net=host runs normally, the -p option will not take effect and can be removed.

If you encounter connection issues on non-Linux systems, please remove –net=host.

Next, we need to enter our server IP in the settings of both the control and controlled ends under ID/Relay Server.

Snipaste_2024-11-17_16-53-09

There is also a Key for encrypted connections. The hbbs will automatically generate a pair of encrypted private and public keys (located in the running directory under id_ed25519 and id_ed25519.pub files) during its first run, primarily for communication encryption.

cat ./id_ed25519.pub

If you want to change the key, please delete the id_ed25519 and id_ed25519.pub files and restart hbbs/hbbr. hbbs will generate a new key pair.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.