Install V2Ray (Xray) on VPS servers without a domain

V2Ray Logo

Introduction

Using Xray you can experience a Fully stable high-speed network connection with a Low ping. This tutorial will teach us how to install and use V2ray (Xray) without a domain name.

What you need

  • VPS with Ubuntu 20.04 or Ubuntu-latest OS.
  • A UUID (Generate a UUID via V2rayN or https://uuidgenerator.net).
  • Use xray-nodomain script to connect directly from IP without using DNS

Installation Steps

1 Update server

apt-get update -y && apt-get upgrade -y

2 Restart the server after the update

sudo reboot

3 Clone (Download) scripts from the git repository

sudo git clone https://github.com/sbatrow/vps-xray-script

4 Change to the cloned directory

cd vps-xray-script

5 Change permission

sudo chmod 777 xray-nodomain.sh

6 Run the script

sudo ./xray-nodomain.sh

You will have to provide a UUID when you are asked for one. A UUID can be generated from here. You will have to write down the UUID for later use.

Connecting to the v2ray (x-ray) server

There are several applications that allow you to connect to your own v2ray VPS. For example, you can use either Netch or V2rayN in windows systems and either HTTP Proxy Injector or V2rayNG in Android systems

1 Windows – Netch

  1. Download Netch
  2. Extract/Install Netch (You can use Winrar to extract the above file)
  3. Open Netch
Netch UI
  1. Set the Mode to “Bypass LAN”
  1. Turn on the TLS Allowinsecure option in setting
    • Click Settings -> V2Ray -> TLS Allowinsecure
  1. Add your server details to Netch
    • Click Server -> add [VLESS] server
    • Fill your details in
      • Remark – You can put a comment here (for example – Server name)
      • Address – IP of the VPS server
      • Port – Usually 443
      • ServerName (SNI) – Change this to a URL and your ISP will think you are accessing this website
      • UUID – UUID you generated before in the installation step
      • Host – IP of the VPS server
      • The rest should be as in the below image
    • Click save
Example Settings
  1. Select your newly added server from the Server list. A green icon with the ping will appear if Netch can locate your server.
  1. Then click Start to connect to your server
    • A Green icon would appear at the bottom right corner of the window if you filled in all the details without any errors. It will also display NAT: {some server details / unknown server}
    • Otherwise, it will display NAT: NoUDP
Netch UI after successfully connecting to the VPS

Now you are successfully connected to your x-ray VPS!

2 Android – HTTP Injector

  1. Install the HTTP Injector from the Play store
  2. Install the V2Ray plugin for HTTP Injector from the Play store
  3. Open the HTPP Injector app
  4. Open the left sidebar by clicking the menu icon
  5. Click V2Ray settings
  6. Fill in the server details
    • Core – V2Ray
    • Protocol – VLESS
    • Host – Your VPS IP
    • Server port – Usually 443
    • User ID – UUID generated in the server installation step
    • Security – None
    • Network type – TCP
    • Header type – None
    • TLS – Enable TLS if you need the TLS option
    • TLS SNI – Change this to a URL and your ISP will think you are accessing this website (eg- youtube.com)
    • Allow insecure – Turn this on
  7. Return back to the homepage of the app
  8. Select the button just below the start button
    • Tunnel type – Select V2Ray
    • Connect from – Select none (direct)
    • Click save to save the change
  9. Start the VPN by clicking start

Now you are successfully connected to your x-ray VPS!

Uninstallation

This will remove xray-core and all modified config files from the server. However, this will not remove BBR

sudo rm -rf ~/bash-xray-script

sudo git clone https://github.com/sbatrow/vps-xray-script

cd vps-xray-script

sudo chmod 777 remove-xray.sh

sudo ./remove-xray.sh

Credits

  1. VPS-XRAY-Script on Github
  2. https://github.com/teddysun – BBR autoscript
  3. Team Rezoth – Contributor


4 responses to “Install V2Ray (Xray) on VPS servers without a domain”

  1. Latest Hairstyles Avatar

    Thank you for your post. I really enjoyed reading it, especially because it addressed my issue. It helped me a lot and I hope it will also help others.

  2. Hairstyles Avatar

    Thank you for writing this post!

  3. Beauty Fashion Avatar

    Thank you for providing me with these article examples. May I ask you a question?

  4. Hairstyles Avatar

    Thank you for providing me with these article examples. May I ask you a question?

Leave a Reply

Your email address will not be published. Required fields are marked *