Back

How to Install VLESS + XTLS-Reality on a VPS

Articles

29/07/2026

VLESS + XTLS-REALITY INSTALLATION GUIDE 2026

How to Install VLESS + XTLS-Reality on a VPS

A practical, command-by-command guide to installing Xray-core, generating secure credentials, configuring VLESS with XTLS Vision and REALITY, opening the firewall, connecting a client, and troubleshooting common VPS deployment errors.

What This Guide Builds

This tutorial installs a self-hosted VLESS endpoint on a Linux VPS using Xray-core. VLESS provides lightweight client authentication, XTLS Vision controls the optimized data flow, and REALITY supplies the transport-security layer that makes the connection resemble an ordinary TLS session.

The final server listens on TCP port 443 and accepts only clients that present the correct UUID, REALITY client key, server name, and short ID. You do not need to purchase a domain or issue a TLS certificate for this basic REALITY configuration.

Responsible-use note: Deploy this technology only where lawful and permitted. It should not be used to access systems without authorization, violate platform rules, conceal abuse, or evade legal obligations.

Quick Installation Summary

  1. Order a KVM VPS with a public IPv4 address and root or sudo access.
  2. Update Debian or Ubuntu and install the required command-line tools.
  3. Install Xray-core with the official XTLS installation script.
  4. Generate a UUID, an X25519 key pair, and a hexadecimal short ID.
  5. Select and test a stable HTTPS target for the REALITY handshake.
  6. Create the VLESS + XTLS Vision + REALITY server configuration.
  7. Validate the JSON, restart Xray, open port 443, and verify the service.
  8. Enter the matching values ​​in a REALITY-compatible client.

How the Connection Is Structured

The client connects to the VPS on port 443. REALITY handles the TLS-like handshake, VLESS authenticates the user, and XTLS Vision manages the flow. Xray then sends permitted traffic through the server’s normal outbound network connection.

Compatible client

VPS public IP on TCP port 443

REALITY transport-security handshake

VLESS authentication + XTLS Vision flow

Xray direct outbound connection
Terminology update: Current Xray documentation calls the former TCP transport method RAW . Some client applications still display the older label “TCP.” In a standard VLESS REALITY setup, these labels commonly refer to the same direct stream transport.

Requirements Before Installation

KVM VPS

Use a full virtual machine with administrative access, a public IP address, and control over the firewall.

Supported Linux

This walkthrough uses a current Debian or Ubuntu release with the systemd service manager.

SSH Access

You need the VPS IP, SSH username, and either a password or, preferably, an SSH key.

Free Port 443

No web server, control panel, or another proxy may already be listening on TCP port 443.

Recommended VPS Size

VLESS and REALITY do not require a large server for a small private deployment. Location, CPU consistency, network quality, and available bandwidth are generally more important than storage capacity.

Deployment Suggested Starting Point Main Consideration
Personal endpoint 1 vCPU, 1-2 GB RAM, 10+ GB NVMe Choose a low-latency location.
Small authorized team 2 vCPUs, 2-4 GB RAM, NVMe Prioritize stable CPU and network throughput.
Higher concurrency 2-4 vCPUs, 4-8 GB RAM, NVMe Monitor CPU, connections, and traffic usage.

STEP 1

Connect to the VPS and Update Linux

Connect from a terminal with SSH. Replace the sample IP address with the public address supplied by the VPS provider.

ssh root@203.0.113.10

Update the package index, apply available updates, and install the tools used in the remaining steps.

apt update && apt upgrade -y
apt install -y curl openssl ca-certificates ufw
Before continuing: Confirm that the system clock is correct with timedatectl status. Enable network time synchronization with timedatectl set-ntp truewhen necessary.

STEP 2

Install Xray-Core

The official XTLS installation project provides a script for systemd-based Linux distributions. Review third-party installation scripts before running them and use the official repository rather than an unknown mirror.

bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install

After installation, verify that the binary is available and display the installed version.

/usr/local/bin/xray version
systemctl status xray --no-pager
Typical paths: The installer normally places the executable at /usr/local/bin/xrayand the main configuration directory at /usr/local/etc/xray/.

STEP 3

Generate the UUID, X25519 Keys, and Short ID

The server and client must share a matching UUID. REALITY also uses an X25519 key pair: the private value remains on the server, while the corresponding client-side value is entered in the client application.

Generate a random VLESS UUID

/usr/local/bin/xray uuid

Generate the REALITY X25519 key pair

/usr/local/bin/xray x25519

Generate a 16-character hexadecimal short ID

openssl rand -hex 8
Generated Value Where It Is Used Keep Secret?
UUID Server user entry and every authorized client Treat as a credential
Private key ServerrealitySettings.privateKey Yes; never distribute it
Client key Client field often labeled Public Key, Password, or PBK Share only with authorized clients
Short ID Server shortIdsand matching client field Treat as configuration data
Version note: Newer Xray documentation may call the client-side X25519 value password, while many client interfaces and older guides call it the public key or pbk. Use the client-side value printed by xray x25519; never place the server private key in a client.

