Essential Management Commands
Check Service Status
sudo systemctl status xray
sudo systemctl status nginxRestart Services
sudo systemctl restart xray
sudo systemctl restart nginxView Live Logs
sudo journalctl -u xray -f --no-pagerUpdate X-ray Core
bash /usr/local/share/xray/install-release.shFrequently Asked Questions
Q: My client can't connect. What should I check?
- Check Firewall: Make sure port 80 (TCP) is allowed in your VPS provider's firewall (e.g., Hetzner Cloud Console). This is the most common issue.
- Check IP and UUID: Double-check that the IP address and UUID in your client app exactly match your server's details.
- Check Logs: Use `sudo journalctl -u xray -f` while trying to connect. If you see an error, it will tell you what's wrong.
Q: How do I add a second user?
Edit the X-ray config file (`/usr/local/etc/xray/config.json`) and add another client object to the `clients` array. Generate a new, unique UUID for the second user.
"clients": [
{
"id": "FIRST_USER_UUID"
},
{
"id": "SECOND_USER_UUID"
}
],Performance & Tuning
1. Benchmark Your Speed
First, test your server's raw internet speed by running a command-line speed test on the server itself.
# Install the speedtest CLI
sudo apt install speedtest-cli -y
# Run the test
speedtest-cliThen, use a service like Speedtest.net on your computer or phone, once without the VPN and once with it, to see the performance difference.
2. Enable BBR for Higher Throughput
Google's BBR is a modern network congestion control algorithm that can significantly improve connection speed and reduce latency. It's built into most modern Linux kernels. Run this one command to enable it:
sudo bash -c 'echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf && echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf && sysctl -p'You may need to reboot your server for this to take full effect.