自建部署 中级

Xboard 机场面板搭建:高性能 V2board 系面板部署指南

介绍 Xboard 机场面板的架构、特性与部署流程,涵盖 Docker 部署、节点对接、套餐配置、支付与订阅设置。了解面板侧的运作方式,有助于理解机场是如何管理节点和用户的。

9 分钟 更新于 2026-05-14 内容可独立复现

一、Xboard 简介

  • GitHub: https://github.com/cedar2025/Xboard
  • 基于 V2board 二次开发的高性能机场面板
  • 支持协议: VLESS/VMess/Trojan/Shadowsocks/Hysteria2
  • 技术栈: PHP (Laravel) + MySQL + Redis
  • 节点后端: Xray-core / Sing-box

架构:

用户浏览器 → Xboard 面板 (前端+API) → MySQL + Redis
                    ↓ 下发配置
              节点服务器 (Xray-core)
                    ↓ 用户连接
              用户客户端 (V2rayN/Clash 等)

二、面板部署

2.1 环境准备

# 系统: Ubuntu 22.04+ / Debian 12+
apt update && apt upgrade -y
apt install -y curl wget git unzip

# 安装 Docker + Docker Compose
curl -fsSL https://get.docker.com | bash

2.2 Docker Compose 部署(推荐)

git clone https://github.com/cedar2025/Xboard.git
cd Xboard

cp .env.example .env

编辑 .env

APP_URL=https://你的面板域名
DB_HOST=mysql
DB_DATABASE=xboard
DB_USERNAME=xboard
DB_PASSWORD=生成一个强密码

REDIS_HOST=redis
docker compose up -d
docker compose exec xboard php artisan xboard:install

# 按提示设置管理员邮箱和密码

2.3 Nginx 反代 + SSL

server {
    listen 443 ssl http2;
    server_name panel.yourdomain.com;

    ssl_certificate /etc/letsencrypt/live/panel.yourdomain.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/panel.yourdomain.com/privkey.pem;

    location / {
        proxy_pass http://127.0.0.1:7001;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

三、节点对接

3.1 节点后端选择

后端支持协议说明
Xray-core + XrayRVLESS/VMess/Trojan/SS最成熟,兼容性好
Sing-boxVLESS/VMess/Trojan/SS/Hysteria2/TUIC新一代,性能更好

3.2 XrayR 对接 Xboard

节点服务器上安装 XrayR:

bash <(curl -Ls https://raw.githubusercontent.com/XrayR-project/XrayR-release/master/install.sh)

配置 /etc/XrayR/config.yml

Log:
  Level: warning
  AccessPath: ""
  ErrorPath: ""

Nodes:
  - PanelType: "Xboard"
    ApiConfig:
      ApiHost: "https://panel.yourdomain.com"
      ApiKey: "面板后台生成的通信密钥"
      NodeID: 1
      NodeType: V2ray   # V2ray / Trojan / Shadowsocks
    ControllerConfig:
      ListenIP: 0.0.0.0
      SendIP: 0.0.0.0
      EnableDNS: false
      CertConfig:
        CertMode: none  # Reality 模式不需要证书
XrayR restart

3.3 面板中添加节点

  1. 登录面板后台 → 节点管理 → 添加节点
  2. 选择协议(VLESS/Trojan/SS)
  3. 填写节点 IP、端口
  4. VLESS + Reality 的配置示例:
协议: VLESS
传输: TCP
安全: Reality
目标站: www.microsoft.com:443
服务器名: www.microsoft.com
私钥: <x25519 私钥>
公钥: <对应公钥>
短ID: <随机生成>
  1. 保存后,XrayR 会自动拉取配置并运行

3.4 多节点部署示意

                 ┌─────────────────┐
                 │   Xboard 面板    │
                 │  panel.xxx.com  │
                 └───────┬─────────┘
           ┌─────────────┼─────────────┐
           ▼             ▼             ▼
    ┌──────────┐  ┌──────────┐  ┌──────────┐
    │ 香港节点  │  │ 日本节点  │  │ 美国节点  │
    │  XrayR   │  │  XrayR   │  │  XrayR   │
    │ Xray-core│  │ Xray-core│  │ Xray-core│
    └──────────┘  └──────────┘  └──────────┘

每个节点独立运行 XrayR,通过 API 与面板通信,定时:

  • 拉取用户列表和流量配额
  • 上报用户流量统计
  • 上报节点在线状态

四、订阅管理

4.1 订阅链接格式

Xboard 自动生成订阅链接,用户导入客户端即可:

https://panel.yourdomain.com/api/v1/client/subscribe?token=用户token

支持的客户端格式:

  • Clash/Mihomo: clash 格式 YAML
  • V2rayN/V2rayNG: v2ray 格式 Base64
  • Shadowrocket: shadowrocket 格式
  • Sing-box: sing-box 格式 JSON
  • Surge: surge 格式

4.2 客户端自动更新订阅

客户端定期(通常每小时)请求订阅链接,面板动态返回:

  • 可用节点列表
  • 每个节点的连接参数
  • 分流规则

五、运营功能

5.1 用户管理

  • 套餐管理(流量/时长/设备数限制)
  • 邀请码系统
  • 流量统计和用量告警
  • 到期自动停用

5.2 支付对接

Xboard 支持多种支付方式:

  • 支付宝当面付
  • 微信支付
  • USDT/加密货币
  • Stripe (海外信用卡)
  • 易支付

5.3 节点健康检查

面板定时检测节点状态:

  • XrayR 心跳上报
  • 用户在线数统计
  • 流量异常告警
  • 节点自动切换(负载均衡)

六、推荐部署架构

小型(个人/小团队,< 50 人)

单 VPS: 面板 + 1个节点 (VLESS+Reality)
成本: ~$5/月

中型(100-500 人)

面板 VPS: Xboard + MySQL + Redis
节点 VPS × 3-5: 香港/日本/美国/新加坡
中转: 可选,国内云服务器端口转发
成本: ~$30-80/月

大型(500+ 人)

面板: 独立服务器或高配 VPS
数据库: 独立 MySQL 主从
节点: 10+ 个地区覆盖
中转: IPLC/IEPL 专线
CDN: Cloudflare 兜底
监控: Grafana + Prometheus
成本: $200+/月
#自建#Xboard#面板#部署

本文仅作技术原理科普,帮助读者理解代理协议与机场架构。请遵守所在地区法律法规,合理合规使用网络。