enwaiax/x-ui

By enwaiax

Updated about 14 hours ago

Image
Networking
194

100K+

enwaiax/x-ui repository overview

x-ui docker image

Docker Pulls Contributors Forks Stargazers Issues MIT License

English | 中文文档

MHSanaei/3x-ui 的精简 Docker 镜像。

Tag上游状态
3x-uilatestv3.6.0MHSanaei/3x-ui持续构建
alphaalpha-zhFranzKafkaYu/x-ui已废弃,不再构建
betaX-UI-Unofficial已废弃,不再构建
latest(vaxilu)vaxilu/x-ui已废弃;现在的 latest 指向 3x-ui

支持架构:amd64arm64arm/v7s390x

镜像比官方 ghcr.io/mhsanaei/3x-ui 更小:不含 fail2ban、x-ui.sh 和额外的伊朗/俄罗斯 geo 数据。已内置 acme.sh,请把 /root/.acme.sh/root/cert 做成卷,续期才能在重建容器后还在。

构建怎么瘦、用了哪些 BuildKit 语法、故意没打进去的东西,见 image-build.zh.md

如何使用

安装 Docker:

curl -sSL https://get.docker.com/ | sh
docker run
mkdir x-ui && cd x-ui
docker run -itd --network=host \
    -e XRAY_VMESS_AEAD_FORCED=false \
    -v $PWD/db/:/etc/x-ui/ \
    -v $PWD/cert/:/root/cert/ \
    -v $PWD/acme/:/root/.acme.sh/ \
    --name x-ui --restart=unless-stopped \
    enwaiax/x-ui:3x-ui

面板默认端口是 2053。首次启动账号密码是 admin / admin,登录后请立刻改掉。

docker exec x-ui x-ui setting -show true
docker compose
mkdir x-ui && cd x-ui
wget https://raw.githubusercontent.com/enwaiax/x-ui/main/docker-compose.yml
docker compose up -d
在容器内申请证书

需要 network_mode: host,standalone HTTP-01 才能占用 80 端口。

docker exec -it x-ui acme.sh --issue -d xui.example.com --standalone --httpport 80
docker exec -it x-ui acme.sh --installcert -d xui.example.com \
    --fullchain-file /root/cert/xui.example.com/fullchain.pem \
    --key-file /root/cert/xui.example.com/privkey.pem \
    --reloadcmd "x-ui restart"
docker exec x-ui x-ui cert \
    -webCert /root/cert/xui.example.com/fullchain.pem \
    -webCertKey /root/cert/xui.example.com/privkey.pem

首次启动后 acme.sh/root/.acme.sh/acme.sh。不在 PATH 里就用这个路径。

用宿主机 nginx 反代 SSL

假设:

  • 面板端口是 2053
  • 域名 xui.example.com 已做好 A 记录
  • Debian 12+ 或 Ubuntu 22+
  • 邮箱是 [email protected]
  1. 安装 nginx 和 certbot
sudo apt update
sudo apt install nginx python3-certbot-nginx
  1. 新建 /etc/nginx/conf.d/xui.conf
server {
    listen 80;
    listen [::]:80;
    server_name xui.example.com;

    location / {
        proxy_redirect off;
        proxy_pass http://127.0.0.1:2053;
        proxy_http_version 1.1;
        proxy_set_header Host $host;
    }

    location /xray {
        proxy_redirect off;
        proxy_pass http://127.0.0.1:10001;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $http_host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Y-Real-IP $realip_remote_addr;
    }
}
  1. 检查配置、申请证书并重载
sudo nginx -t
sudo certbot --nginx --agree-tos --no-eff-email --email [email protected]
sudo nginx -s reload
sudo certbot renew --dry-run

更多细节见 certbot

Tag summary

Content type

Image

Digest

sha256:81172e4df

Size

61.6 MB

Last updated

about 14 hours ago

docker pull enwaiax/x-ui