Deploy and maintain your Xray REALITY proxy with a single command!
RayLink is a modular installer and CLI for deploying and maintaining personal Xray REALITY nodes (VLESS Reality) on Linux servers. It provides one-command deployment, client-ready subscriptions, and automated self-healing.
Use this project only for legal, compliant network access. Cloud servers and bandwidth may incur charges.
- One-command deployment — Xray-core, a hardened systemd service, BBR tuning, and persistent VLESS Reality credentials, in a single line.
- Client-ready subscriptions — serves a Clash/Mihomo YAML and a universal, auto-negotiating subscription over HTTP; clients import a single URL.
- Self-healing automation — a periodic health check re-detects the public IP, runs an end-to-end Reality self-test, and automatically attempts recovery (e.g., service restart, config regeneration, upstream refresh, or target fallback) to maintain connectivity.
- Relay mode — chain
Client → Relay → Exitto hide the exit node or stabilize a flaky client→exit path. - Resilient downloads — optimized for unstable networks with built-in retries, timeouts, and support for custom mirrors/proxies.
- Comprehensive IPv6 support — automatically detects the current public address family, fully supports dual-stack networks and IPv6-only servers.
- Idempotency & configurability — safe to re-run; every default is overridable through environment variables.
Client → server:443 → Xray VLESS Reality inbound → direct outbound → Internet
In a relay architecture, network traffic is securely routed through an intermediary Relay Node before reaching the Exit Node. This introduces an additional secure routing layer to your connection. The complete network topology and data flow are as follows:
Client → Relay:443 → Exit:443 → Internet
For detailed instructions, see here
On a Linux server, allow inbound TCP traffic on ports 443 and 8080, then run:
curl -fsSL https://raw.githubusercontent.com/vanillartwork/raylink/main/install.sh | sudo bash -s -- exitThe installer prints a Universal Subscription URL and a Clash Subscription URL at the end — import whichever your client supports (see importing into clients).
Manage the node later:
sudo raylink exit # re-run / update
sudo raylink exit --health-check # run a health check nowTo deploy a Relay node upstream of your existing Exit node, please log in to your designated relay server and execute the following deployment command:
curl -fsSL https://raw.githubusercontent.com/vanillartwork/raylink/main/install.sh | sudo env UPSTREAM_SUBSCRIPTION_URL='http://EXIT_IP:8080/sub/TOKEN' bash -s -- relayReplace
http://EXIT_IP:8080/sub/TOKENwith your exit's actual Universal Subscription URL.
| Doc | Contents |
|---|---|
| getting-started.md | Start here — server prep, SSH, importing into clients, downloading config |
| exit.md | Exit node — installation, configuration, management, and health checks |
| relay.md | Relay node — architecture, upstream parameters, and firewall configuration |
| configuration.md | Every environment variable — ports, Reality, DNS profiles, IPv6, metrics, downloads |
| troubleshooting.md | Common issues, IPv6-only servers, uninstall |
raylink/
├── install.sh # bootstrap: downloads + installs the raylink CLI
├── src/ # raylink dispatcher, commands/, lib/, defaults/, templates/
├── scripts/ # build-release.sh, check.sh
└── docs/
On the server the CLI lives under /usr/local/lib/raylink/ and is linked at
/usr/local/bin/raylink.
Restrict SSH port 22 to your own IP whenever possible. After importing the
client configuration, restrict or disable the subscription port 8080.
Never share your subscription URL, client configuration, or any credentials generated by RayLink. Anyone with them can connect to your server.
Proxy services generate continuous network traffic. Monitor bandwidth usage closely and configure traffic monitoring and overage alerts with your cloud provider to avoid unexpected charges caused by quota exhaustion or node abuse.
Released under the MIT License.
By using this software, you agree to comply with all applicable laws and regulations in your jurisdiction. The developers are not responsible for any misuse of this software. For more information, please see DISCLAIMER.
RayLink 是一个用于在 Linux 服务器上部署和维护个人 Xray REALITY 节点(VLESS Reality)的模块化安装器和 CLI,提供一键部署、开箱即用的客户端订阅以及自动化自愈机制。
请仅用于合法、合规的网络访问。云服务器和流量可能产生费用。
- 一条命令极速部署 — 自动完成 Xray-core 安装、systemd 服务加固、BBR 网络调优及持久化 VLESS Reality 凭据配置,一行代码即可就绪。
- 开箱即用的客户端订阅 — 通过 HTTP 提供 Clash/Mihomo 配置文件和一个自动协商格式的通用订阅,客户端只需导入一个 URL 即可连接使用。
- 自动化自愈机制 — 服务器长期定时自检,监测服务状态并执行端到端 Reality 测试;在网络环境变化或检测到异常时,可自动重启服务、应对公网 IP 变更更新订阅文件、刷新中转上游参数或执行 fallback 切换。
- 灵活的中转模式 — 支持
客户端 → 中转节点 → 出口节点架构,有效隐藏真实出口节点,改善并稳定较差的直连链路。 - 网络容错与下载优化 — 针对复杂网络环境优化。内置完善的重试与超时管控机制,并支持灵活配置自定义镜像源,在不稳定网络下依然能顺利安装与更新。
- 完善的 IPv6 支持 — 自动识别当前公网地址族,全面兼容双栈网络,并支持 IPv6-only VPS。
- 幂等设计与高可配置性 — 可以安全地重复执行;节点所有行为与参数均可通过环境变量进行自定义覆盖。
客户端 → 服务器:443 → Xray VLESS Reality 入站 → direct 出站 → 互联网
采用中转架构时,网络流量在到达出口节点前,会先经过中继节点进行加密转发。这相当于在原本的直连链路 中引入了一个安全的中间路由层。完整的网络拓扑和数据流向如下:
客户端 → 中转节点:443 → 出口节点:443 → 互联网
详细指引参见此处
在一台 Linux 服务器上,放行入站端口 443 和 8080 TCP 流量,然后执行下面指令:
curl -fsSL https://raw.githubusercontent.com/vanillartwork/raylink/main/install.sh | sudo bash -s -- exit安装结束时会打印 Universal Subscription URL 和 Clash Subscription URL, 按你的客户端支持情况导入即可(客户端兼容性见客户端导入)。
之后管理节点:
sudo raylink exit # 重新运行 / 更新
sudo raylink exit --health-check # 立即运行一次自检若要为现有的出口节点添加中继转发功能,请在中继服务器上运行以下命令:
curl -fsSL https://raw.githubusercontent.com/vanillartwork/raylink/main/install.sh | sudo env UPSTREAM_SUBSCRIPTION_URL='http://EXIT_IP:8080/sub/TOKEN' bash -s -- relay请将示例中的
http://EXIT_IP:8080/sub/TOKEN替换为您出口服务器上实际生成的 Universal 订阅链接。
| 文档 | 内容 |
|---|---|
| getting-started.md | 从这里开始 — 服务器准备、SSH、客户端导入、下载配置 |
| exit.md | 出口节点 — 安装、选项、管理、自检 |
| relay.md | 中转节点 — 模型、upstream 参数、防火墙 |
| configuration.md | 所有环境变量 — 端口、Reality、DNS profile、IPv6、metrics、下载 |
| troubleshooting.md | 常见问题、IPv6-only 服务器、卸载 |
部分文档为英文。
raylink/
├── install.sh # 引导安装器:下载并安装 raylink CLI
├── src/ # raylink 调度器、commands/、lib/、defaults/、templates/
├── scripts/ # build-release.sh、check.sh
└── docs/
服务器端 CLI 安装在 /usr/local/lib/raylink/,软链到 /usr/local/bin/raylink。
请尽可能将 SSH 端口 22 的访问权限仅限制为您个人的 IP 地址。
在导入客户端配置后,请限制或直接禁用 8080 订阅端口。
切勿向他人泄露您的订阅链接、客户端配置或由 RayLink 生成的任何认证凭据, 因为任何获取这些信息的人均可直接连接至您的服务器。
代理服务会产生持续的网络流量,请密切关注云服务器流量使用情况, 并警惕任何异常流量激增。建议在云服务提供商处配置流量监控与超额预警, 避免因超出套餐额度或节点被滥用而产生高昂的意外账单。
本项目基于 MIT License 发布。
通过使用本软件,即表示您同意遵守所在司法管辖区内所有适用的法律法规。开发者不对本软件的任何滥用行为承担责任。更多信息请参阅 DISCLAIMER。