Xray Reality / VLESS Setup
Xray Reality / VLESS Setup
This note records a minimal Xray Reality / VLESS setup.
The example values are fake but shaped like real values, so the config is easier to read than a wall of placeholders.
Example environment:
- server:
vpn.example.com - listen port:
443 - client UUID:
11111111-2222-4333-8444-555555555555 - Reality private key:
example_private_key_do_not_use - Reality public key:
example_public_key_do_not_use - Reality short id:
a1b2c3d4e5f60708 - camouflage target:
www.microsoft.com:443
Replace all of them.
Service Commands
Check the service:
1 | sudo systemctl status xray |
After editing the config, test it before restart:
1 | sudo xray run -test -config /usr/local/etc/xray/config.json |
Generate IDs And Keys
1 | xray uuid |
Keep the private key on the server. Put the public key in the client config.
Server Config Example
1 | { |
Firewall
Only the public entry port needs to be open:
1 | sudo nft add rule inet filter input tcp dport 443 accept |
If SSH uses a custom port such as 22222, keep that rule
separate and preferably source-restricted.
Client-Side Fields
A client profile usually needs:
1 | address: vpn.example.com |
Notes
privateKey, UUID, and short id are secrets. Do not publish real values.- Time sync matters. If the client and server clocks are too far apart, debugging becomes confusing.
- Start with a direct connection first. Add extra reverse proxies only after the base config works.