How to setup your own V2ray server

V2ray is a sophisticated variant of the popular Shadowsocks, or vmess protocol to be precise. V2ray is also based on the SOCKS5 proxy at its heart. Proxies typically lack encryption, and that's what makes a VPN and a proxy different. Shadowsocks is an encryption SOCKS5 proxy, and vmess is the next version of Shadowsocks.

Two "protocols" vmess, v2ray's own protocol and Shadowsocks are part of V2Ray. Additionally, with vmess, you can choose multiple tunneling and obfuscation options.

  • TCP – It is the default connection. “TCP (Transmission Control Protocol) is a type of protocol or standard to transfer information over the Internet, such as SSH, FTP, HTTP, etc.“
  • Websocket – With Websocket you can hide your VPS IP address behind a domain name, making it harder for the VPN blocking firewall to blacklist the IP address.
  • mKCP – An alternative to TCP, could be faster than TCP. Could be useful if you need a UDP like protocol.
  • QUIC – Google’s alternative to TCP and UDP. Based on UDP. Could be faster than TCP.

In addition, you can mask some of above protocols and make them look like a Wireguard, WeChat video, torrent, VOIP or DTLS traffic.

List of Best VPS:

1. Vultr - Vultr Global Cloud Hosting - Brilliantly Fast SSD VPS Cloud Servers. 100% KVM Virtualization.

2. DigitalOceanHelping millions of developers easily build, test, manage, and scale applications of any size – faster than ever before.

3. Linode - Simplify your infrastructure with Linode's cloud computing and hosting solutions and develop, deploy, and scale faster and easier.

Setting up V2ray:

1) If you are interested in an advanced v2ray configuration websocket(ws)+tls+cdn with multi-user management panel, please click here to check out the new tutorial. Also, you can check  trojan GFW tutorial.

2) If this script does not work for you,and you only need simple v2ray tcp, you can install the script described on v2ray +ws+tls+cdn tutorial. You only need to do the Part-1 (install the script), and skip the Part-2 (SSL, domain, CDN) and choose TCP on the webpanel.

Thanks to the one-command script by, you can install v2ray even if you are not familiar with Linux commands. 

You need to have at least Ubuntu 16, Debian 8 or CentOS 7. 

This guide will be for Ubuntu.

1. First make updates and upgrades

sudo apt-get update

sudo apt-get upgrade

2. Run the v2ray script

bash <(curl -s -L

If you run into the error “curl command not found” then run apt-get update -y && apt-get install curl -y

3. First question will ask you which version you choose. No major differences between 1 and 2. You can choose 1.

4. Next you choose the protocol. For sake of simplicity let’s choose TCP.


5. Now you choose the port. You can choose the default value or change it. I choose port 23432.


6. Then you choose to install an ad-blocker or not. It is noted that performance may be affected if ad-blocker is activated. I choose not to install it.


7. You will be asked whether you also want to install Shadowsocks. If you type Y,  then you will have to choose a Shadowsocks port, a password and an encryption method. I will keep it simple and choose not to install Shadowsocks.


8. And lastly, you press Enter to proceed or Ctrl+C to cancel. After a while, the setup will be complete. Now you can get v2ray configuration by typing v2ray qr (for QR code) or v2ray link (for url).

Managing  v2ray:
V2ray commands

v2ray info – View V2Ray configuration information
v2ray config – Modify V2Ray configuration
v2ray link – Generate V2Ray configuration file link
v2ray infolink – Generate V2Ray configuration information link
v2ray qr – Generate V2Ray configuration QR code link
v2ray ss – Modify Shadowsocks configuration
v2ray ssinfo – View Shadowsocks configuration information
v2ray ssqr – Generate Shadowsocks Configure QR code link
v2ray status – View V2Ray running status
v2ray start – Start V2Ray
v2ray stop – stop V2Ray
v2ray restart – restart V2Ray
v2ray log – View V2Ray Run log
v2ray update – Update V2Ray
v2ray – update V2Ray management script
v2ray uninstall – Uninstall V2Ray

Adding multiple users on v2ray (Bonus)

The v2ray script adds only one user as a default, you can add multiple users by editing the config file. Normally, you would not need to add multiple users, since multiple users can use the same configuration. I have added this section as a bonus.
1. First, generate multiple UUIDs on the
2. Next, SSH into your VPS and type nano /etc/v2ray/config.json to edit the config file
3. Default configuration of users is given as following:
“users”: [
“id”: “b831381d-6324-4d53-ad4f-8cda48b30811”, 
“alterId”: 233
4. You shoud edit the config as given below, note that I add a comma sign (,)  and copy and paste the above user config in brackets and change the uuid:
“users”: [
“id”: “b831381d-6324-4d53-ad4f-8cda48b30811”, 
“alterId”: 233 
“id”: “z454362o-4324-8b12-gh1l-8zer71r59603”, 
“alterId”: 233
5. You can add as many users as you want following the above guide. Just repeat the process. After adding users press Ctrl+X to exit the config, and press Y to save the changes.


0/Post a Comment/Comments

Previous Post Next Post