V2ray or vmess protocol to be precise, is a sophisticated version of the famous Shadowsocks. At the core v2ray is also based on SOCKS5 proxy. Normally, proxies lack encryption, and that’s what differentiates a VPN and a proxy. Shadowsocks is SOCKS5 proxy with an encryption, and vmess is the next gen Shadowsocks.
V2Ray includes two “protocols” vmess, v2ray’s own protocol and Shadowsocks. In addition, you can choose several tunneling and obfuscation options with vmess.
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.
Choosing a VPS provider to host your server
Why I am using Vultr (Affiliate link. Please sign under it so YOU and I can get some free time on Vultr) for this tutorial
With servers starting from $5/month and good routing to China Telecom, Vultr offers a good combination of price and speed. It's not the fastest server you can buy, but it does offer the best value for money in my opinion.
Vultr servers are always billed hourly. This is a very useful feature for 2 reasons.
1. If you mess something up and want to start over again, just destroy the VPS and make a new one. It will only cost you $0.01 if you destroy the VPS within the first 2 hours. This is a great way for beginners to learn to use Linux.
2. If your server gets blocked, you can just destroy it and make a new one. You won't lose money because you only pay for the amount of hours you use the server for.
Once you have used the server for 625 hours (~26 days), then you will pay the monthly price. If you destroy your server before 625 hours, then you will pay for the number of hours that you used. You will see both the monthly and hourly price when you choose your instance. This is not an option to choose, it is just showing you both prices.
Vultr offers a very generous bandwidth allowance that you will likely never go over. Note that the data allowance is pro-rated for the amount of hours if you use the server for less than 1 month.
Tip - If you go over this allowance, it's cheaper to shut down your instance and start a new one rather than paying the excess data fee (or upgrade to a higher price instance).
If this is your first time setting up a ShadowsocksR server, then just stick with Vultr for now and follow this tutorial exactly to the letter.
After you learn the process of making a server using Vultr or if you are already familiar with Linux, you may want to consider some other providers for higher performance (if you are willing to spend more and take the risk of paying monthly/annually instead of hourly).
If you want to try other providers, make sure you choose Ubuntu 18.04 64 bit as the OS and KVM as the virtualization (if available).
Previously this tutorial did not work for OpenVZ virtualization because it is not possible to change the kernel to install BBR. However, now that BBR comes pre-installed on Ubuntu 18.04, this tutorial might work with Ubuntu 18.04 on OpenVZ virtualization (not sure, someone please confirm in the comments if you have tried it).
Choose the best server locations for your ISP
Before we get started, it's a good idea to do some network analysis to find the best Vultr server location for your ShadowsocksR server.
Using the hostnames below, send a ping command to each server to check the latency to your location. Remember to turn off any existing VPN connections, because we want to check the latency between your ISP and the Vultr servers.
The locations shown in bold have the best routing to China Telecom.
Tokyo, Japan hnd-jp-ping.vultr.com
Silicon Valley, California sjo-ca-us-ping.vultr.com
Los Angeles, California lax-ca-us-ping.vultr.com
Seattle, Washington wa-us-ping.vultr.com
Frankfurt, DE fra-de-ping.vultr.com
Amsterdam, NL ams-nl-ping.vultr.com
Paris, France par-fr-ping.vultr.com
London, UK lon-gb-ping.vultr.com
New York (NJ) nj-us-ping.vultr.com
Chicago, Illinois il-us-ping.vultr.com
Atlanta, Georgia ga-us-ping.vultr.com
Miami, Florida fl-us-ping.vultr.com
Dallas, Texas tx-us-ping.vultr.com
Sydney, Australia syd-au-ping.vultr.com
If you are using Windows, you can download my Vultr ping script to automatically ping all of Vultr servers.
I have identified 4 servers that have a decent ping time to my China Telecom connection.
I am going try a Tokyo server and a Los Angeles server.
To avoid confusion, I will just show the instructions for setting up 1 of the servers, although I am actually doing both at the same time.
Deploy your instance
The first step is to go to Vultr and create an account if you don't already have one. You will need to fund your account with a minimum $5 deposit using PayPal or verify a valid credit card.
I recommend turning off your VPN if you are using a Chinese credit card or Chinese PayPal account to avoid this fraud detection. If you are are using an overseas credit card, you may want to connect to a VPN in the same country as your credit card, or turn your VPN off. I'm not sure which option is better in this case.
Although Vultr offers WeChat payments, this won't work for you unless you have a Chinese ID card (only Chinese citizens can use WeChat and Alipay for merchants outside of China).
Once your account is funded/verified then you can deploy a new instance (VPS).
Choose your location
Choose the server type (OS). For this tutorial, I am using Ubuntu 18.04 x64
Ok, time to connect to our server using SSH.
If you are using Mac, you can use the Terminal program to start an SSH session with your server.
Open Terminal and enter the following command (Mac users only):
ssh server_ip -p 22 -l root
replace server_ip with the IP address of your server.
For example, using my server in this tutorial, you would enter the following.
ssh 18.104.22.168 -p 22 -l root
Unlike Mac, Windows does not come with an SSH client.
I am using Windows, so I have downloaded Putty.
If you are using Putty for Windows, enter the IP address of your Vultr server and press open to connect to it. Leave all of the settings as default. You can save the session so you don't need to enter the IP address next time.
I saved the settings as
Accept the security warning and then login as root and enter the password from the Vultr server management page.
Tip - To paste text from the clipboard using Putty, simply press the right mouse button once and whatever is in the clipboard will get pasted. When typing or pasting your password, you won't see anything on the screen. Just press enter after you have typed it or pasted it by single clicking the right mouse button.
If your SSH connection is not successful, wait a few more minutes and try again. When you first create a server, it can take up to 5 minutes until it's ready to use.
If you still can't connect after your server is ready, that means your IP address is blocked by the Great Firewall of China (probably due to the person who used that IP address before you).
This can be confirmed by connecting to a VPN to see if you can connect.
If your IP is blocked, then destroy your instance and make a new one.
Once you have a good IP address that is not blocked and you are logged in successfully, your screen should look like this.
Setting up v2ray
Thanks to the one-command script by 233blog.com, 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 https://git.io/v2ray.sh)
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.
Choose 1 to install
Next you choose the protocol.
For sake of simplicity let’s choose TCP
4. Now you choose the port. You can choose the default value or change it. I choose port 23432.
5. 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.
6. 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.
I will keep it simple and choose not to install Shadowsocks
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.sh – 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 uuidgenerator.net
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:
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:
Installing v2ray to Your Devices
v2ray apps for Android
You can use v2ray on several apps on Android, and all of them are available for free.
v2ray apps for iOS
You can use v2ray on several apps on your iPhone as well, but for now all of the v2ray apps are paid apps.
v2ray clients for Windows
For your Windows PC, you can choose one of these three v2ray Windows clients. And here is a download link. There is also a new software called Clash, that requires a 64-bit Windows. You can download it here.
v2ray clients for MacOS
For your Mac PC, you can choose one of these two v2ray clients. And here is a download link for V2RayX and here for V2RayU.
ENJOY and please send us your feedback!
You can always save your time and Buy a subscription with us.