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

5.6 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.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 %}}