March 09, 2023

Launch Configuring v2ray VPN on Linux server

Words

845

Time

1m 1s

Contributors

35

Words read

10.3k


Jump to research

Composed by

Profile picture

h. a.

Views

647

Version history

h. a., 481d ago

Have an opinion? Send us proposed edits/additions and we may incorporate them into this article with credit.

V2Ray

V2Ray

It seems V2Ray is a popular option for setting up a VPN on a Linux server. People have used the official V2ray install script to install it on Ubuntu 22.04/20.04 [1] , and Nginx web server and Let's Encrypt certificate to set up a reverse proxy [4] . Many users have found success with installing Qv2Ray GUI for Linux with Appimagelauncher and the Qv2Ray AppImage [6] , or V2ray Desktop which supports Windows, Linux, and macOS [8] . Configuring v2ray can be done using the JSON file exported from v2rayN or LUCI app, and testing the connection can be done by checking stdout for any output [7] . It is important to note that subscribing to a premium VPN service provides various privacy tools, but can get expensive in terms of cost [9] , whereas free VPNs often have bandwidth limits and monthly data caps, but are not always safe as they may contain malware [9] . Lastly, it is important to test the Linux VPN server for any IP leaks using a leak test [9] .
V2RayNG

V2RayNG

V2RayNG seems to be the best option for launching VPN on Linux server. People say that it is believed to be more stable than Shadowsocks [5] , and that it is more stable in China [5] . It also provides a wide range of privacy tools and reliably unblocks geo-restricted services [9] . Installing V2RayNG on Linux requires downloading the official V2Ray install script [4] , setting up NTP time synchronization [4] , editing the configuration file [4] , and configuring reverse proxy with Nginx web server [4] . To get the best user experience, it's recommended to use Qv2Ray GUI for Linux with a UI and V2Ray-Desktop which supports Windows, Linux, and macOS.
V2Ray-Desktop

V2Ray-Desktop

V2Ray-Desktop is a cross-platform V2Ray GUI client that supports Windows, Linux, and macOS. It supports both Shadowsocks (without obfs) and V2Ray servers, as well as connecting to multiple servers and adding servers by scanning QR codes. It also supports PAC proxy mode, Global proxy mode, and Manual proxy mode, getting and setting system proxies for Windows, Linux (GNOME), and macOS. People say that it is the best looking v2ray client [6] , and it can be used for Windows servers on ADW [8] .
Appimagelauncher

Appimagelauncher

Appimagelauncher is an option to install qv2ray on Linux with a User Interface (UI). People say that qv2ray is the best looking v2ray client [6] , and it is believed to be more stable than Shadowsocks [8] . It is also more stable in China [8] . Although Appimagelauncher does not provide instructions for setting up a client on OpenWRT routers, it is suitable for Windows servers on ADW [6] .
Nginx

Nginx

It seems Nginx is an option for launching a v2ray VPN on Linux servers [3] , and it is used for reverse proxying requests through the server for better security [5] [7] . It is also believed to be more stable than Shadowsocks [3] and can be used with Windows servers on ADW [3] . Additionally, it supports setting up a virtual host file for v2ray [4] , as well as providing a LE certificate [9] . People say that Qv2Ray GUI for Linux with a UI is another good option [6] , as well as V2Ray Desktop which supports Windows, Linux, and macOS platforms [6] .
All answers

All answers

  • V2Ray
  • V2RayNG
  • V2Ray-Desktop
  • Appimagelauncher
  • Nginx
  • OpenWRT
  • CentOS
  • Ubuntu
  • Debian
  • Windows
  • macOS
  • Shadowsocks
  • GFWList
  • PAC proxy mode
  • Global proxy mode
  • Installation Process

    Setting up a Linux VPN server requires downloading the necessary programs and scripts [1] [5] [9] , as well as allowing TCP traffic on port 943 and UDP traffic on port 1194 [9] . To install V2Ray, download the official install script [4] and run it, then enable auto-start at system boot time [4] .

    Compatible VPN Protocol

    OpenVPN is the recommended protocol for setting up a private Linux VPN server [9] , but other protocols are available, such as Shadowsocks (without obfs) and V2Ray servers [6] . XTLS (Xray+TLS), released in December 2020, is believed to be difficult for GFW to recognize [2] .

    Reverse Proxy and Firewall Configuration

    Reverse proxy through Nginx with Let's Encrypt is recommended with vless + WS + TLS behind CDN being second best option [8] . For Linksys routers, configure v2ray using the LUCI app according to the json file from v2ray.com with server info [7] .

    Network Time Synchronization

    To ensure that the VPN connection is stable, it's important to sync the time between the client computer and server using NTP time synchronization [4] [5] . Check the time on your server and follow a tutorial to set up NTP time synchronization.

    System Proxies

    V2Ray-Desktop is an easy-to-use cross-platform V2Ray GUI client that supports Windows, Linux, and macOS. It supports getting and setting system proxies for Windows, Linux (GNOME), and macOS as well as automatically updating GFWList and automatically starts up when logged in [6] [8] . Qv2Ray can be used for a graphical user interface on Linux but requires running a script to enable/disable system proxy logoff/on frequently.

    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: "V2ray package - how to actually setup the proxy..." (from web, forum.manjaro.org)

    None

    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)

    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?