How To Install V2ray with Cloudfront, Cloudflare, Ngnix And Websocket On VPS

generate secure interent connection Install V2ray with Cloudfront, Cloudflare, Ngnix And Websocket On VPS
If you need to generate secure interent connection but find yourself lacking the resources to manage servers, you might want to think about following these step-by-step instructions for installing V2Ray on a Linux server with the Cloudfront distribution, Cloudflare CDN, and Nginx using the one-click v2ray installation script. This article is intended for users of mobile devices and PCs who want to use AWS-hosted SNI.


What do we need?A Linux server (VPS)Domain-NameCloudflare accountAmazon Web Services accountV2ray Installation Script for Nginx

SSH client

A Linux server (VPS)

Get a Linux server with your preferred distro and I prefer Ubuntu from the Ubuntu 16 version. Make sure you have root access to your server and I mostly use DigitalOcean(free $100), Linode(free $100), and Vultr(free $100). For best results, I recommend using a VPS with at least 2GB of RAM and a data center(server location) nearest to your area of operation.

Domain Name

Any domain name provider that allows you to change your name servers will be of great use for V2ray. I recommend Bluehost, Hostgator, Hostinger, Goviralhost, and NameCheap as low-cost and fast website hosting and domain name providers. If you already have a domain name, if you're still unsure where to get the best domain name for the best low price, try the DOMCOMP price comparison website.

Read Also: V2ray Panel XTLS TLS CDN Webscoket Installation Guide

Cloudflare Account

We'll use Cloudflare to point our domain name to the Linux server (VPS) we set up, essentially creating a DNS record. Go to the official Cloudflare website and create an account using your real details and create a DNS record. If you are not familiar with Cloudflare, kindly Click here to find out how to do this.

cloudflare Home page

Learn: How To Create Non-proxied Cloudflare DNS Records For V2ray

The SSH Client

Any SSH client can work. However, for Android users, I recommend using Termius or Juice SHH, and for Windows, I recommend Putty or Mobaxterm.

Amazon Web Services Account

We shall use Amazon Webhosting Services' Cloudfront distribution to add more security layers to our V2ray traffic. This is the best method for AWS-hosted SNI. If you are not familiar with creating Cloudfront distributions for V2ray, click here.

AWS CloudFront page

V2ray Installation Script for Nginx

We are going to use a simple python one-click installation script to install V2Ray and Ngnix on our server. All you need to do is SSH into your Linux VPS as the root user, update your packages, and paste the command given below.

Update and upgrade packages

sudo apt update && pkg upgrade -y

V2ray Ngnix one lick installation script

bash <(curl -L -s | tee v2ray_ins.log

By the time of writing this article, V2ray, Ngnix is option 1, therefore you need type 1 and press enter. This script was designed by Chinese developer Wulabing, and all credits go to him.

V2ray, Ngnix

The next step is to enter your domain name in the form ( and press enter. Make sure to enter the exact domain name used in creating the DNS record on Cloudflare as described earlier.

enter domain name

Enter the desired V2ray port and I recommend port 443,

enter port

Scan or copy printed VMESS from your server console and import it via clipboard on your preferred V2ray client with android, ios, or Windows.

scan or copy vmess

Create a Cloudfront distribution from your Amazon Webhosting services account and use your domain name ( as the "origin domain". Replace your domain name in the Vmess with the CloudFront URL provided by AWS as shown below.

edit vmess

Congs. You have finally created a V2ray VMESS with Cloudflare, Cloudfront, and Ngnix, and all you need to do now is to connect and enjoy safe and secure surfing. What else have we missed? Kindly leave us comments below. We'll be glad to answer you as soon as possible.

Post a Comment

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using an adblocking plugin in your browser.
The revenue we earn from the advertisements is used to manage and do research. For this website, we request that you whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.