Russia
A practical, command-by-command guide to installing Xray-core, generating secure credentials, configuring VLESS with XTLS Vision and REALITY, opening the firewall, connecting a client, and troubleshooting common VPS deployment errors.
This tutorial installs a self-hosted VLESS endpoint on a Linux VPS using Xray-core. VLESS provides lightweight client authentication, XTLS Vision controls the optimized data flow, and REALITY supplies the transport-security layer that makes the connection resemble an ordinary TLS session.
The final server listens on TCP port 443 and accepts only clients that present the correct UUID, REALITY client key, server name, and short ID. You do not need to purchase a domain or issue a TLS certificate for this basic REALITY configuration.
Responsible-use note: Deploy this technology only where lawful and permitted. It should not be used to access systems without authorization, violate platform rules, conceal abuse, or evade legal obligations.
The client connects to the VPS on port 443. REALITY handles the TLS-like handshake, VLESS authenticates the user, and XTLS Vision manages the flow. Xray then sends permitted traffic through the server’s normal outbound network connection.
Use a full virtual machine with administrative access, a public IP address, and control over the firewall.
This walkthrough uses a current Debian or Ubuntu release with the systemd service manager.
You need the VPS IP, SSH username, and either a password or, preferably, an SSH key.
No web server, control panel, or another proxy may already be listening on TCP port 443.
VLESS and REALITY do not require a large server for a small private deployment. Location, CPU consistency, network quality, and available bandwidth are generally more important than storage capacity.
| Deployment | Suggested Starting Point | Main Consideration |
|---|---|---|
| Personal endpoint | 1 vCPU, 1-2 GB RAM, 10+ GB NVMe | Choose a low-latency location. |
| Small authorized team | 2 vCPUs, 2-4 GB RAM, NVMe | Prioritize stable CPU and network throughput. |
| Higher concurrency | 2-4 vCPUs, 4-8 GB RAM, NVMe | Monitor CPU, connections, and traffic usage. |
Connect from a terminal with SSH. Replace the sample IP address with the public address supplied by the VPS provider.
ssh root@203.0.113.10
Update the package index, apply available updates, and install the tools used in the remaining steps.
apt update && apt upgrade -y
apt install -y curl openssl ca-certificates ufw
timedatectl status. Enable network time synchronization with timedatectl set-ntp truewhen necessary.The official XTLS installation project provides a script for systemd-based Linux distributions. Review third-party installation scripts before running them and use the official repository rather than an unknown mirror.
bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install
After installation, verify that the binary is available and display the installed version.
/usr/local/bin/xray version
systemctl status xray --no-pager
/usr/local/bin/xrayand the main configuration directory at /usr/local/etc/xray/.The server and client must share a matching UUID. REALITY also uses an X25519 key pair: the private value remains on the server, while the corresponding client-side value is entered in the client application.
/usr/local/bin/xray uuid
/usr/local/bin/xray x25519
openssl rand -hex 8
| Generated Value | Where It Is Used | Keep Secret? |
|---|---|---|
| UUID | Server user entry and every authorized client | Treat as a credential |
| Private key | ServerrealitySettings.privateKey |
Yes; never distribute it |
| Client key | Client field often labeled Public Key, Password, or PBK | Share only with authorized clients |
| Short ID | Server shortIdsand matching client field |
Treat as configuration data |
password, while many client interfaces and older guides call it the public key or pbk. Use the client-side value printed by xray x25519; never place the server private key in a client.REALITY uses the TLS appearance and handshake characteristics of a real HTTPS target. Choose a stable domain that supports TLS on port 443, is reachable from the VPS, and accepts the server name you will configure.
Test the candidate directly from the VPS. Replace the example domain with your selected target.
/usr/local/bin/xray tls ping www.microsoft.com:443
http://or https://URL.target, server serverNames, and client SNI consistent.Back up the existing configuration before replacing it. This makes recovery easier if a JSON error or incompatible value prevents the service from starting.
cp /usr/local/etc/xray/config.json /usr/local/etc/xray/config.json.backup 2>/dev/null || true
nano /usr/local/etc/xray/config.json
Paste the following configuration, then replace every uppercase placeholder with the values generated in the previous steps.
{
"log": {
"loglevel": "warning"
},
"inbounds": [
{
"tag": "vless-reality-in",
"listen": "0.0.0.0",
"port": 443,
"protocol": "vless",
"settings": {
"users": [
{
"id": "YOUR-UUID-HERE",
"flow": "xtls-rprx-vision",
"email": "primary-user"
}
],
"decryption": "none"
},
"streamSettings": {
"method": "raw",
"security": "reality",
"realitySettings": {
"show": false,
"target": "www.microsoft.com:443",
"xver": 0,
"serverNames": [
"www.microsoft.com"
],
"privateKey": "YOUR-SERVER-PRIVATE-KEY",
"shortIds": [
"YOUR-SHORT-ID"
]
}
}
}
],
"outbounds": [
{
"tag": "direct",
"protocol": "freedom"
},
{
"tag": "blocked",
"protocol": "blackhole"
}
]
}
clientsinstead of users, network: "tcp"instead of method: "raw", and destinstead of target. The configuration above follows the current Project X documentation terminology. Confirm the syntax supported by the Xray version actually installed on your VPS.| Field | Purpose | Must Match the Client? |
|---|---|---|
| port | Public listening port, normally 443 | Yes |
| ID | VLESS user credential or UUID | Yes |
| flow | Enables the XTLS Vision flow mode | Yes |
| target | HTTPS destination whose TLS appearance is used by REALITY | Client uses the matching server name, not the full target string |
| serverNames | Allowed SNI values for authorized clients | Yes |
| privateKey | Server-only X25519 private value | No; the client uses its corresponding client-side value |
| shortIds | Additional REALITY client identifier | Yes |
Test the configuration before restarting the production service. This catches missing commas, quotation errors, invalid keys, and unsupported fields.
/usr/local/bin/xray run -test -c /usr/local/etc/xray/config.json
When the test completes without an error, restart Xray and configure it to start automatically after reboot.
systemctl restart xray
systemctl enable xray
systemctl status xray --no-pager
Confirm that a process is listening on TCP port 443.
ss -lntp | grep ':443'
Allow the active SSH service before enabling the firewall. If your VPS uses a custom SSH port, allow that exact port instead of relying only on the OpenSSH application profile.
ufw allow OpenSSH
ufw allow 443/tcp
ufw --force enable
ufw status verbose
Use an up-to-date client that explicitly supports VLESS, XTLS Vision, and REALITY. The exact screen and field names vary by operating system and application.
| Client Field | Value |
|---|---|
| Address / Server | The VPS public IP address |
| Port | 443 |
| Protocol | VLESS |
| UUID / ID | The generated UUID |
| Flow | xtls-rprx-vision |
| Transport | RAW, or TCP in clients using the older label |
| Security | REALITY |
| SNI / Server Name | One hostname listed in the server’sserverNames |
| Fingerprint | A supported uTLS fingerprint, commonlychrome |
| Public Key / Password / PBK | The client-side X25519 value generated by Xray |
| Short ID | The generated hexadecimal short ID |
| SpiderX | Leave empty or use /when required by the client |
A successful systemd status alone does not prove that the client can connect. Verify the server locally and then test from an external network.
Confirm that X-ray is active.
systemctl is-active xray
Confirm that port 443 is open locally.
ss -lntp | grep ':443'
Read startup and connection errors.
journalctl -u xray -n 80 --no-pager
Connect from mobile data or another external network.
Test browsing and confirm the exit IP
| Problem | Likely Cause | What to Check |
|---|---|---|
| X-ray will not start | Invalid JSON or unsupported configuration field | Run the Xray configuration test and inspect systemd logs. |
| Port 443 is already in use | Nginx, Apache, Caddy, a panel, or another proxy is listening | Run ss -lntp | grep ':443'and stop or reconfigure the conflicting service. |
| Client times out | Firewall, provider security group, wrong IP, or blocked port | Verify UFW, the provider firewall, routing, and the public IP address. |
| Handshake fails immediately | Mismatched key, SNI, short ID, UUID, flow, or security mode | Compare every client value character by character with the server settings. |
| Works on one network only | Network filtering, DNS behavior, routing, or client-version differences | Test another target, another network, current clients, and the VPS route. |
| Slow connection | Distant location, congested route, CPU contention, or provider limits | Measure latency and throughput, then compare another VPS location. |
A working proxy service does not automatically make the server secure. Protect the operating system and administrative access separately.
install -m 600 /usr/local/etc/xray/config.json /root/xray-config-backup.json
bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install
bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ help
Re-test the configuration after a major update because field names, aliases, validation rules, and client compatibility can change over time.
Retzor offers KVM-based virtual servers with administrative operating-system access and NVMe storage. These are the core infrastructure characteristics needed to install Xray-core and control the firewall, service configuration, and listening ports.
Select a data-center location close to the intended users and test latency, route quality, public-IP accessibility, and port availability before moving an important configuration to production.
Independent virtual environment and operating-system control.
Administrative access for Xray, systemd, SSH, and firewall configuration.
Responsive storage for the operating system, packages, and logs.
Choose infrastructure based on latency and routing requirements.
No domain owned by the VPS operator is required for the basic setup. REALITY uses a configured external HTTPS target and matching server name. The client connects to the VPS public IP.
Not for this basic REALITY configuration. The setup does not present a conventional certificate issued for a domain owned by the operator.
Project X renamed the former TCP transport to RAW because the older name was ambiguous. Client interfaces may retain the older TCP label for compatibility or familiarity.
Two services cannot normally bind directly to the same IP and port. Advanced sharing designs require a carefully planned front end, fallback, or routing architecture and are outside this basic installation.
Yes. Add separate objects to the VLESS usersarray with unique IDs and labels. Separate credentials make revocation and auditing easier.
No. A VPS public address generally belongs to a hosting or datacenter network. REALITY changes the transport appearance; it does not change the ownership or classification of the server IP.
Installing VLESS with XTLS-Reality on a VPS involves four core tasks: installing Xray-core, generating the required credentials, building a valid REALITY server configuration, and entering identical values in a compatible client.
Most deployment failures are caused by a small mismatch rather than a complex server problem. Test the JSON before restarting Xray, verify that port 443 is free and reachable, and compare the UUID, flow, SNI, client key, and short ID carefully.
For the underlying infrastructure, a clean KVM VPS with root access, a public IP, stable networking, and a location close to the intended users is generally sufficient. Retzor virtual servers can be evaluated for this type of self-managed Linux deployment.