Files
doc.rustdesk.com/content/self-host/rustdesk-server-pro/installscript/Script/_index.zh-cn.md
rustdesk 56cfd26e35 seo/geo
2026-03-20 18:42:55 +08:00

4.9 KiB
Raw Blame History

title, weight, description, keywords
title weight description keywords
install.sh 4 RustDesk 的install.sh文档提供安装、配置、部署和故障排查指南。
rustdesk server pro install.sh
rustdesk pro linux install
rustdesk pro script install
rustdesk self-host pro linux
rustdesk server pro setup

什么时候应该使用 install.sh

当你想在 Linux 主机上用 systemd 快速部署 RustDesk Server Pro 时使用。它适合单机、直接、脚本化的安装场景,脚本会安装依赖、放置二进制、创建服务,并可选地为 Web 控制台准备 HTTPS。

install.sh 快速答案

  • 适合简单的 Linux 部署。
  • 如果想更容易升级、回滚和容器化运维,请改用 Docker
  • 开始前先准备好 Pro 授权。
  • 如果使用域名,脚本可以同时配置 nginxcertbot
  • 初装之后升级请使用 update.sh

{{% notice note %}} 别忘了从 https://rustdesk.com/pricing/ 取得授权,查阅授权页面以了解详情。

请在进行这个简单安装之前先阅读OSS安装。您可以在那里了解更多底层细节。 {{% /notice %}}

安装

复制并在您的 Linux 控制台中贴上下列指令以安装 RustDesk 服务器专业版。

wget -qO- https://raw.githubusercontent.com/rustdesk/rustdesk-server-pro/main/install.sh | bash

{{% notice note %}} 我建议使用Docker镜像;它极大地简化了部署解决方案以及更新的过程。资源消耗非常低。

并且请在您的主目录下运行上述命令,而不是在您没有写权限的目录。 {{% /notice %}}

它做了什么:

  • 安装一些依赖项
  • 在可用情况下设定 UFW 防火墙
  • 创建工作目录 /var/lib/rustdesk-server 和日志目录 /var/log/rustdesk-server
  • 将可执行文件安装到 /usr/bin
  • 下载并解压 RustDesk Pro 服务到上述文件夹
  • 为 hbbs 和 hbbr 创建 systemd 服务(服务名称为 rustdesk-hbbs.servicerustdesk-hbbr.service
  • 如果您选择了域名,它将安装 Nginx 和 Certbot让 API 能够在端口 443 (HTTPS) 上访问,并通过端口 80 获取 SSL 证书,它会自动续期。当 https 准备就绪后,请使用 https://yourdomain.com 访问,而不是 https://yourdomain.com:21114

{{% notice note %}} 如何手动为 Web 控制台设置 HTTPS。 {{% /notice %}}

{{% notice note %}} 如果 systemd 服务启动失败,可能与 SELinux 有关,请查看这里。 {{% /notice %}}

{{% notice note %}} 如果您的客户端无法连接到您的服务器或您无法访问 Web 控制台,请查看这里。 {{% /notice %}}

升级

复制并在您的 Linux 终端机中贴上下列指令以升级现有的 RustDesk 服务器专业版安装。您可以使用 cron 定期执行此命令。

wget -qO- https://raw.githubusercontent.com/rustdesk/rustdesk-server-pro/main/update.sh | bash

{{% notice note %}} 如果您在使用此脚本时遇到问题,我建议您浏览脚本并逐步手动执行步骤。

并且请在您的主目录下运行上述命令,而不是在您没有写权限的目录。 {{% /notice %}}

它做了什么:

  • 检查 RustDesk-Server-Pro 的新版本
  • 如果找到新版本,移除 API 文件并下载新可执行文件和 API 文件

从开源版本转换

复制并在您的 Linux 终端机中贴上下列指令以从 RustDesk 伺服器转换至 RustDesk 伺服器专业版。

wget -qO- https://raw.githubusercontent.com/rustdesk/rustdesk-server-pro/main/convertfromos.sh | bash

{{% notice note %}} 请将 21114 TCP 端口添加到您的防火墙,这是 Web 控制台和 RustDesk 客户端中用户登录的额外端口。 {{% /notice %}}

{{% notice note %}} 如果您在使用此脚本时遇到问题,我建议切换到 Docker 安装。或者,您可以浏览脚本并逐步手动执行步骤。 {{% /notice %}}

它做了什么:

  • 停用并移除旧服务
  • 安装依赖包
  • 在可用情况下设定 UFW 防火墙
  • 创建文件夹 /var/lib/rustdesk-server 并将证书复制到这里
  • 删除 /var/log/rustdesk 并创建 /var/log/rustdesk-server
  • 下载并解压 RustDesk Pro 服务到上述文件夹
  • 为 hbbs 和 hbbr 创建 systemd 服务(服务名称为 rustdesk-hbbs.service 和 rustdesk-hbbr.service
  • 如果您选择了域名,它将安装 Nginx 和 Certbot让 API 能够在端口 443 (HTTPS) 上访问,并通过端口 80 获取 SSL 证书,它会自动续期