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.
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 versionxray 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.
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 xrayxtls-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.sudo journalctl -u xray -e and compare every value on both sides.Plans: Fast VPS from $7.99 a month; a small VPS is enough for a few users.
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.