Skip to content
Proyek

Tentang

x-ui in docker version

Sistem dan infrastruktur

Cara angka ini diukur

Pertumbuhan bintang terukur

dalam 24 jam
0
dalam 7 hari
0
dalam 15 hari
0
dalam 1 bulan
Mengumpulkan riwayat

Perubahan bersih pada periode yang tumpang tindih, bukan total harian. Pengukuran yang belum tersedia dibiarkan kosong. Bintang menunjukkan perhatian, bukan kualitas.

README.md

Asli

x-ui docker image

Docker Pulls Contributors Forks Stargazers Issues MIT License

English | 中文文档

Minimal Docker image for MHSanaei/3x-ui.

Tag Upstream Status
3x-ui, latest, v3.6.0 MHSanaei/3x-ui Built
alpha, alpha-zh FranzKafkaYu/x-ui Deprecated, no longer built
beta X-UI-Unofficial Deprecated, no longer built
old latest (vaxilu) vaxilu/x-ui Deprecated; latest now tracks 3x-ui

Supported architectures: amd64, arm64, arm/v7, s390x.

This image is smaller than the official ghcr.io/mhsanaei/3x-ui image. It omits fail2ban, x-ui.sh, and extra IR/RU geo files. acme.sh is bundled; persist /root/.acme.sh and /root/cert so renewals survive recreation.

How the image is built, which BuildKit syntax we use, and what we left out: docs/image-build.md (中文).

How to use it

Install 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

The panel listens on 2053 by default. First-run credentials are admin / admin; change them after login.

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

Issue a certificate inside the container

network_mode: host is required so standalone HTTP-01 can bind port 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 is a symlink created on first start at /root/.acme.sh/acme.sh. If the command is not on PATH, use that path.

How to enable SSL with nginx on the host

Assumptions:

  • Panel port is 2053
  • Domain xui.example.com already has an A record
  • Debian 12+ or Ubuntu 22+
  • Email [email protected]
  1. Install nginx and certbot
sudo apt update
sudo apt install nginx python3-certbot-nginx
  1. Create /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. Check, issue a cert, and reload
sudo nginx -t
sudo certbot --nginx --agree-tos --no-eff-email --email [email protected]
sudo nginx -s reload
sudo certbot renew --dry-run

More details: certbot

Sponsor

Powered by DartNode

Jelajahi proyek terkait

Memuat…