Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

3x-ui

БесплатноБез исполняемых скриптовНе проверен

Deploys and operates 3x-ui, a web control panel for Xray-core proxy servers, and scripts it through its REST API: create inbounds, add clients with traffic…

TerminalSkillsот TerminalSkills★ 221 звезда на GitHub

Об этом скилле

3x-ui — web panel and API for Xray-core servers

Overview

3x-ui is a Go web panel that wraps Xray-core. It manages inbounds (VLESS, VMess, Trojan, Shadowsocks, WireGuard, Hysteria2, TUIC and more), per-client traffic quotas, expiry dates and IP limits, share links and QR codes, a subscription server, traffic statistics, and optional Telegram or Discord bots. Data lives in SQLite (/etc/x-ui/x-ui.db) or PostgreSQL.

This skill covers installing the panel, hardening it, and automating it through the HTTP API. It does not cover writing raw Xray JSON configs or choosing Reality or transport settings in depth; the xray skill does that. The project README states the panel is meant for personal use and warns against illegal use or production-grade claims, so use it only on servers you own and in places where running a proxy is lawful.

The commands below were checked against the v3.11.0 source and docs. The API calls were run against the Docker image ghcr.io/mhsanaei/3x-ui:v3.11.0; install.sh was read but not executed.

Instructions

Install with the official script (download, read, then run)

Pin the release tag and never pipe the script into a shell:

curl -fsSLo install.sh https://raw.githubusercontent.com/MHSanaei/3x-ui/v3.11.0/install.sh
less install.sh                      # read it first; it runs as root
sudo bash install.sh v3.11.0

The installer generates a random username, password, port and web base path, installs the x-ui service, and prints them. Release archives have a .sha256 file that the installer checks. For cloud-init, run it unattended; credentials, access URL and an API token go to a root-only file:

sudo XUI_NONINTERACTIVE=1 bash install.sh v3.11.0
sudo cat /etc/x-ui/install-result.env       # XUI_USERNAME, XUI_PASSWORD, XUI_PANEL_PORT, XUI_WEB_BASE_PATH, XUI_ACCESS_URL, XUI_API_TOKEN

Install with Docker

The image is published at ghcr.io/mhsanaei/3x-ui with version tags such as v3.11.0. The repo's docker-compose.yml builds from source; to use the image directly, bind the panel to loopback and add the capabilities that the bundled Fail2ban needs for IP limits:

mkdir -p ~/xui/db ~/xui/cert && cd ~/xui
docker run -d --name 3xui --restart unless-stopped \
  --cap-add=NET_ADMIN --cap-add=NET_RAW \
  -p 127.0.0.1:2053:2053 \
  -v "$PWD/db:/etc/x-ui" -v "$PWD/cert:/root/cert" \
  ghcr.io/mhsanaei/3x-ui:v3.11.0
docker logs 3xui 2>&1 | grep -i "username"       # first start prints generated credentials once

Publish each inbound port you create (for example -p 443:443) and the subscription port 2096 if you use it. Without NET_ADMIN and NET_RAW, IP-limit bans are logged but never applied. Set XUI_PORT, XUI_INIT_WEB_BASE_PATH or XUI_DB_TYPE / XUI_DB_DSN (PostgreSQL) through -e; the complete list is in the docs under Reference, Environment Variables.

First login and hardening (do this before creating inbounds)

Panel URL: http://HOST:PORT/BASEPATH. Read current values with x-ui settings. Then:

  • Change username and password (menu x-ui, option 7, or Panel Settings). This logs out all sessions.
  • Randomize the web base path (menu option 8) and change the port (option 10).
  • Turn on TOTP two-factor in Panel Settings.
  • Keep the panel off the public internet: reach it through an SSH tunnel, or put it behind Nginx or Caddy with TLS.
ssh -N -L 12053:127.0.0.1:2053 admin@vpn-edge-1      # then open http://127.0.0.1:12053/

The panel's login limiter blocks an IP after 5 failed attempts in 5 minutes. Menu options 20 (SSL certificates), 22 (IP limit management) and 23 (firewall) exist in the x-ui menu.

Service control

sudo systemctl status x-ui
sudo x-ui log                  # panel log
sudo x-ui restart-xray         # restart only the Xray core
sudo x-ui update               # update to latest stable (read the release notes first)

API authentication

All automation endpoints live under /panel/api/ (prefix them with the web base path if it is not /). Two modes:

  1. Bearer token (best for scripts): create it in Panel Settings, Security, API Token, or take XUI_API_TOKEN from install-result.env. A token has a scope (admin, monitor read-only, node-sync, node-admin), may expire, and is shown only once. Bearer requests skip CSRF.
  2. Session cookie: GET /csrf-token, then POST /login with JSON and the X-CSRF-Token header. A login without the CSRF header returns 403.
export XUI_URL="http://127.0.0.1:12053"
export XUI_API_TOKEN="..."        # from Panel Settings or install-result.env
curl -s -H "Authorization: Bearer $XUI_API_TOKEN" "$XUI_URL/panel/api/server/status"

Responses are JSON: {"success": true, "msg": "...", "obj": ...}. Check success, not just the HTTP status.

Inbounds

H="Authorization: Bearer $XUI_API_TOKEN"; J="Content-Type: application/json"
curl -s -H "$H" "$XUI_URL/panel/api/inbounds/list"                       # lis
Полный SKILL.md на GitHub

Установить 3x-ui в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

_scores.json

FAQ

Что делает скилл 3x-ui?

Deploys and operates 3x-ui, a web control panel for Xray-core proxy servers, and scripts it through its REST API: create inbounds, add clients with traffic quotas, expiry and IP limits, read usage, and restart Xray. Use when asked to "install 3x-ui", "run an Xray panel in Docker", "add a proxy user with a 50 GB limit", "automate 3x-ui with its API", "reset 3x-ui credentials", or "back up the panel". For hand-written Xray config files use the xray skill instead.

Как установить скилл 3x-ui?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл 3x-ui запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить 3x-ui с