3x-ui3x-ui

Installation

Install 3x-ui via the official script (stable, pinned, or dev-latest), unattended/cloud-init, or Docker — and choose SQLite or PostgreSQL.

3x-ui runs on a wide range of Linux distributions — Ubuntu, Debian, Armbian, Fedora, CentOS, RHEL, AlmaLinux, Rocky Linux, Oracle Linux, Amazon Linux, Virtuozzo, Arch, Manjaro, openSUSE (Tumbleweed/Leap), Alpine — and Windows, across amd64, 386, arm64, armv7, armv6, armv5, and s390x.

Run the script installer as root (or with sudo). It installs a service, sets up the x-ui management command, and enables the panel on boot.

The official script is the recommended path. During installation it generates a random username, password, and access (web base) path, sets up the service, and installs the x-ui management command.

latest stable
bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.sh)

Install a specific version by appending its tag:

pinned version
bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.sh) v3.4.0

Install the rolling dev build (the latest per-commit pre-release from main — not a stable release) by passing dev-latest:

rolling dev build
bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.sh) dev-latest

When it finishes, note the printed login details and run x-ui to open the management menu, then continue to First login.

Build your install command

Tailor the command to your setup:

Install command builder

Build the exact install command for your setup. It is assembled in your browser.

blank = latest stable · a tag like v3.4.0 · or dev-latest for the rolling dev build
Run on your server
bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.sh)

Choose a database

You pick the storage backend at install time:

  • SQLite (default) — a single file at /etc/x-ui/x-ui.db. Zero setup.
  • PostgreSQL — for high client counts or multi-node setups. The installer can install it locally or use a DSN you provide.

See Database for details and SQLite→PostgreSQL migration.

Unattended / cloud-init

The installer also runs non-interactively for automation. Set XUI_NONINTERACTIVE=1 (or run with no TTY) and it installs end-to-end with zero prompts, generating random credentials and writing them to /etc/x-ui/install-result.env:

XUI_NONINTERACTIVE=1 bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.sh)

The repo's deploy/ directory has ready-made cloud-init user-data for unattended installs on any cloud (Hetzner, AWS, DigitalOcean, Vultr, GCP, Azure, Oracle).

Next steps

On this page