STEP 4

Choose and Test a REALITY Target

REALITY uses the TLS appearance and handshake characteristics of a real HTTPS target. Choose a stable domain that supports TLS on port 443, is reachable from the VPS, and accepts the server name you will configure.

Test the candidate directly from the VPS. Replace the example domain with your selected target.

/usr/local/bin/xray tls ping www.microsoft.com:443
  • Use the hostname, not an http://or https://URL.
  • Keep the server target, server serverNames, and client SNI consistent.
  • Avoid random domains that are unreliable, blocked, or incompatible with the VPS route.
  • Review current Project X guidance before using CDN-backed or unusual targets.
Security consideration: Unauthenticated REALITY traffic may be forwarded toward the configured target. Target selection and fallback behavior should therefore be reviewed carefully, especially on a public server exposed to scanning.

STEP 5

Create the Xray Server Configuration

Back up the existing configuration before replacing it. This makes recovery easier if a JSON error or incompatible value prevents the service from starting.

cp /usr/local/etc/xray/config.json /usr/local/etc/xray/config.json.backup 2>/dev/null || true
nano /usr/local/etc/xray/config.json

Paste the following configuration, then replace every uppercase placeholder with the values ​​generated in the previous steps.

{
  "log": {
    "loglevel": "warning"
  },
  "inbounds": [
    {
      "tag": "vless-reality-in",
      "listen": "0.0.0.0",
      "port": 443,
      "protocol": "vless",
      "settings": {
        "users": [
          {
            "id": "YOUR-UUID-HERE",
            "flow": "xtls-rprx-vision",
            "email": "primary-user"
          }
        ],
        "decryption": "none"
      },
      "streamSettings": {
        "method": "raw",
        "security": "reality",
        "realitySettings": {
          "show": false,
          "target": "www.microsoft.com:443",
          "xver": 0,
          "serverNames": [
            "www.microsoft.com"
          ],
          "privateKey": "YOUR-SERVER-PRIVATE-KEY",
          "shortIds": [
            "YOUR-SHORT-ID"
          ]
        }
      }
    }
  ],
  "outbounds": [
    {
      "tag": "direct",
      "protocol": "freedom"
    },
    {
      "tag": "blocked",
      "protocol": "blackhole"
    }
  ]
}
Compatibility note: Older examples may use clientsinstead of users, network: "tcp"instead of method: "raw", and destinstead of target. The configuration above follows the current Project X documentation terminology. Confirm the syntax supported by the Xray version actually installed on your VPS.

Important Configuration Fields Explained

Field Purpose Must Match the Client?
port Public listening port, normally 443 Yes
ID VLESS user credential or UUID Yes
flow Enables the XTLS Vision flow mode Yes
target HTTPS destination whose TLS appearance is used by REALITY Client uses the matching server name, not the full target string
serverNames Allowed SNI values ​​for authorized clients Yes
privateKey Server-only X25519 private value No; the client uses its corresponding client-side value
shortIds Additional REALITY client identifier Yes

STEP 6

Validate the Configuration and Restart Xray

Test the configuration before restarting the production service. This catches missing commas, quotation errors, invalid keys, and unsupported fields.

/usr/local/bin/xray run -test -c /usr/local/etc/xray/config.json

When the test completes without an error, restart Xray and configure it to start automatically after reboot.

systemctl restart xray
systemctl enable xray
systemctl status xray --no-pager

Confirm that a process is listening on TCP port 443.

ss -lntp | grep ':443'

STEP 7

Configure the VPS Firewall

Allow the active SSH service before enabling the firewall. If your VPS uses a custom SSH port, allow that exact port instead of relying only on the OpenSSH application profile.

ufw allow OpenSSH
ufw allow 443/tcp
ufw --force enable
ufw status verbose
Do not lock yourself out: Keep the existing SSH session open while testing a second SSH connection. Only disable password authentication after key-based access has been tested successfully.

STEP 8

Configure a Compatible Client

Use an up-to-date client that explicitly supports VLESS, XTLS Vision, and REALITY. The exact screen and field names vary by operating system and application.

Client Field Value
Address / Server The VPS public IP address
Port 443
Protocol VLESS
UUID / ID The generated UUID
Flow xtls-rprx-vision
Transport RAW, or TCP in clients using the older label
Security REALITY
SNI / Server Name One hostname listed in the server’sserverNames
Fingerprint A supported uTLS fingerprint, commonlychrome
Public Key / Password / PBK The client-side X25519 value generated by Xray
Short ID The generated hexadecimal short ID
SpiderX Leave empty or use /when required by the client
Most common connection mistake: The UUID, SNI, client X25519 value, short ID, port, security mode, and flow must all correspond to the server configuration. One incorrect character can cause the handshake to fail.

How to Verify the Installation

A successful systemd status alone does not prove that the client can connect. Verify the server locally and then test from an external network.

Service Status

