Giter Club home page Giter Club logo

x-ui's Introduction

x-ui docker image

Docker Pulls Contributors Forks Stargazers Issues MIT License

English | 中文文档

x-ui in docker version

You could selecet your perfer one by changing the docker image tag

Tag amd64 arm64 armv7 s390x
vaxilu/x-ui latest
FranzKafkaYu/x-ui alpha
X-UI-Unofficial/x-ui beta

Why Should You Use Docker

  • Consistent & Isolated Environment
  • Rapid Application Deployment
  • Ensures Scalability & Flexibility
  • Better Portability
  • Cost-Effective
  • In-Built Version Control System
  • Security
  • .....

For this project, if you use docker

  • You don't need to concern yourself with operating systems, architectures and other issues.
  • You will never ruin your Linux server. If you don't want to use it, you can stop or remove it from your environment exactly.
  • Last but not least, you can easily deploy and upgrade

Hot to use it

Pre-condition, Docker is installed

Use the official one-key script

curl -sSL https://get.docker.com/ | sh

Start you container

You could use the pre-build docker image enwaiax/xuiplus
mkdir x-ui && cd x-ui
docker run -itd --network=host \
    -v $PWD/db/:/etc/x-ui/ \
    -v $PWD/cert/:/root/cert/ \
    --name x-ui --restart=unless-stopped \
    enwaiax/x-ui

Note: If you want to use FranzKafkaYu/x-ui, change the image as enwaiax/x-ui:alpha

Or you could use docker compose to start it
mkdir x-ui && cd x-ui
wget https://raw.githubusercontent.com//chasing66/x-ui/main/docker-compose.yml
docker compose up -d

How to enable ssl to your x-ui panel

This part describe how to enable ssl.

  • Suppose your x-ui port is 54321
  • Suppose your IP is 10.10.10.10
  • Suppose your domain is xui.example.com and you have set the A recode in cloudflare
  • Suppose you are using Debian 10+ or Ubuntu 18+ system
  • Suppose your email is [email protected]
Steps as below
  1. Install nginx and python3-certbot-nginx
sudo apt update
sudo apt install python3-certbot-nginx
  1. Add new nging configurtion
touch /etc/nginx/conf.d/xui.conf

Add below to the file. Adjust appropriately to your own situation.

server {
    listen 80;
    listen [::]:80;
    server_name xui.example.com;

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

    # This part desribe how to reverse websockt proxy
     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 yout conf is OK
nginx -t
  1. Get cert
certbot --nginx --agree-tos --no-eff-email --email [email protected]

For more details, refer to cerbot

  1. Reload nginx config
ngins -s reload
  1. Test automatic renewal
sudo certbot renew --dry-run

x-ui's People

Contributors

enwaiax avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.