VLESS Deployment Guide: From Server Setup to Client Optimization
1. Server-Side Deployment
1.1 Install Xray Core
First, log in to your Linux server (Ubuntu 20.04+ or CentOS 7+ recommended). Use the official script to install Xray:
bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install
After installation, Xray runs as a systemd service. Check its status with systemctl status xray.
1.2 Configure VLESS Inbound
Edit the Xray configuration file at /usr/local/etc/xray/config.json and add a VLESS inbound. Below is a basic example using Reality:
{
"inbounds": [
{
"port": 443,
"protocol": "vless",
"settings": {
"clients": [
{
"id": "your-uuid",
"flow": "xtls-rprx-vision"
}
],
"decryption": "none"
},
"streamSettings": {
"network": "tcp",
"security": "reality",
"realitySettings": {
"dest": "www.microsoft.com:443",
"serverNames": ["www.microsoft.com"],
"privateKey": "your-private-key",
"shortIds": ["6ba85179e30d4fc2"]
}
}
}
],
"outbounds": [
{
"protocol": "freedom",
"tag": "direct"
}
]
}
Key Parameters:
id: Unique identifier for the client, generated viaxray uuid.flow: Usextls-rprx-visionfor XTLS flow control.[security](/en/blog/vmess-vs-vless-performance-and-security-trade-offs-in-censorship-circumvention-2):realitymode effectively hides proxy characteristics.dest: Target domain for camouflage; choose a large CDN domain.
1.3 Start and Verify
Restart Xray and check logs:
systemctl restart xray
journalctl -u xray -n 20 --no-pager
2. Client Configuration
2.1 Download Client
- Windows/macOS: v2rayN or Clash Verge.
- Android: v2rayNG.
- iOS: Shadowrocket or Stash.
2.2 Add VLESS Node
Using v2rayN as an example:
- Click "Server" -> "Add [VLESS] Server".
- Fill in server address, port, UUID, and flow.
- Under "Transport", select
tcptransport,realitysecurity, and enter the server's public key, shortId, and serverName. - Save and enable the node.
2.3 Test Connection
Visit ip.sb to verify your IP has changed. If unable to connect, check firewall rules for the port (default 443).
3. Performance Optimization
3.1 Enable BBR Congestion Control
BBR significantly improves TCP throughput. Run:
echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf
sysctl -p
Verify with sysctl net.ipv4.tcp_congestion_control (should return bbr).
3.2 Adjust Xray Buffer
Add "bufferSize": 64 to the inbound configuration to optimize memory usage.
3.3 Use CDN Relay
If your server IP is throttled, wrap VLESS with WebSocket + TLS and route through Cloudflare CDN. Note: Reality mode cannot be directly proxied via CDN.
4. Common Issues
4.1 Connection Timeout
- Ensure the firewall allows the port.
- Synchronize system time (error < 1 minute).
- Verify
serverNamematches thedestdomain.
4.2 Slow Speed
- Try changing
flowtoxtls-rprx-vision. - Check server bandwidth usage.
- Change the camouflage target (
dest).
4.3 UUID Conflict
Ensure each client uses a unique UUID to avoid conflicts.