Welcome to “How To Setup V2ray Proxy Server With A VPS” In this blog, we will provide complete information on mastering V2Ray, an effective open-source network proxy tool. Whether you are new to V2Ray or in search of to enhance your skills, this walkthrough will equip you with the information to effectively set up and optimize V2Ray on a Virtual Private Server (VPS).
V2Ray, famous for its flexibility and robustness, permits you to bypass network restrictions, enhance privacy, and invulnerable your online communications. However, putting up and configuring V2Ray on a VPS might also appear challenging to beginners. That’s where this blog comes in. We will guide you via every step, from selecting a VPS provider and setting up a connection to installing V2Ray, configuring each server and client settings, and optimizing its overall performance.
Choosing the right VPS (Virtual Private Server) is crucial when setting up V2Ray. the chosen VPS must have good:
Performance and Reliability: The performance and reliability of your VPS directly impact the overall performance of V2Ray. A high-quality VPS with robust hardware, sufficient resources (CPU, RAM, and storage), and a stable network connection ensure smooth and responsive V2Ray operations.
Location and Geo-Restrictions: The geographical location of your VPS affects the accessibility and bypassing of geo-restricted content. If you require V2Ray to access content from specific regions or to bypass censorship, selecting a VPS located in a suitable location can significantly enhance your ability to overcome such restrictions.
Network Speed and Latency: V2Ray heavily relies on network speed and latency to deliver fast and efficient proxy services. Selecting a VPS provider with good network infrastructure and low latency helps minimize delays and ensures optimal communication between V2Ray clients and the server.
Scalability and Flexibility: Your VPS provider should offer scalability options to accommodate your future needs. As your V2Ray usage grows, you may require additional resources or the ability to scale up your VPS plan. Choosing a provider that offers easy scalability ensures seamless expansion without disruptions.
Support and Assistance: A reputable VPS provider offers reliable customer support and assistance. When encountering technical difficulties or requiring guidance during the V2Ray setup, having access to responsive support can save time and ensure a smoother installation process.
It took some time but I was able to make a list of the best VPS to choose from
FOR THIS TUTORIAL I HAVE CHOSEN ORACLE CLOUD AS MY VPS
step 2: Create a VM on your VPS
It doesn’t matter which VPS you have chosen just make sure that when you create your VM you do the following.
On Image: change it to Ubuntu 22.04 or lower versions
Size: any size greater/equal to 1GB ram should be enough, depending on what you will use the V2ray for.
Fill in the rest of the required information and create your VM.
NOTE: in some VPS including Oracle Cloud you might need to first manually open ports after creating your VM. Click the link below to open the required ports.
It’s important to note that while price is a consideration, it’s also essential to choose a reputable registrar with good customer support and reliable service. Take the time to compare prices, features, and customer reviews to ensure you select the best option for your needs.
Once you have downloaded and installed Putty open it.
once you’ve got Putty open you’ll need to enter the hostname or IP address of our V2 Ray proxy server to do this we’ll need to open back up our browser go to our VPS provider Tab and then copy the IP address of our server. paste it on host name and click open.
if you are using oracle cloud follow:
Install putty on the search for putty gen on your Windows search bar, open putty gen.
select load, and browse to where you have saved your private key.
click putty private key files and change it by selecting all files ” to make your file visible”
select your file and click on generate.
move your mouse over the blank area to generate.
select save private key, browse to where you want to save it, give it a name, and save it.
Now search for putty and open it.
on Host Name (or IP address): write ubuntu@” put your IP address at the end” as shown in the image above.
select the + sign on SSH
select Auth
Select browse and go to where you have saved your new private key” the one created on putty gen” and select it.
select session on the top left corner of Putty and under saved session write any name and save “so that you won’t have to do the process again next time”.
click open
Step 6: installing V2ray on your vps
To activate root type:
sudo-i
update your server:
apt-get update
Once our server has been updated the next thing we need to do is to download and install the V2 Ray proxy server onto our VPS do this with the following command Â
replace the current UUID with the one you generated on the website, as shown in the image below
copy all the edited text and paste it on Putty by right-clicking on your mouse
now what we’ll need to do is save the changes that we have just made to the config. type Ctrl+O on your keyboard it will then ask you to name your file you must leave it as config.json and then hit enter on your keyboard great so the changes you have just made to your file have been saved now what we need to do is exit the Nano text editor by pressing Ctrl+X on your keyboard.
to go back to our root directory type CD and enter
next thing we need to do is set up our nginx web server to do this type:
apt-get install nginx -y
we need to type the command to get our lets encrypt SSL certificate to do this type the following command:
apt-get install certbot python3-certbot-nginx
you’ll be asked to enter your email address which as you can see says used for Urgent renewal and security notices so I’m just going to enter my email address now once you’ve entered your email address hit enter on your keyboard.
you’ll then be asked to read the terms of service if you agree to those terms please read the terms of service I’m going to press Y and then hit enter you’ll then be asked if you would like to share your email address with the Electronic Frontier Foundation which is a partner of let’s encrypt and cert box I’m going to type n for now hit enter on my keyboard.
you’ll be asked to enter the domain names you would like on your certificate this is where we enter the domain name we purchased before, type it and click enter
 if successful you should see the message which says successfully deployed certificate 4 and then your domain name congratulations you have successfully enabled.
now got our SSL certificate we can check the certificate if it has indeed been issued by opening up our browser and opening up a fresh Tab and then go to your domain: it must be like thisÂ
go back to Putty the next thing we need to do is set up our Nginx configuration file to do this you’ll need to navigate to the file by typing in the following command:
cd /etc/nginx/sites-available
now type ls and click enter, then you will see a file called default this time instead of opening up our file using a text editor we’re actually going to delete it. type:
rm default
now recreate the file by typing: nano default and then click enter
copy the following and replace domain.com with your domain name:
server { listen 80; server_name domain.com; return 301 https://domain.com$request_uri; }
# Show real IP in v2ray access.log proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } }
replace just the highlighted parts as shown in the image belowÂ
now select Ctrl+A to select the whole thing and paste it back on Putty by right-clicking on your mouse.
now what we’ll need to do is save the changes we have just made to this default file to do this press Ctrl+O enter on your keyboard and Ctrl+XÂ to exit out of the terminal.
Now what we need to do is go back to our root directory so type CD to change directory once you’re back in your root directory. and to restart nginx and v2ray type the following commands (click enter after every command).
systemctl restart nginx
systemctl status v2ray
close putty and now what we need to do is install the V2 Ray client so that we can connect to our server to do this open up your browser and click here
Navigate to assets and the one for your operating system and download it.
install the downloaded software don’t open it yet, just download the v2ray core using this link
unzip the downloaded folderÂ
on your desktop create a new document, on the document past the following
replace domain.com and UUID with your domain and UUID respectively replace the UUID with the one you generated before on the website.
now save and rename the document as v2ray.json as show in the image below
now open the Qv2ray software you have previously installed.
click on preferences and then click on kernel settings in the kernel settings you will need to select two file path locations the first one is for the V2Ray core executable path and the VRay assets directory for the V2Ray core executable path to the right-hand side of it click on select.
navigate your desktop and look for your v2ray dash Windows that’s 64. the folder that you extracted from the zip file double click on it to go into it and then select the V2 Ray executable file which is the dot exe.
Click OK
to import the v2ray.json file the one you saved on your desktop click on import click on Advanced and for the path click on select
locate the v2ray.json file on your desktop and click on it. the click import
to connect to the server right click on the v2ray.json and click on the play icon as shown in the image below