March 09, 2023
Launch Configuring v2ray VPN on Linux server
Have an opinion? Send us proposed edits/additions and we may incorporate them into this article with credit.
Words
845
Time
1m 1s
Contributors
35
Words read
10.3k
V2Ray
V2RayNG
V2Ray-Desktop
Appimagelauncher
Nginx
All answers
Installation Process
Compatible VPN Protocol
System Proxies
Jump to top
Research
Source: "How to Set Up a VPN Server on Linux | Step-by-s..." (from web, proprivacy.com)
-
Setting up a private Linux VPN server
- You need a client computer, a private server, and a compatible VPN protocol (OpenVPN is recommended)
- Must not have OpenVPN pre-installed and must have sudo privileges or root access
- Need to allow TCP traffic over port 943, and UDP traffic over port 1194
- Install OpenVPN and the cURL programs, then download the VPN installation script
- Run the script to install and configure OpenVPN, answer the prompts, and name the configuration and come up with a strong password
- Copy the.ovpn configuration file to the OpenVPN client folder
- Run a test on the connection
- Add the configuration file to the Network Manager for ease of access
-
Subscribing to a premium VPN service
- Provides a wide range of privacy tools
- Reliably unblocks geo-restricted services
- 24/7 customer service available
- A monthly subscription can get expensive
- You place your privacy in the hands of the VPN service
-
Free VPN
- No subscription fee, but usually has bandwidth limits and monthly data caps
- Reduced server selection
- Not all free VPNs are safe - some contain malware
-
Testing the Linux VPN server
- Use a leak test to determine whether your VPN server is suffering from an IP leak, as well as IPv4, IPv6, DNS, and WebRTC leaks
Source: "Linux v2ray client?" (from reddit, r/dumbclub)
-
Install V2Ray on Linux using the script provided in the install guide:
-
sudo su
-
bash <(curl -L -s https://install.direct/go.sh)
-
-
Install Qv2Ray GUI for Linux using Appimagelauncher and the Qv2Ray AppImage
- Install Appimagelauncher
- Download Qv2Ray AppImage
- Download V2Ray kernel
- Open the AppImage with Appimagelauncher
- Extract the contents of the V2Ray kernel zip into the folder that opens up
- Open Qv2Ray again and the Chinese GUI should start
-
Install V2Ray-Desktop, a cross-platform V2Ray GUI client
- Supports Windows, Linux, and macOS
- Supports both Shadowsocks (without obfs) and V2Ray servers
- Supports connecting to multiple servers
- Supports adding servers from a subscription URL
- Supports adding servers by scanning QR codes
- Supports PAC proxy mode, Global proxy mode, and Manual proxy mode
- Supports getting and setting system proxies for Windows, Linux (GNOME), and macOS
- Supports automatically updating GFWList
- Supports automatically starts up when logged in
Source: "V2ray with UI on Ubuntu" (from reddit, r/dumbclub)
-
vmess + ws + TLS
- Use qv2ray on Linux with a UI, but it’s a hassle to run a script to enable the system proxy log off and on, then another script to disable the proxy and log off and on
-
vless + TCP + XTLS (xray) with a fallback to Nginx and a LE certificate
- Currently the “best” if you have a good direct connection to the server
- Reverse proxy through Nginx with Let’s Encrypt
-
vless + WS + TLS behind CDN
- Second best option, but fully dependent on the connection quality to the CDN
-
Good ye ole SS
- Personal servers (i.e.: run on your own vps) don’t often get blocked
- Run a maintained version like -rust or -libev
-
V2ray with UI on Ubuntu
- v2-ui seems to have migrated to x-ui
- Use the Github repository from Vaxilu to install x-ui
-
V2ray Desktop
- Use the Github repository from Dr-Incognito to install V2Ray-Desktop
Source: "Need help with configuring v2ray on Linksys 32x..." (from reddit, r/dumbclub)
-
Configure v2ray using the json file exported from v2rayN
- Configure v2ray using the json file which includes server info and settings
- JSON file should include “inbounds”, “outbounds”, and “routing” settings
-
Configure v2ray using the LUCI app
- Configure v2ray using the LUCI app as per the json file
- Use the json file from v2ray.com with server info
-
Test the connection
- Test the connection by checking stdout for any output
- If nothing comes out, troubleshoot the connection
💭 Looking into
What are the best practices for maintaining a v2ray server?
💭 Looking into
What are the security implications of running v2ray on a Linux server?
💭 Looking into
What are the steps for running the install script for v2ray?
💭 Looking into
What are the steps for setting up Nginx web server for v2ray?
💭 Looking into
Does the config.json file need to be structured in a specific way to be read by v2ray?
Source: "How to Set Up V2Ray Proxy on Ubuntu 22.04/20.04..." (from web, www.linuxbabe.com)
-
Install V2Ray on Ubuntu 22.04/20.04 Server
- Download the official V2Ray install script
- Run the install script
- Check status
- Restart it
- Enable auto-start at system boot time
-
Set Up NTP Time Sync
- Check the time on your server
- Follow the tutorial to set up NTP time synchronization
-
Configure V2Ray on the Server
- Edit V2Ray configuration file
- Delete everything in this file and add the following lines
- Replace the ID with some random characters in UUID format
-
Configure Reverse Proxy
- Install Nginx web server
- Create a virtual host file for V2Ray
Source: "How To Install V2ray On Amazon EC2 And Google C..." (from web, www.dev2qa.com)
-
Install v2ray on the Linux server
- Update Linux Server Date Time
- Install unzip
- Change to the root user
- Run the shell script: bash <(curl -L -s https://install.direct/go.sh)
-
If you meet an error when running the shell script, browse https://github.com/v2fly/fhs-install-v2ray to get the new v2ray install method
- Install curl
- Download v2ray install shell script file: curl -O https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh and curl -O https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-dat-release.sh
- Install v2ray: bash install-release.sh
- Install geoip.dat and geosite.dat: bash install-dat-release.sh
- Remove v2ray: bash install-release.sh –remove
-
The new v2ray installation shell script: bash <(curl -L https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh)
- Configuration file path is /usr/local/etc/v2ray/config.json
- v2ray.service file in /etc/systemd/system directory
Source: "How to setup your own v2ray server on a VPS" (from reddit, r/dumbclub)
-
Use the guide from Privacy Melon to set up the server on a VPS:
- The guide is written in English
-
Use Clash for Windows as a client for Windows:
- It’s the best looking v2ray client
- It is believed to be more stable than Shadowsocks
- It is more stable in China
- No instructions provided for setting up a client on OpenWRT router
- Can be used for Windows servers on ADW
Source: "Please help me using vmess and v2ray on linux" (from reddit, r/dumbclub)
-
Construct the entire client config:
- Read the source and save the output of the “export full configuration to clipboard” to a config.json file
- On linux, run “v2ray -c config.json” or start in the background with a systemd service
-
Use V2rayNG to do the routing rules:
- In the app settings, select “Bypass mainland address” under “Predefined rules”
- This will create a socks/http proxy that will send Chinese traffic directly and proxy everything else to vmess
Source: "How to Set Up Xray Vless+XTLS 2021 Proxy/VPN on..." (from reddit, r/dumbclub)
-
Tutorial for setting up a v2ray/xray proxy with ws+tls+CDN in Ubuntu and Debian
- Link to the tutorial is provided which includes instructions on how to install on CentOS
-
Understanding what xTLS is
- xTLS stands for Xray+TLS and use TLS v1.2 + TLS v1.3
- XTLS is the latest Chinese protocol released in December 2020, making it difficult for GFW to recognize it
💭 Looking into
What is the best way to configure v2ray VPN on a Linux server?