[{"data":1,"prerenderedAt":585},["ShallowReactive",2],{"content:\u002Fposts\u002F3x-ui-install":3,"surround:\u002Fposts\u002F3x-ui-install":574},{"id":4,"title":5,"body":6,"categories":549,"date":551,"description":552,"draft":553,"extension":554,"image":555,"meta":556,"navigation":558,"path":559,"permalink":560,"pinned":553,"published":560,"readingTime":561,"recommend":560,"references":560,"seo":566,"sitemap":567,"stem":568,"tags":569,"type":572,"updated":551,"__hash__":573},"content\u002Fposts\u002Fposts\u002F3x-ui-install.md","「教程」部署 3X-UI 面板",{"type":7,"value":8,"toc":527},"minimark",[9,19,29,35,40,53,57,68,72,78,82,89,95,98,101,107,111,114,121,127,130,133,139,186,192,196,203,208,214,225,229,238,241,256,259,269,274,278,284,287,295,319,322,325,335,357,361,392,395,403,407,421,463,465,473,476,487,494,497,500,508,511,519,522],[10,11,15],"alert",{"title":12,"type":13,"icon":14},"AI 迁移提示","info","tabler:robot",[16,17,18],"p",{},"本文由 AI 协助从旧站迁移，尚未完成逐篇人工审校；内容如有疏漏，将在复核后修订。",[16,20,21,22],{},"这里使用的面板是：",[23,24,28],"a",{"href":25,"rel":26},"https:\u002F\u002Fgithub.com\u002Fmhsanaei\u002F3x-ui",[27],"nofollow","mhsanaei\u002F3x-ui",[10,30,32],{"title":31,"type":13},"3X-UI",[16,33,34],{},"作为原始 X-UI 项目的增强版本，3X-UI 提供了更好的稳定性、更广泛的协议支持和额外的功能。",[36,37,39],"h2",{"id":38},"一准备工作","一、准备工作",[41,42,43,47,50],"ol",{},[44,45,46],"li",{},"一台 Ubuntu 22.04 服务器",[44,48,49],{},"用 Xshell、Finalshell 等工具连上 SSH",[44,51,52],{},"全程用 root 权限，别用普通用户",[36,54,56],{"id":55},"二更新系统依赖","二、更新系统依赖",[58,59,65],"pre",{"className":60,"code":62,"language":63,"meta":64},[61],"language-bash","apt update && apt install curl socat -y\n","bash","",[66,67,62],"code",{"__ignoreMap":64},[36,69,71],{"id":70},"三安装-3x-ui","三、安装 3X-UI",[58,73,76],{"className":74,"code":75,"language":63,"meta":64},[61],"bash \u003C(curl -Ls https:\u002F\u002Fraw.githubusercontent.com\u002Fmhsanaei\u002F3x-ui\u002Fmaster\u002Finstall.sh)\n",[66,77,75],{"__ignoreMap":64},[79,80,81],"h3",{"id":81},"选择安装的数据库",[16,83,84,85,88],{},"（通常选择",[66,86,87],{"code":87},"SQLite","）",[58,90,93],{"className":91,"code":92,"language":63,"meta":64},[61],"═══════════════════════════════════════════\n     Database Selection\n═══════════════════════════════════════════\n  1) SQLite     (default — recommended for \u003C 500 clients)\n  2) PostgreSQL (recommended for high client counts \u002F many nodes)\nChoose [1]: 1  # 选择 1) SQLite \n",[66,94,92],{"__ignoreMap":64},[79,96,97],{"id":97},"自定义面板端口",[16,99,100],{},"（这里可以输入N，让面板随机生成）",[58,102,105],{"className":103,"code":104,"language":63,"meta":64},[61],"Would you like to customize the Panel Port settings? (If not, a random port will be applied) [y\u002Fn]: n # 输入n 随机生成端口\nGenerated random port: 47176\nPort set successfully: 47176\nUsername and password updated successfully\nBase URI path set successfully\n\n",[66,106,104],{"__ignoreMap":64},[79,108,110],{"id":109},"配置ssl证书","配置SSL证书",[16,112,113],{},"这里如果有域名选择1（提供90天有效期的SSL证书，自动更新），没有域名选择2（提供6天有效期的SSL证书，自动更新）",[10,115,118],{"title":116,"type":117},"注意","warning",[16,119,120],{},"如果你有域名，请将域名解析至你的vps的ip 以便自动申请SSL证书",[58,122,125],{"className":123,"code":124,"language":63,"meta":64},[61],"═══════════════════════════════════════════\n     SSL Certificate Setup (RECOMMENDED)\n═══════════════════════════════════════════\nSSL is strongly recommended. Skip only if a reverse proxy\nor SSH tunnel handles TLS for you.\nLet's Encrypt now supports both domains and IP addresses!\n\nChoose SSL certificate setup method:\n1. Let's Encrypt for Domain (90-day validity, auto-renews)\n2. Let's Encrypt for IP Address (6-day validity, auto-renews)\n3. Custom SSL Certificate (Path to existing files)\n4. Skip SSL (advanced — behind reverse proxy \u002F SSH tunnel only)\nNote: Options 1 & 2 require port 80 open. Option 3 requires manual paths.\nNote: Option 4 serves the panel over plain HTTP — only safe behind nginx\u002FCaddy or an SSH tunnel.\nChoose an option (default 2 for IP): 1  # 选择使用域名证书\nUsing Let's Encrypt for domain certificate...\n......\n[Sat May 30 03:57:52 AM UTC 2026] Install success!\nacme.sh installed successfully\nPlease enter your domain name: 3x.xxxxx.xx # 在这里输入你的域名\nYour domain is: 3x.xxxxx.xx, checking it...\nYour domain is ready for issuing certificates now...\nPlease choose which port to use (default is 80): # 直接回车\nYour input  is invalid, will use default port 80.\nWill use port: 80 to issue certificates. Please make sure this port is open.\nStopping panel temporarily...\n......\nIssuing certificate succeeded, installing certificates...\nDefault --reloadcmd for ACME is: systemctl restart x-ui || rc-service x-ui restart\nThis command will run on every certificate issue and renew.\nWould you like to modify --reloadcmd for ACME? (y\u002Fn): y # 输入y进行重载证书\n\n        1. Preset: systemctl reload nginx ; systemctl restart x-ui\n        2. Input your own command\n        3. Keep default reloadcmd\nChoose an option: 1 # 重启nginx和面板服务\nReloadcmd is: systemctl reload nginx ; systemctl restart x-ui\n......\nAuto renew succeeded, certificate details:\ntotal 20K\ndrwxr-xr-x 2 root root 4.0K May 30 03:58 .\ndrwxr-xr-x 3 root root 4.0K May 30 03:58 ..\n-rw-r--r-- 1 root root 4.7K May 30 03:58 fullchain.pem\n-rw------- 1 root root  227 May 30 03:58 privkey.pem\nWould you like to set this certificate for the panel? (y\u002Fn): y #将面板设置为此证书\nset certificate public key success\nset certificate private key success\nset certificate for subscription public key success\nset certificate for subscription private key success\nCertificate paths set for the panel\n\nAccess URL: https:\u002F\u002F3x.xxxxx.xx:0000\u002Fxxxxxxxxx\u002F\nPanel will restart to apply SSL certificate...\n✓ SSL certificate configured successfully with domain: 3x.xxxxx.xx\n\n═══════════════════════════════════════════\n     Panel Installation Complete!\n═══════════════════════════════════════════\nUsername:    xxxxxxxxxxxxxx\nPassword:    xxxxxxxxxxxxxxxx\nPort:        0000\nWebBasePath: xxxxxxxxx\nDatabase:    SQLite (\u002Fetc\u002Fx-ui\u002Fx-ui.db)\nAccess URL:  https:\u002F\u002F3x.xxxxx.xx:0000\u002Fxxxxxxxxx\u002F\nAPI Token:   xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n═══════════════════════════════════════════\n⚠ IMPORTANT: Save these credentials securely!\n⚠ SSL Certificate: Enabled and configured\nStart migrating database...\nMigration done!\nService files not found in tar.gz, downloading from GitHub...\nSetting up systemd unit...\nCreated symlink \u002Fetc\u002Fsystemd\u002Fsystem\u002Fmulti-user.target.wants\u002Fx-ui.service → \u002Fetc\u002Fsystemd\u002Fsystem\u002Fx-ui.service.\nx-ui v3.2.0 installation finished, it is running now...\n\n┌───────────────────────────────────────────────────────┐\n│  x-ui control menu usages (subcommands):              │\n│                                                       │\n│  x-ui              - Admin Management Script          │\n│  x-ui start        - Start                            │\n│  x-ui stop         - Stop                             │\n│  x-ui restart      - Restart                          │\n│  x-ui status       - Current Status                   │\n│  x-ui settings     - Current Settings                 │\n│  x-ui enable       - Enable Autostart on OS Startup   │\n│  x-ui disable      - Disable Autostart on OS Startup  │\n│  x-ui log          - Check logs                       │\n│  x-ui banlog       - Check Fail2ban ban logs          │\n│  x-ui update       - Update                           │\n│  x-ui legacy       - Legacy version                   │\n│  x-ui install      - Install                          │\n│  x-ui uninstall    - Uninstall                        │\n└───────────────────────────────────────────────────────┘\n",[66,126,124],{"__ignoreMap":64},[79,128,129],{"id":129},"安装完成",[16,131,132],{},"安装完成后，将最后的内容复制下来，以便后续访问",[58,134,137],{"className":135,"code":136,"language":63,"meta":64},[61],"═══════════════════════════════════════════\n     Panel Installation Complete!\n═══════════════════════════════════════════\nUsername:    xxxxxxxxxxxxxx\nPassword:    xxxxxxxxxxxxxxxx\nPort:        0000\nWebBasePath: xxxxxxxxx\nDatabase:    SQLite (\u002Fetc\u002Fx-ui\u002Fx-ui.db)\nAccess URL:  https:\u002F\u002F3x.xxxxx.xx:0000\u002Fxxxxxxxxx\u002F\nAPI Token:   xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n═══════════════════════════════════════════\n",[66,138,136],{"__ignoreMap":64},[10,140,142],{"title":141},"信息",[16,143,144,148,149,152,155,156,158,161,162,164,167,168,170,173,174,176,179,180,182,185],{},[145,146,147],"strong",{},"Username","：面板登录的用户名",[150,151],"br",{},[145,153,154],{},"Password","：面板登录的密码",[150,157],{},[145,159,160],{},"Port","：面板登录的端口",[150,163],{},[145,165,166],{},"WebBasePath","：面板的URL路径",[150,169],{},[145,171,172],{},"Database","：面板的数据存储位置",[150,175],{},[145,177,178],{},"Access URL","：最终的访问地址",[150,181],{},[145,183,184],{},"API Token","：新版本的Api接口Token，安装时自动创建，可在后台删除",[10,187,189],{"title":188,"type":117},"关于SSL证书",[16,190,191],{},"如果你的面板没有配置SSL证书，切勿直接在浏览器中访问，需要使用SSH隧道访问，否则后期容易出现安全漏洞等问题",[79,193,195],{"id":194},"开启-bbr-加速","开启 BBR 加速",[10,197,200],{"title":198,"type":199},"什么是BBR?","question",[16,201,202],{},"BBR 是 Google 设计的 TCP 拥塞控制算法，能根据网络带宽和延迟动态调整传输速度，提升网络吞吐量并降低延迟。",[16,204,205],{},[145,206,207],{},"一键开启BBR加速",[58,209,212],{"className":210,"code":211,"language":63,"meta":64},[61],"echo \"net.core.default_qdisc=fq\" >> \u002Fetc\u002Fsysctl.conf echo \"net.ipv4.tcp_congestion_control=bbr\" >> \u002Fetc\u002Fsysctl.conf sysctl -p\n",[66,213,211],{"__ignoreMap":64},[16,215,216,217,220,221,224],{},"执行完用",[66,218,219],{"code":219},"lsmod | grep bbr","检查，出现 ",[66,222,223],{"code":223},"bbr"," 就成功。",[36,226,228],{"id":227},"四配置面板","四、配置面板",[16,230,231,232,234,235,237],{},"新版的面板多出来几个选项 客户端、节点",[150,233],{},"\n客户端：将以前的入站列表配置的客户端单独伶出来了，另外客户端的群组也可以单独配置",[150,236],{},"\n节点：顾名思义就是可以联合多台vps进行配置了，同时也可以实现订阅。",[79,239,240],{"id":240},"修改基本配置",[16,242,243,244,246,247,250,252,253],{},"安装完成后，URL路径都是默认值，很容易被扫描出来，所以我们要进行修改",[150,245],{},"\n面板设置-->订阅设置-->常规-->",[145,248,249],{},"URL路径",[150,251],{},"\n面板设置-->订阅设置（Formats）-->常规-->",[145,254,255],{},"Clash URI 路径",[16,257,258],{},"其他的安全设置可自行参考 面板设置-->安全设定",[260,261,263],"pic",{"src":262},"https:\u002F\u002Fimg.olinl.com\u002Fblog_img\u002F2026\u002F06\u002F20260611123827936-0902b9.png",[264,265,266],"template",{"v-slot:caption":64},[16,267,268],{},"安全设置",[10,270,271],{"title":116,"type":117},[16,272,273],{},"所有的配置修改完成后需要保存并重启面板才能生效。",[79,275,277],{"id":276},"添加节点可选","添加节点（可选）",[16,279,280,281,283],{},"如果你只有一台VPS且不愿意折腾，可以跳过",[150,282],{},"\n默认入站配置的是本机配置，所以该配置可选。",[16,285,286],{},"点击左侧菜单的节点，点击页面的添加节点按钮",[260,288,290],{"src":289},"https:\u002F\u002Fimg.olinl.com\u002Fblog_img\u002F2026\u002F06\u002F20260611123923573-5c615a.png",[264,291,292],{"v-slot:caption":64},[16,293,294],{},"添加节点",[16,296,297,298,300,303,304,306,307,310,311,313,314,316,318],{},"地址就填写上面配置SSL的域名或者IP地址",[150,299],{},[66,301,302],{"code":302},"Base Path","需要填写安装完成时的",[66,305,166],{"code":166},"或者到 ",[66,308,309],{"code":309},"面板设置-->常规--> URL路径"," 里面进行查看",[150,312],{},"\n允许私有地址：如果VPC处于同一局域网，或者有组网工具，可启用此选项",[150,315],{},[66,317,184],{"code":184},"：远程面板在 设置 → API 令牌 中显示其 API 令牌",[16,320,321],{},"填写完成后，点击测试连接，测试通过后，即可。",[79,323,324],{"id":324},"添加入站",[16,326,327,328,331,332,88],{},"这里只介绍2种协议（",[66,329,330],{"code":330},"vless+websocket+tls","、",[66,333,334],{"code":334},"vless+xhttp+reality",[10,336,338],{"title":337,"type":199},"科普",[41,339,340,347],{},[44,341,342,343,346],{},"VLESS + WebSocket + TLS\n",[145,344,345],{},"必须拥有并解析域名","，通过 WebSocket 将流量伪装成正常的 HTTPS 网站浏览，由 TLS 证书提供强制加密与身份验证。",[44,348,349,350,353,354],{},"VLESS + xHTTP + Reality\n",[145,351,352],{},"无需域名","，通过协议直接借用目标网站的 TLS 证书与指纹特征进行模拟，在免去域名配置的同时实现极高的隐蔽性与抗封锁能力。\n",[145,355,356],{},"如果想要了解更多，请自行AI",[16,358,359],{},[145,360,330],{},[16,362,363,364,367,368,371,372,375,376,379,380,383,384,387,388,391],{},"点击添加入站，",[145,365,366],{},"基础配置","，协议选择",[66,369,370],{"code":370},"vless","。",[145,373,374],{},"传输","，传输选择",[66,377,378],{"code":378},"WebSocket","，路径自定一个不易猜到的，以\u002F开头。",[145,381,382],{},"安全","，选择",[66,385,386],{"code":386},"TLS","，数字证书1点击",[66,389,390],{"code":390},"从面板设置证书","。随后点击保存更改即可。其他配置保持默认即可。",[16,393,394],{},"整体配置如下：",[260,396,398],{"src":397},"https:\u002F\u002Fimg.olinl.com\u002Fblog_img\u002F2026\u002F06\u002F20260611124119349-45eff8.png",[264,399,400],{"v-slot:caption":64},[16,401,402],{},"vless-websocket-tls 添加入站信息",[16,404,405],{},[145,406,334],{},[16,408,363,409,367,411,371,413,375,415,379,418,420],{},[145,410,366],{},[66,412,370],{"code":370},[145,414,374],{},[66,416,417],{"code":417},"XHTTP",[145,419,382],{},"，选择Reality，目标和SNI随机一个合适的，然后下面点击获取新证书。随后点击保存更改即可。其他配置保持默认即可。",[10,422,424,430],{"title":423,"type":199},"寻找目标域名的条件：",[16,425,426,429],{},[145,427,428],{},"基础条件","：",[431,432,433,436,439,442,445,451,454,457,460],"ul",{},[44,434,435],{},"不要使用跳转域名（使用跳转完成的域名）",[44,437,438],{},"目标网站必须支持 TLS1.3",[44,440,441],{},"目标网站必须支持 X25519",[44,443,444],{},"目标网站必须支持HTTP\u002F2 (H2)",[44,446,447,448,429],{},"目标域名必须和 SNI 匹配\n",[145,449,450],{},"加分项",[44,452,453],{},"尽量别用带 CDN 的网站当目标站",[44,455,456],{},"尽量不要使用热门网站",[44,458,459],{},"尽量选择 TLS 握手延迟小的网站",[44,461,462],{},"IP 相近 （使用 RealiTLScanner 扫描即可）",[16,464,394],{},[260,466,468],{"src":467},"https:\u002F\u002Fimg.olinl.com\u002Fblog_img\u002F2026\u002F06\u002F20260611124242011-b97c1d.png",[264,469,470],{"v-slot:caption":64},[16,471,472],{},"less-xhttp-reality 添加入站信息",[79,474,475],{"id":475},"添加客户端",[16,477,478,479,482,483,486],{},"点击菜单的客户端，点击添加客户端，填写完",[145,480,481],{},"邮箱","，",[145,484,485],{},"关联入站"," 点击创建即可。",[260,488,490],{"src":489},"https:\u002F\u002Fimg.olinl.com\u002Fblog_img\u002F2026\u002F06\u002F20260611124255583-a122ac.png",[264,491,492],{"v-slot:caption":64},[16,493,475],{},[79,495,496],{"id":496},"连接节点",[16,498,499],{},"点击客户端前面操作栏的二维码，可以扫码导入订阅信息或者分入站导入。",[260,501,503],{"src":502},"https:\u002F\u002Fimg.olinl.com\u002Fblog_img\u002F2026\u002F06\u002F20260611124303601-b4fce9.png",[264,504,505],{"v-slot:caption":64},[16,506,507],{},"连接节点信息",[16,509,510],{},"点击详情按钮可查看详情，和导入链接，订阅链接，可导入相应软件进行订阅",[260,512,514],{"src":513},"https:\u002F\u002Fimg.olinl.com\u002Fblog_img\u002F2026\u002F06\u002F20260611124311178-a3689a.png",[264,515,516],{"v-slot:caption":64},[16,517,518],{},"连接节点-详情",[36,520,521],{"id":521},"鸣谢",[523,524],"link-card",{"link":525,"title":526},"https:\u002F\u002Fv2rayssr.com\u002Freality-2.html","你真的会配置Reality？科学上网翻车频发，其实节点搭建这些坑90%的人都踩过！Reality部署全流程拆解！",{"title":64,"searchDepth":528,"depth":528,"links":529},4,[530,532,533,541,548],{"id":38,"depth":531,"text":39},2,{"id":55,"depth":531,"text":56},{"id":70,"depth":531,"text":71,"children":534},[535,537,538,539,540],{"id":81,"depth":536,"text":81},3,{"id":97,"depth":536,"text":97},{"id":109,"depth":536,"text":110},{"id":129,"depth":536,"text":129},{"id":194,"depth":536,"text":195},{"id":227,"depth":531,"text":228,"children":542},[543,544,545,546,547],{"id":240,"depth":536,"text":240},{"id":276,"depth":536,"text":277},{"id":324,"depth":536,"text":324},{"id":475,"depth":536,"text":475},{"id":496,"depth":536,"text":496},{"id":521,"depth":531,"text":521},[550],"技术","2026-05-30 18:00:00","记录一下搭建3x-ui面板的过程",false,"md","https:\u002F\u002Fimg.olinl.com\u002Fblog_img\u002F2026\u002F06\u002F20260611124401850-bed1f7.png",{"slots":557},{},true,"\u002Fposts\u002F3x-ui-install",null,{"text":562,"minutes":563,"time":564,"words":565},"11 min read",10.285,617100,2057,{"title":5,"description":552},{"loc":559},"posts\u002Fposts\u002F3x-ui-install",[570,571],"代理","linux","tech","b8Cm5377-7guUPr_FWMC6_fcbgpt2NQKnsb2HRvllkI",[575,580],{"title":576,"path":577,"stem":578,"date":579,"type":572,"children":-1},"Nginx 使用 sub_filter 注入自定义 HTML 标签","\u002Fposts\u002Fnginx-subfilter-html","posts\u002Fposts\u002Fnginx-subfilter-html","2026-04-11 00:00:00",{"title":581,"path":582,"stem":583,"date":584,"type":572,"children":-1},"使用CloudFlare优选任何网站！","\u002Fposts\u002Fcf-fastip","posts\u002Fposts\u002Fcf-fastip","2026-06-13 19:54:38",1788712222891]