下面是整理好的 可直接保存使用的 Markdown 文档(Debian 12 + Xray + VLESS + Reality + BBR 完整实战):
# Debian 12 + Xray + VLESS + Reality + Vision 实战部署
适用于:
- 1C512M VPS(搬瓦工 / RackNerd / Vultr 等)
- 无需域名 / 无需证书 / 无需 Nginx
- 追求低内存 + 高稳定性
---
# 1. 系统更新
```bash
apt update && apt upgrade -y
apt install -y curl wget unzip vim sudo cron net-tools lsof openssl
2. 开启 BBR(TCP 加速)
检查是否支持
sysctl net.ipv4.tcp_available_congestion_control
开启 BBR
cat >> /etc/sysctl.conf << EOF
net.core.default_qdisc=fq
net.ipv4.tcp_congestion_control=bbr
EOF
生效:
sysctl -p
验证:
sysctl net.ipv4.tcp_congestion_control
lsmod | grep bbr
3. 关闭 IPv6(可选)
cat > /etc/sysctl.d/99-ipv6.conf << EOF
net.ipv6.conf.all.disable_ipv6=1
net.ipv6.conf.default.disable_ipv6=1
EOF
sysctl --system
4. 安装 Xray-core
bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)"
验证:
xray version
5. 生成关键参数
1)UUID
xray uuid
2)Reality 密钥
xray x25519
输出:
Private key: xxxx
Public key: xxxx
3)ShortId
openssl rand -hex 8
6. 配置 Xray(Reality + VLESS)
vim /usr/local/etc/xray/config.json
配置内容
{
"log": {
"loglevel": "warning"
},
"inbounds": [
{
"port": 8443,
"protocol": "vless",
"settings": {
"clients": [
{
"id": "UUID替换这里",
"flow": "xtls-rprx-vision"
}
],
"decryption": "none"
},
"streamSettings": {
"network": "tcp",
"security": "reality",
"realitySettings": {
"show": false,
"dest": "www.microsoft.com:443",
"xver": 0,
"serverNames": [
"www.microsoft.com"
],
"privateKey": "PrivateKey替换这里",
"shortIds": [
"ShortId替换这里"
]
}
}
}
],
"outbounds": [
{
"protocol": "freedom"
}
]
}
7. 配置检查
xray run -test -config /usr/local/etc/xray/config.json
看到:
Configuration OK
表示正确。
8. 启动 Xray
systemctl enable xray
systemctl restart xray
systemctl status xray
9. 开放端口(UFW)
apt install ufw -y
ufw allow 22/tcp
ufw allow 8443/tcp
ufw enable
ufw status
10. 检查监听
ss -lntp | grep 8443
11. 客户端配置(核心参数)
VLESS + Reality
| 项目 | 值 |
|---|---|
| 地址 | VPS IP |
| 端口 | 8443 |
| UUID | 服务器生成 |
| 加密 | none |
| 传输 | tcp |
| Flow | xtls-rprx-vision |
| 安全 | reality |
| SNI | www.microsoft.com |
| Fingerprint | chrome |
| PublicKey | x25519 公钥 |
| ShortId | 生成值 |
12. 推荐客户端
Windows
- v2rayN
Android
- v2rayNG
iOS
- Shadowrocket
13. 日志查看
journalctl -u xray -f
journalctl -u xray -n 100
14. 常见问题
❌ 连接失败
检查:
systemctl status xray
❌ 端口不通
ss -lntp | grep 8443
❌ Cloudflare 问题
Reality 必须:
DNS Only(灰云)
不能:
Proxied(橙云)
❌ 推荐参数
- SNI:
www.microsoft.com - Fingerprint:
chrome - dest:
www.microsoft.com:443
15. 小内存优化建议
512MB VPS 推荐:
- 不装 Docker
- 不装宝塔
- 不跑数据库
- 不开 IPv6(可选)
- 只运行 Xray
内存占用:
- 系统:80~120MB
- Xray:10~30MB