VLESS Reality on your own server

VLESS Reality disguises the connection as the TLS of a real website, so from the outside it is hard to tell from ordinary HTTPS. You can put it on any Linux VPS — by hand in the terminal, or from an app over SSH in a few minutes.

Updated

On this page

What you need

  • A VPS with Linux: Ubuntu, Debian, Fedora, CentOS, Rocky, AlmaLinux or Arch Linux.
  • SSH access: the server address, the root login and a password.
  • A free port 443 over TCP. If it is taken, another one will do, say 8443.
  • The address of a real website: the connection will look like a visit to it.

How to install it by hand

Below is the setup on Ubuntu or Debian as root. The server program is Xray from the XTLS project: it has both VLESS and Reality.

  1. 1

    Install Xray

    The official script installs Xray and the xray service. Command:

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

    If there is no curl, first run:

    On the server
    apt update &&
      apt install -y curl
  2. 2

    Create a UUID

    Command: xray uuid. This is the device ID. It is best to give each device its own.

  3. 3

    Create the Reality keys

    Command: xray x25519. The PrivateKey line is the private key; it stays on the server. The Password (PublicKey) line is the public key; it goes into the link. Older Xray versions print Private key and Public key.

  4. 4

    Make a short ID

    Command: openssl rand -hex 8. You get 16 characters from 0–9 and a–f.

  5. 5

    Pick the website to look like

    You need a real website with TLS 1.3 that opens from the server. You don't need a domain of your own. Check: xray tls ping site-address. The answer should say TLS 1.3.

  6. 6

    Write the settings

    File: /usr/local/etc/xray/config.json. A sample is in the next section. To check the file without starting:

    On the server
    xray run -test -config /usr/local/etc/xray/config.json
  7. 7

    Open the port

    If ufw is on on the server: ufw allow 443/tcp. If the host has a firewall in its dashboard, open 443 over TCP there too.

  8. 8

    Restart the service

    Command: systemctl restart xray. To start it after a reboot: systemctl enable xray. Check: systemctl status xray should say active (running). Errors show in journalctl -u xray.

  9. 9

    Build the link

    The address, port, UUID, public key, website and short ID come together in one vless:// link. How to build it is below.

The settings file

This is a minimal config.json for VLESS Reality on port 443. Replace the words in capitals: UUID from xray uuid, PRIVATE_KEY — the PrivateKey line from xray x25519, SHORT_ID from openssl, SITE — the address of the website to look like.

config.json
{
  "inbounds": [
    {
      "port": 443,
      "protocol": "vless",
      "settings": {
        "clients": [
          {"id": "UUID", "flow": "xtls-rprx-vision"}
        ],
        "decryption": "none"
      },
      "streamSettings": {
        "network": "tcp",
        "security": "reality",
        "realitySettings": {
          "dest": "SITE:443",
          "serverNames": ["SITE"],
          "privateKey": "PRIVATE_KEY",
          "shortIds": ["SHORT_ID"]
        }
      }
    }
  ],
  "outbounds": [
    {"protocol": "freedom"}
  ]
}

A new device is a new entry in clients: its own UUID and the same flow. After editing, restart the service.

What the Reality settings mean

  • dest — the website and port the server sends anyone who comes without the key to. A prober sees the real website. Newer Xray versions also accept the name target for this field.
  • serverNames — the site names a client may come with (SNI). Usually just one — the same site as in dest.
  • privateKey — the server's private key. Never show it to anyone. The link gets the public key from the same pair.
  • shortIds — a list of short IDs. The client sends one of them. Up to 16 characters from 0–9 and a–f, an even number of them.
  • flow xtls-rprx-vision — the VLESS mode for TCP with Reality. The link must have the same flow, or the server won't let the client in.

The link for the client

The link looks like this: vless://UUID@IP:443?parameters#name. IP is the server address; the name after # is just the profile label. The parameters are joined with &:

  • encryption=none
  • flow=xtls-rprx-vision
  • security=reality
  • type=tcp
  • sni=SITE — the same site as in serverNames
  • pbk=PUBLIC_KEY — the public key from xray x25519
  • sid=SHORT_ID — one of the shortIds
  • fp=chrome — which browser the client poses as

A QR code for a phone

Install qrencode: apt install -y qrencode. Then: qrencode -t ansiutf8 'link'. The code appears right in the terminal, and the phone client scans it.

Why Reality

Of the third-party protocols, VLESS Reality works best where ordinary VPNs get cut: to your ISP it is an ordinary secure website.

One detail: Reality doesn't need TLS fragmentation in the client. It breaks its handshake.

In Veli

The app installs Reality

In Veli: Profiles → Add → “Your own server”, the server's address and password, “Add the server”. On the server screen select VLESS Reality — the install button changes — and click it. The app then sets up the server by itself, and a profile for this computer appears on its own.

If port 443 is taken, Reality goes on 8443, and with that taken too, on 9443. “Add a device” gives a QR code for a phone: Hiddify, v2rayNG, Streisand and FoXray read it. You can put Veli on the same server as well: to your ISP it also looks like an ordinary website, and it updates itself.

FAQ

Which port does VLESS Reality need?

Usually 443 over TCP — like any HTTPS website. If it is taken, another will do: in that case Veli puts Reality on 8443 or 9443.

How do I open a vless:// link on a phone?

In any client with VLESS Reality: Veli, Hiddify, v2rayNG, Streisand or FoXray. Scanning the QR code is the easiest.

Reality or WireGuard?

If your network doesn't cut VPNs, WireGuard is faster. If it does — VLESS Reality: to your ISP it looks like an ordinary website.

VLESS Reality without the terminal

Select VLESS Reality on the server screen in Veli — the app installs it by itself and gives a QR code for a phone.