Guide

Xray VLESS Reality on a VPS

Last updated: 15 November 2026

Xray with VLESS and Reality is a common choice for a private proxy on your own server. This guide installs Xray, creates the keys and a minimal server configuration, and shows how to test it. Choose the server first: see choosing a VPS for Xray, V2Ray or AmneziaWG. If you are logged in as root, leave out sudo. Use it lawfully and follow our acceptable use policy.

Fast VPS from $7.99 a month

See Fast VPS plansHow ordering works

1. Install Xray

Use the official installer script from the XTLS project and read it before you run it (install curl first if missing: sudo apt install curl):

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

2. Make an identity and keys

xray uuid
xray x25519

The first command prints a UUID for your client. The second prints PrivateKey (for the server config) and the public key for the client. Current Xray versions label the public key Password (PublicKey); older ones print Public key. It is the same value. Ignore the Hash32 line. Keep the private key secret. Create a short id with openssl rand -hex 8.

3. Server configuration

Edit /usr/local/etc/xray/config.json:

{
  "log": { "loglevel": "warning" },
  "inbounds": [{
    "port": 443,
    "protocol": "vless",
    "settings": {
      "clients": [{ "id": "YOUR-UUID", "flow": "xtls-rprx-vision" }],
      "decryption": "none"
    },
    "streamSettings": {
      "network": "tcp",
      "security": "reality",
      "realitySettings": {
        "dest": "www.example.com:443",
        "serverNames": ["www.example.com"],
        "privateKey": "YOUR-PRIVATE-KEY",
        "shortIds": ["6bf8c1d4e5a7"]
      }
    }
  }],
  "outbounds": [{ "protocol": "freedom" }]
}

Replace YOUR-UUID, YOUR-PRIVATE-KEY and the short id with your values. For dest and serverNames choose a site that supports TLS 1.3 and HTTP/2 and does not redirect to another domain, and use in serverNames a name its certificate is valid for (the same name as in dest). Newer Xray versions also call dest target; both work. Check the file and restart the service (the installer has already started and enabled it):

sudo xray run -test -config /usr/local/etc/xray/config.json
sudo systemctl restart xray
sudo systemctl status xray

4. Open the port and test

  1. Allow TCP 443 in the firewall (and keep your SSH port open): see the firewall guide.
  2. In a client that supports VLESS Reality (for example v2rayN, v2rayNG, Hiddify or Streisand), add a server with: your IP, port 443, the UUID, flow xtls-rprx-vision, transport TCP (called RAW in newer clients), security Reality, fingerprint chrome, the public key, the same server name (SNI) and the short id.
  3. Connect and check your public address on a "what is my IP" page: it should show your server's IP.
  4. If it does not connect, read the log with sudo journalctl -u xray -e and compare every value on both sides.

Keep it healthy

Plans: Fast VPS from $7.99 a month; a small VPS is enough for a few users.

Questions and answers

Which command creates the Reality keys?
xray x25519 prints a private key for the server and a public key for the client (newer versions label it Password (PublicKey)); xray uuid creates a client id.

Which port should Xray listen on?
TCP 443 is the usual choice; open it in the firewall.

How do I check the config before starting?
Run xray run -test -config /usr/local/etc/xray/config.json.

Why does the client not connect?
Compare every value on both sides: UUID, public key, server name (SNI), short id, fingerprint and flow, and read journalctl -u xray -e.

Ready to try it? Fast VPS from $7.99 a month

See Fast VPS plansHow ordering works