Files
XTLS_Xray-docs-next/docs/en/document/install.md
T
2026-05-09 20:52:37 +08:00

8.0 KiB

Download and Install

Platform Support

Xray is available on the following platforms:

  • Windows 7 and later (x86 / amd64 / arm32 / arm64);
    • To use regular versions 1.8.4, 1.8.6, and win7 versions after 1.8.18 on Windows 7, the system must have the KB4474419 update installed; it is recommended to also install KB4490628 to receive subsequent operating system security updates after connecting to the internet.
    • Starting from v25, running the win7 version on Windows 7 only requires SP1 to function normally, but installing subsequent OS security updates is still strongly recommended for networked systems.
  • macOS 10.10 Yosemite and later (amd64 / arm64);
  • Linux 2.6.23 and later (x86 / amd64 / arm / arm64 / mips64 / mips / ppc64 / s390x / riscv64);
    • Including but not limited to Debian 7 / 8, Ubuntu 12.04 / 14.04 and later, CentOS 7 / 8, Arch Linux, etc.;
  • FreeBSD (x86 / amd64);
  • OpenBSD (x86 / amd64);

Download Xray

Pre-compiled binary ZIP archives can be found in Github Releases.

Download the archive for your platform, extract it, and it is ready to use.

Verify Installation Packages

Xray provides two verification methods:

  • SHA1 / SHA256 digests of the ZIP archive.
  • Reproducible Builds: Please refer to Compiling Xray.

Windows Installation

macOS Installation

Linux Installation

Installation Scripts

Arch Linux

Arch User Repository

Requires AUR helpers. Taking yay as an example, you can install via yay -S xray.

Arch Linux CN

First add the Arch Linux CN repository, then install using pacman -S xray under the root user.

Linuxbrew

The usage of the Linuxbrew package manager is consistent with Homebrew: brew install xray

Debian

Gentoo

Currently, three third-party Overlays provide Portage installation scripts:

  • CHN-beta/touchfish-os: Personally maintained, suitable for systemD systems.
  • Gentoo-zh: Community maintained, suitable for systemD systems.
  • JuanCldCmt/Xray-Overlay: Personally maintained, suitable for openRC systems; runs with the xray user group to improve security.

Use layman or eselect-repository to add the Overlay locally, then install.

Docker Installation

Currently, two different styles of Docker images are provided:

  • teddysun/xray: Has root privileges, has shell environment, compatible with all Alpine-supported architectures. Compiled and built by private server dl.lamp.sh. More convenient to use.
  • ghcr.io/xtls/xray-core: No root privileges, no shell environment, supports more architectures. Compiled and built by the official repository supporting traceability. Sacrifices convenience for more extreme security.

Docker Image File Structure

teddysun/xray version image:

  • /usr/bin/xray: Xray main program
  • /etc/xray/config.json: Single configuration file (its directory is a mount point)
  • /usr/share/xray/: Resource file directory, stores v2fly version geolocation data files
    • geoip.dat
    • geosite.dat

ghcr.io/xtls/xray-core version image:

  • /usr/local/bin/xray: Xray main program (Owner is root:root, file permissions 755)
  • /usr/local/etc/xray/: Configuration file directory (Mount point) (Owner is root:root, directory permissions 755, file permissions 644)
    • 00_log.json
    • 01_api.json
    • 02_dns.json
    • 03_routing.json
    • 04_policy.json
    • 05_inbounds.json
    • 06_outbounds.json
    • 07_stats.json
    • 08_fakedns.json
    • 09_metrics.json
    • 10_observatory.json
    • 11_geodata.json
    • 99_version.json
  • /usr/local/share/xray/: Resource file directory, stores Loyalsoldier version geolocation data files (Permissions same as above)
    • geoip.dat
    • geosite.dat
  • /var/log/xray/: Log file directory (Mount point) (Directory owner is root:root, permissions 755; File owner is 65532:65532, permissions 600)
    • access.log
    • error.log

Graphical Clients

UUID Generator

Third-party UUID generator: uuidgenerator.net