3x-ui

command module
v3.9.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 1, 2026 License: GPL-3.0 Imports: 27 Imported by: 0

README

3X-UI

3X-UI

3X-UI — веб-панель управления Xray-core и sing-box с веб-интерфейсом для управления inbound'ами, клиентами, подписками, маршрутизацией, статистикой и настройками сервера.

Интерфейс по умолчанию использует русский язык; английский также доступен. UI построен на Ant Design и адаптирован для desktop и mobile.

[!IMPORTANT] Проект предназначен для личного использования и тестирования. Перед эксплуатацией на реальном сервере проверьте конфигурацию, сетевые правила, доступ к панели, TLS и остальные параметры безопасности.

Быстрый старт

Установка

Установочный скрипт находится в этом репозитории:

bash <(curl -Ls https://raw.githubusercontent.com/SawaMEN/3x-ui/main/install.sh)

По умолчанию устанавливается релиз из SawaMEN/3x-ui.

Для установки конкретной версии:

bash <(curl -Ls https://raw.githubusercontent.com/SawaMEN/3x-ui/main/install.sh) v3.9.3

Для rolling dev-сборки:

bash <(curl -Ls https://raw.githubusercontent.com/SawaMEN/3x-ui/main/install.sh) dev-latest

Установщик поддерживает Linux-архитектуры amd64 и arm64/aarch64.

После установки управление панелью доступно через:

x-ui

Основные команды:

x-ui              # меню управления
x-ui start        # запуск
x-ui stop         # остановка
x-ui restart      # перезапуск
x-ui status       # статус
x-ui settings     # текущие настройки
x-ui enable       # включить автозапуск
x-ui disable      # отключить автозапуск
x-ui log          # логи панели
x-ui banlog        # логи Fail2ban
x-ui update       # обновление
x-ui install      # установка
x-ui uninstall    # удаление

Результат установки сохраняется в защищённом файле:

/etc/x-ui/install-result.env
Обновление

Обновление панели:

x-ui update

Панель также предоставляет интерфейс для проверки системных обновлений и обновления управляемых компонентов Xray, sing-box и Telemt. Для системных обновлений поддерживается восстановление состояния панели после перезапуска во время применения обновлений.

Возможности

  • Управление Xray-core и sing-box, включая переключение активного ядра.
  • Создание и управление inbound'ами и клиентами.
  • Поддержка VMess, VLESS, Trojan, Shadowsocks, WireGuard, Hysteria, HTTP, Mixed, Tunnel, TUN, MTProto, AmneziaWG, TUIC, Naive, Mieru и vk-turn-proxy.
  • Локальное управление отдельным sidecar-сервисом Mieru; его конфигурация и процесс синхронизируются с активными inbound'ами.
  • MTProto через встроенный mtg и отдельный Telemt.
  • Лимиты трафика, срок действия, IP/HWID-лимиты и статистика.
  • Поддержка клиентских подписок, JSON/Clash-экспорта и внешних ссылок/удалённых подписок, привязанных к клиенту.
  • Управление исходящими подписками и их автоматическим обновлением.
  • Управление узлами, синхронизация конфигурации и просмотр системной статистики.
  • SQLite по умолчанию и PostgreSQL в качестве альтернативной БД.
  • Интеграции с Telegram, Discord и Fail2ban.
  • Темы: светлая, тёмная, ultra-dark, colorful и blue-gray.
  • Адаптивный интерфейс для desktop и mobile.
  • Русский интерфейс по умолчанию, английский — дополнительный язык.

Поддержка ядер

Xray-core

Xray запускается панелью как отдельный процесс. Панель управляет его конфигурацией, состоянием, статистикой, логами и inbound'ами.

Sing-box

Sing-box также запускается как отдельный процесс. Панель использует его native API для статистики соединений и управления активными подключениями.

Периодический сбор traffic statistics оптимизирован для больших наборов соединений:

  • состояние трафика отдельных соединений не хранится в памяти панели между опросами;
  • для traffic polling используется облегчённый protobuf-декодер;
  • в traffic polling не декодируются поля соединения, которые не нужны для статистики;
  • события закрытых соединений не удерживаются панелью после обработки.

При этом RSS процесса sing-box и RSS панели — разные величины. Сам sing-box может потреблять дополнительную память в зависимости от количества соединений, DNS-кэша, конфигурации маршрутизации и других факторов.

Язык интерфейса

Русский (ru-RU) — основной язык интерфейса.

Английский (en-US) — дополнительный язык.

Если язык браузера не поддерживается, интерфейс использует русский.

Благодарности

Этот репозиторий является форком основного проекта https://github.com/MHSanaei/3x-ui.

Отдельная благодарность авторам и участникам следующих проектов:

Лицензия

Проект распространяется по лицензии GPL-3.0.

Documentation

Overview

Package main is the entry point for the 3x-ui web panel application. It initializes the database, web server, and handles command-line operations for managing the panel.

Directories

Path Synopsis
internal
amneziawg
Package amneziawg holds the AmneziaWG protocol's shared, DB-backed shapes (Instance, Peer, Obfuscation31, ServerSettings/InboundSettings) and the pure functions that derive an Instance from a stored inbound row.
Package amneziawg holds the AmneziaWG protocol's shared, DB-backed shapes (Instance, Peer, Obfuscation31, ServerSettings/InboundSettings) and the pure functions that derive an Instance from a stored inbound row.
amneziawgnet
Package amneziawgnet embeds amneziawg-go and gVisor netstack in-process as a userspace alternative to kernel wireguard / awg-quick.
Package amneziawgnet embeds amneziawg-go and gVisor netstack in-process as a userspace alternative to kernel wireguard / awg-quick.
config
Package config provides configuration management utilities for the 3x-ui panel, including version information, logging levels, database paths, and environment variable handling.
Package config provides configuration management utilities for the 3x-ui panel, including version information, logging levels, database paths, and environment variable handling.
crypto/nodetoken
Package nodetoken encrypts replayable per-node bearer tokens at rest with row-bound AES-GCM and versioned key IDs.
Package nodetoken encrypts replayable per-node bearer tokens at rest with row-bound AES-GCM and versioned key IDs.
database/model
Package model defines the database models and data structures used by the 3x-ui panel.
Package model defines the database models and data structures used by the 3x-ui panel.
logger
Package logger provides logging functionality for the 3x-ui panel with dual-backend logging (console/syslog and file) and buffered log storage for web UI.
Package logger provides logging functionality for the 3x-ui panel with dual-backend logging (console/syslog and file) and buffered log storage for web UI.
mtproto
Package mtproto manages mtg-multi (github.com/mhsanaei/mtg-multi) sidecar processes that serve MTProto FakeTLS proxies.
Package mtproto manages mtg-multi (github.com/mhsanaei/mtg-multi) sidecar processes that serve MTProto FakeTLS proxies.
pia
Package pia is a standalone PIA WireGuard control-plane client.
Package pia is a standalone PIA WireGuard control-plane client.
sub
Package sub provides subscription server functionality for the 3x-ui panel, including HTTP/HTTPS servers for serving subscription links and JSON configurations.
Package sub provides subscription server functionality for the 3x-ui panel, including HTTP/HTTPS servers for serving subscription links and JSON configurations.
util/common
Package common provides common utility functions for error handling, formatting, and multi-error management.
Package common provides common utility functions for error handling, formatting, and multi-error management.
util/crypto
Package crypto provides cryptographic utilities for password hashing and verification.
Package crypto provides cryptographic utilities for password hashing and verification.
util/json_util
Package json_util provides JSON utilities including a custom RawMessage type.
Package json_util provides JSON utilities including a custom RawMessage type.
util/link
Package link provides parsers for VPN share links (vmess://, vless://, etc.) and subscription bodies (typically base64-encoded newline lists of such links).
Package link provides parsers for VPN share links (vmess://, vless://, etc.) and subscription bodies (typically base64-encoded newline lists of such links).
util/netproxy
Package netproxy builds HTTP clients that route the panel's own outbound requests through an admin-configured proxy, used to reach GitHub and Telegram from servers where those services are filtered.
Package netproxy builds HTTP clients that route the panel's own outbound requests through an admin-configured proxy, used to reach GitHub and Telegram from servers where those services are filtered.
util/random
Package random provides utilities for generating random strings and numbers.
Package random provides utilities for generating random strings and numbers.
util/reflect_util
Package reflect_util provides reflection utilities for working with struct fields and values.
Package reflect_util provides reflection utilities for working with struct fields and values.
util/sys
Package sys provides system utilities for monitoring network connections and CPU usage.
Package sys provides system utilities for monitoring network connections and CPU usage.
util/tokenaead
Package tokenaead is a gRPC transport that encrypts the connection with AES-256-GCM using a key derived from a shared bearer token, instead of X.509 certificates.
Package tokenaead is a gRPC transport that encrypts the connection with AES-256-GCM using a key derived from a shared bearer token, instead of X.509 certificates.
util/wirecodec
Package wirecodec holds the shared envelope codec for node-to-node config transport: zstd (de)compression, SHA-256 integrity hashing, and the header / capability constants both the panel (sender) and node (receiver) agree on.
Package wirecodec holds the shared envelope codec for node-to-node config transport: zstd (de)compression, SHA-256 integrity hashing, and the header / capability constants both the panel (sender) and node (receiver) agree on.
web
Package web provides the main web server implementation for the 3x-ui panel, including HTTP/HTTPS serving, routing, templates, and background job scheduling.
Package web provides the main web server implementation for the 3x-ui panel, including HTTP/HTTPS serving, routing, templates, and background job scheduling.
web/controller
Package controller provides HTTP request handlers and controllers for the 3x-ui web management panel.
Package controller provides HTTP request handlers and controllers for the 3x-ui web management panel.
web/global
Package global provides global variables and interfaces for accessing web and subscription servers.
Package global provides global variables and interfaces for accessing web and subscription servers.
web/job
Package job provides background job implementations for the 3x-ui web panel, including traffic monitoring, system checks, and periodic maintenance tasks.
Package job provides background job implementations for the 3x-ui web panel, including traffic monitoring, system checks, and periodic maintenance tasks.
web/locale
Package locale provides internationalization (i18n) support for the 3x-ui web panel, including translation loading, localization, and middleware for web and bot interfaces.
Package locale provides internationalization (i18n) support for the 3x-ui web panel, including translation loading, localization, and middleware for web and bot interfaces.
web/middleware
Package middleware provides HTTP middleware functions for the 3x-ui web panel, including domain validation utilities.
Package middleware provides HTTP middleware functions for the 3x-ui web panel, including domain validation utilities.
web/network
Package network provides network utilities for the 3x-ui web panel, including automatic HTTP to HTTPS redirection functionality.
Package network provides network utilities for the 3x-ui web panel, including automatic HTTP to HTTPS redirection functionality.
web/service
Package service implements the panel's business-logic layer.
Package service implements the panel's business-logic layer.
web/service/panel
Package service: WebSocketService owns the per-connection pump goroutines and bridges the HTTP-layer controller to the broadcast hub.
Package service: WebSocketService owns the per-connection pump goroutines and bridges the HTTP-layer controller to the broadcast hub.
web/websocket
Package websocket provides a WebSocket hub for real-time updates and notifications.
Package websocket provides a WebSocket hub for real-time updates and notifications.
xray
Package xray provides integration with the Xray proxy core.
Package xray provides integration with the Xray proxy core.
xray/dnsconf
Package dnsconf validates the JSON-subscription DNS setting against xray's own schema, so a block the client could not load never reaches an emitted document.
Package dnsconf validates the JSON-subscription DNS setting against xray's own schema, so a block the client could not load never reaches an emitted document.
xray/geodata
Package geodata reads Xray's geosite/geoip .dat databases so the panel can browse their categories instead of asking the user to type category names from memory.
Package geodata reads Xray's geosite/geoip .dat databases so the panel can browse their categories instead of asking the user to type category names from memory.
tools
openapigen command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL