部署你自己的 CrossDesk 服务。Run your own CrossDesk server.
使用自己的服务器协调远程连接,并在无法直连时提供 TURN 中继。控制端与被控端需要连接同一套服务。Use your own server to coordinate remote connections and relay traffic when a direct connection is unavailable. Connect both clients to the same service.
1. 准备服务端与发布配置1. Prepare the server and release configuration
准备已安装 Docker Engine 与 Compose 插件的 Linux amd64 / arm64
服务器。从
CrossDesk Server Releases
下载同一发布版本的 compose.yaml 和
env.example,放到同一部署目录。Prepare a Linux amd64 or arm64 server with Docker Engine and the
Compose plugin. Download compose.yaml and
env.example from the same
CrossDesk Server release
into one deployment directory.
配置文件与镜像版本应配套使用。部署前请核对 服务端部署文档 的当前要求。Use matching configuration files and image versions. Review the current requirements in the server deployment documentation.
cp env.example .env
openssl rand -hex 32
openssl rand -hex 32
编辑
.env,填写真实地址、固定镜像版本和持久化目录。两次生成的不同密钥分别用于
COTURN_AUTH_SECRET 和
COTURN_STATELESS_NONCE_SECRET。Edit .env with your real addresses, a fixed image
version, and persistent storage paths. Use the two different
generated keys for COTURN_AUTH_SECRET and
COTURN_STATELESS_NONCE_SECRET.
2. 配置网络并启动服务2. Configure the network and start the services
防火墙和云安全组应按实际配置允许下列端口。若修改默认端口,请同时更新对应规则。Allow the configured ports in both the server firewall and cloud security group. Update those rules if you change the defaults.
| 配置项Setting | 用途与默认值Purpose and defaults |
|---|---|
EXTERNAL_IP / INTERNAL_IP |
服务器公网地址与 Coturn 可绑定的本机地址。Public server address and a local address Coturn can bind to. |
CROSSDESK_SERVER_PORT |
信令端口;Compose 默认 9099 / TCP。Signaling port; the Compose default is 9099 / TCP. |
COTURN_PORT |
STUN / TURN 端口;默认 3478 / TCP 与 UDP。STUN / TURN port; the default is 3478 / TCP and UDP. |
MIN_PORT / MAX_PORT |
TURN 媒体端口范围;默认 50000–60000 / UDP。TURN media ports; the default range is 50000–60000 / UDP. |
CROSSDESK_DATA_DIR / CROSSDESK_LOG_DIR
|
数据、证书和日志的持久化目录。Persistent directories for data, certificates, and logs. |
sudo docker compose config -q
sudo docker compose pull
sudo docker compose up -d --no-build
sudo docker compose ps
保存配置后在部署目录执行以上命令。容器启动后,还需要检查证书并实际建立一次远程会话,确认信令和媒体链路均可用。Run these commands from the deployment directory after saving your configuration. Once the containers start, check the certificates and establish a remote session to verify signaling and media connectivity.
3. 配置证书与客户端3. Configure certificates and clients
- 让客户端信任你部署的证书。证书必须覆盖连接地址;使用域名时需要匹配该域名的证书。自签根证书只从自己的服务器获取。Make clients trust your deployment’s certificate. It must cover the connection address; a domain name needs a matching certificate. Obtain a self-signed root only from your own server.
- 打开桌面客户端设置中的自托管配置,填写服务器地址与信令端口,启用并保存。具体选项名称以客户端版本为准。Open the self-hosting configuration in desktop settings, enter the server address and signaling port, enable it, and save. Option names may vary by client version.
- 在控制端和被控端配置同一服务器,确认两端已连接,再使用被控端当前显示的 ID 与密码连接。Configure both clients to use the same server. After both are connected, use the remote device’s current ID and password to start a session.
证书信任命令及客户端配置见 服务端部署指南。自行部署 Web 客户端时,另按 Web 客户端文档 配置信令地址。See the server deployment guide for certificate trust commands and client settings. For a self-hosted browser client, configure its signaling address using the Web client documentation.
连接问题排查Troubleshooting connections
客户端显示未连接服务器The client cannot connect to the server
检查服务器地址、信令端口、防火墙,以及证书有效期、地址匹配与信任状态。Check the server address, signaling port, firewall, and the certificate’s validity, address match, and trust status.
已连接服务器,但找不到远程设备The server is connected but the device is offline
确认两端使用同一服务器,被控电脑仍在运行,并重新复制被控端当前显示的 ID。Confirm that both clients use the same server and the remote computer is running. Copy its current device ID again.
直连失败,无法建立远程画面Direct access fails and no remote picture appears
核对 Coturn 运行状态、TURN 端口与媒体端口范围,以及客户端和服务端版本是否兼容。Check Coturn, TURN and media ports, and compatibility between your client and server versions.