-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Installation
- Install the necessary tools to run the script:
curl
(if needed) - Open shell and enter this command
$ bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.sh)
- Go through the panel setup
- Once configured, go to
http://<your-ip>:<your-port>
and log in with the credentials that were issued by the panel after installation
-
Before installing Docker, install the following tools using your package manager:
curl
,nano
(if necessary) -
Install Docker using the official script
$ bash <(curl -sSL https://get.docker.com)
- Create a
panel
folder and go to this folder
$ mkdir panel
$ cd panel
- Create and edit the
compose.yml
file usingnano
or another editor. Insert the following contents into the file:
compose.yml
services:
panel:
image: ghcr.io/mhsanaei/3x-ui:latest
container_name: 3xui_app
volumes:
- ~/panel/db/:/etc/x-ui/
- ~/panel/cert/:/root/cert/
environment:
XRAY_VMESS_AEAD_FORCED: "false"
XUI_ENABLE_FAIL2BAN: "true"
tty: true
network_mode: host
restart: unless-stopped
- Start the Docker container using the following command.
$ docker compose up -d
- Open url
http://<your-ip>:2053
and log in to the panel. The credentials are as follows:
- 👤 Username:
admin
- 🔑 Password:
admin
Caution
After logging in, immediately change the administrator credentials in the panel settings (Panel Settings > Authentication
)
Tip
It is also recommended to set up two-factor authentication and set up another panel web path for complete security
If an update is needed, disable the container and push the new version of the image with the following commands
$ docker compose down
$ docker compose pull
$ docker compose up -d
If you want to delete a container, execute the following commands
$ docker compose down
$ docker system prune -a
$ rm panel -rf
- Execute the following command
$ docker run -itd \
-e XRAY_VMESS_AEAD_FORCED=false \
-e XUI_ENABLE_FAIL2BAN=true \
-v $PWD/db/:/etc/x-ui/ \
-v $PWD/cert/:/root/cert/ \
--network=host \
--restart=unless-stopped \
--name 3x-ui \
ghcr.io/mhsanaei/3x-ui:latest
If an update is needed, disable the container and push the new version of the image with the following commands
$ docker ps -a
With this command, we find out the ID of the container on which the panel is running. Next, we stop our container and pull down the image:
$ docker container stop <container_id>
$ docker image pull ghcr.io/mhsanaei/3x-ui
After that, we execute the command from step 3.
If you want to delete a container, execute the following commands
$ docker container stop <container_id>
$ docker system prune -a
$ rm 3x-ui -rf
Caution
This method is not recommended. Always use the latest version.
-
Install the necessary tools to run the script:
curl
(if needed) -
Open shell and enter this command
$ VERSION=v2.5.5 && bash <(curl -Ls "https://raw.githubusercontent.com/mhsanaei/3x-ui/$VERSION/install.sh") $VERSION
The required version is specified in the VERSION
variable, e.g. v2.5.5
.
- Go through the panel setup
To download the latest version of the compressed package directly to your server, run the following command:
ARCH=$(uname -m)
case "${ARCH}" in
x86_64 | x64 | amd64) XUI_ARCH="amd64" ;;
i*86 | x86) XUI_ARCH="386" ;;
armv8* | armv8 | arm64 | aarch64) XUI_ARCH="arm64" ;;
armv7* | armv7) XUI_ARCH="armv7" ;;
armv6* | armv6) XUI_ARCH="armv6" ;;
armv5* | armv5) XUI_ARCH="armv5" ;;
s390x) echo 's390x' ;;
*) XUI_ARCH="amd64" ;;
esac
wget https://github.com/MHSanaei/3x-ui/releases/latest/download/x-ui-linux-${XUI_ARCH}.tar.gz
Once the compressed package is downloaded, execute the following commands to install or upgrade x-ui
ARCH=$(uname -m)
case "${ARCH}" in
x86_64 | x64 | amd64) XUI_ARCH="amd64" ;;
i*86 | x86) XUI_ARCH="386" ;;
armv8* | armv8 | arm64 | aarch64) XUI_ARCH="arm64" ;;
armv7* | armv7) XUI_ARCH="armv7" ;;
armv6* | armv6) XUI_ARCH="armv6" ;;
armv5* | armv5) XUI_ARCH="armv5" ;;
s390x) echo 's390x' ;;
*) XUI_ARCH="amd64" ;;
esac
cd /root/
rm -rf x-ui/ /usr/local/x-ui/ /usr/bin/x-ui
tar zxvf x-ui-linux-${XUI_ARCH}.tar.gz
chmod +x x-ui/x-ui x-ui/bin/xray-linux-* x-ui/x-ui.sh
cp x-ui/x-ui.sh /usr/bin/x-ui
cp -f x-ui/x-ui.service /etc/systemd/system/
mv x-ui/ /usr/local/
systemctl daemon-reload
systemctl enable x-ui
systemctl restart x-ui