Confirm that X-ray is active.

systemctl is-active xray

Listening Port

Confirm that port 443 is open locally.

ss -lntp | grep ':443'

Recent Logs

Read startup and connection errors.

journalctl -u xray -n 80 --no-pager

External Test

Connect from mobile data or another external network.

Test browsing and confirm the exit IP

Common Problems and Solutions

Problem Likely Cause What to Check
X-ray will not start Invalid JSON or unsupported configuration field Run the Xray configuration test and inspect systemd logs.
Port 443 is already in use Nginx, Apache, Caddy, a panel, or another proxy is listening Run ss -lntp | grep ':443'and stop or reconfigure the conflicting service.
Client times out Firewall, provider security group, wrong IP, or blocked port Verify UFW, the provider firewall, routing, and the public IP address.
Handshake fails immediately Mismatched key, SNI, short ID, UUID, flow, or security mode Compare every client value character by character with the server settings.
Works on one network only Network filtering, DNS behavior, routing, or client-version differences Test another target, another network, current clients, and the VPS route.
Slow connection Distant location, congested route, CPU contention, or provider limits Measure latency and throughput, then compare another VPS location.

VPS Hardening Checklist

A working proxy service does not automatically make the server secure. Protect the operating system and administrative access separately.

  • Install security updates regularly and subscribe to provider maintenance notices.
  • Use SSH keys and disable password login only after key access is confirmed.
  • Create a non-root sudo account for routine administration where practical.
  • Allow only the ports actually required by the deployment.
  • Keep the Xray private key and user credentials out of public repositories and screenshots.
  • Create separate UUIDs or user entries when access must be revoked independently.
  • Review systemd logs and unusual network activity.
  • Keep an off-server copy of the configuration, without exposing credentials publicly.
  • Document how to rotate the UUID, X25519 key pair, and short ID after compromise.
Credential rotation: If the server configuration is leaked, generate a new UUID, X25519 pair, and short ID, update every authorized client, test the replacement settings, and remove the compromised values.

Updating, Backing Up, or Removing Xray

Back up the configuration

install -m 600 /usr/local/etc/xray/config.json /root/xray-config-backup.json

Update Xray with the official installer

bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install

Review available installer options before removal

bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ help

Re-test the configuration after a major update because field names, aliases, validation rules, and client compatibility can change over time.

KVM VPS Infrastructure

Using Retzor for a VLESS REALITY VPS

Retzor offers KVM-based virtual servers with administrative operating-system access and NVMe storage. These are the core infrastructure characteristics needed to install Xray-core and control the firewall, service configuration, and listening ports.

Select a data-center location close to the intended users and test latency, route quality, public-IP accessibility, and port availability before moving an important configuration to production.

KVM

Independent virtual environment and operating-system control.

Root

Administrative access for Xray, systemd, SSH, and firewall configuration.

NVMe

Responsive storage for the operating system, packages, and logs.

Locations

Choose infrastructure based on latency and routing requirements.

Frequently Asked Questions

Does VLESS REALITY require a domain name?

No domain owned by the VPS operator is required for the basic setup. REALITY uses a configured external HTTPS target and matching server name. The client connects to the VPS public IP.

Do I need to install an SSL certificate?

Not for this basic REALITY configuration. The setup does not present a conventional certificate issued for a domain owned by the operator.

Why does my client call RAW transport TCP?

Project X renamed the former TCP transport to RAW because the older name was ambiguous. Client interfaces may retain the older TCP label for compatibility or familiarity.

Can I install Nginx on the same port?

Two services cannot normally bind directly to the same IP and port. Advanced sharing designs require a carefully planned front end, fallback, or routing architecture and are outside this basic installation.

Can I add multiple users?

Yes. Add separate objects to the VLESS usersarray with unique IDs and labels. Separate credentials make revocation and auditing easier.

Is a VPS IP considered residential or mobile?

No. A VPS public address generally belongs to a hosting or datacenter network. REALITY changes the transport appearance; it does not change the ownership or classification of the server IP.

Final Thoughts

Installing VLESS with XTLS-Reality on a VPS involves four core tasks: installing Xray-core, generating the required credentials, building a valid REALITY server configuration, and entering identical values ​​in a compatible client.

Most deployment failures are caused by a small mismatch rather than a complex server problem. Test the JSON before restarting Xray, verify that port 443 is free and reachable, and compare the UUID, flow, SNI, client key, and short ID carefully.

For the underlying infrastructure, a clean KVM VPS with root access, a public IP, stable networking, and a location close to the intended users is generally sufficient. Retzor virtual servers can be evaluated for this type of self-managed Linux deployment.

Technical sources and editorial note: The commands and field descriptions in this guide were checked against the official XTLS Xray installation repository and the official Project X documentation for REALITY , RAW transport , and VLESS inbound configuration . Xray versions, configuration names, aliases, operating-system packages, installer behavior, client fields, and provider services may change. Recheck the official documentation before a production deployment.
Retzor Reviews