How To Setup V2Ray Vmess + Websocket +TLS Cloudflare CDN on a VPS


Setting up v2ray ws+tls+cdn 

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


Recommended VPS 

Vultr - Powerful compute instances with Intel CPUs and 100% SSD storage. Support 24/7



Digital Ocean - Save Time and Money With Simple, Powerful, and Affordable Solutions on DigitalOcean

SSH VPS using Putty


Install Script

1. Make updates and enhancements first, and install Curl

sudo apt-get update -y 

sudo apt-get upgrade -y

sudo apt install curl -y


2. Run the script 'v2ray/v2-ui

bash <(curl -Ls https://blog.sprov.xyz/v2-ui.sh)


Get the SSL Certificates

You're going to need:

  • A name for a domain
  • An account with Cloudflare
  • Point your Cloudflare Name Servers to
  • Point your IP for your VPS to your domain name
  • You need a domain name (www.example.com), preferably a paid one from providers such as NameCheap, and a Cloudflare account to get an SSL certificate. Namecheap has Whois Guard for free. Prior to buying a domain, please check the renewal rates.

1. Nameservers configuration

Cloudflare will ask you to redirect your nameserver when you add your domain name to your Cloudflare account.

example1.ns.cloudflare.com
example2.ns.cloudflare.com

You need to copy those to your domain name registrar from Cloudflare (ex: namecheap.com). You will find it at Namecheap on Domain List > Manage > Nameservers. Shift the DNS to Custom DNS and add nameservers from Cloudflare. Cloudflare will tell you, after a while, that the setup is finished.





2. Connecting your domain name to the VPS IP address

On Cloudflare,
Go to DNS Management
Press “Add Record”
Type your sub-domain name or domain name to “Name”  (ex: write a test for test.example.com or @ for example.com)
Write your VPS IP to “IPv4 address”.
Make sure the color of “Proxy status” is orange and says Proxied
And lastly, change SSL/TLS mode to Full or Full (strict).




3. Getting SSL Certificate

Note: Please change the status of 'Proxied' to 'DNS Only' and then type the following SSL commands. You may modify the settings to their initial status after a successful installation.
"Alternatively, you can also change SSL encryption temporarily from "Absolute" to "Off.

SSH VPS using Putty


Install certbot:

sudo apt install software-properties-common
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get install certbot

Use certbot to get SSL Certificate. Use your own email address and domain name:

sudo certbot certonly --standalone --preferred-challenges http --agree-tos --email your-email-address -d test.example.com

In the text you will find destinations of your certificate file and key file. Copy them, as you will need  them on web panel. It will be something like this:

/etc/letsencrypt/live/test.example.com/fullchain.pem
/etc/letsencrypt/live/test.example.com/privkey.pem

Note: If you face errors and cannot get the certificate, please make sure that your firewall is listening to ports 80 and 443, you have pointed your VPS IP address to the domain name and the Cloudflare CDN is off.

The SSL certificate expires in 90 days, so make sure to reew it before expiration. Here is a manual renewal command.

certbot renew --force-renewal


Managing  v2ray

Adding a user

You can go to v2-ui web panel typing your IP address and the port (65432) on a browser. By default, both login and password are admin. You can change them in the panel settings.

http://"your-ip-address":65432
To add a user, you need to go to “accounts”, press add button and fill in the blanks according to  your preferences.

Remark – here you can write anything you want
Protocol – vmess
Listening IP, Port, ID (UUID) and Alter ID generated automatically. You can change them manually, as well. It is advised to use port 443. 
Transport – ws (websocket)
Path – you can leave it the way it is or add anything you want
Turn on TLS
Domain – write your domain name or sub-domain name
You can choose certificate file path and copy the file paths, or copy the certificate and key directly to certificate file content
Copy and paste certificate and key file paths, respectively
Press “Add”
And that is it. You can add, edit, delete users within seconds, and check bandwidth usage using v2-ui web-panel. 

You are not only limited to v2ray ws tls cdn with this web panel, you can configure and test various combinations of v2ray.

Thank  you sprov065 for this easy v2ray multi-user management panel.  





Bonus


BBR script

If you think your v2ray has slow speed, or have an older Linux version on your VPS, you can use bbr script by teddysun, to install google bbr.

wget -N --no-check-certificate https://github.com/teddysun/across/raw/master/bbr.sh && chmod +x bbr.sh && bash bbr.sh


Thank you!



0/Post a Comment/Comments

Previous Post Next Post