Debian/Ubuntu Server

Generate a UUID by visiting https://www.uuidgenerator.net.

SSH into the server. Update the server:

apt update && apt upgrade

Install or upgrade to the latest V2Ray:

bash <(curl -L https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh)

Edit the configuration file:

vi /usr/local/etc/v2ray/config.json

Use this example as a model to adapt as you wish:

{
  "log": {
    "loglevel": "warning"
  },
  "routing": {
    "domainStrategy": "AsIs",
    "rules": [
      {
        "type": "field",
        "ip": [
          "geoip:private"
        ],
        "outboundTag": "block"
      }
    ]
  },
  "inbounds": [
    {
      "listen": "0.0.0.0",
      "port": 80,
      "protocol": "vmess",
      "settings": {
        "clients": [
          {
            "id": "3796bf0e-c038-47f3-8a0c-49ce6ae18650"
          }
        ]
      },
      "streamSettings": {
        "network": "tcp"
      }
    }
  ],
  "outbounds": [
    {
      "protocol": "freedom",
      "tag": "direct"
    },
    {
      "protocol": "blackhole",
      "tag": "block"
    }
  ]
}

Open port tcp/80 (or whatever port number you choose) in your server firewall.

Start the service:

systemctl enable v2ray
systemctl start v2ray

Check the service status:

systemctl status v2ray

Debian/Ubuntu Client

Install or upgrade to the latest V2Ray:

cd ~/Downloads
curl -L https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh -O
sudo bash install-release.sh

Edit the configuration file:

sudo vi /usr/local/etc/v2ray/config.json

Use the example as a model to follow. Replace the server IP address and other parameters as you desire:

{
  "log": {
    "loglevel": "warning"
  },
  "routing": {
    "domainStrategy": "AsIs",
    "rules": [
      {
        "type": "field",
        "ip": [
          "geoip:private"
        ],
        "outboundTag": "direct"
      }
    ]
  },
  "inbounds": [
    {
      "listen": "127.0.0.1",
      "port": "1080",
      "protocol": "socks",
      "settings": {
        "auth": "noauth",
        "udp": true,
        "ip": "127.0.0.1"
      }
    },
    {
      "listen": "127.0.0.1",
      "port": "1081",
      "protocol": "http"
    }
  ],
  "outbounds": [
    {
      "protocol": "vmess",
      "settings": {
        "vnext": [
          {
            "address": "123.123.123.123",
            "port": 80,
            "users": [
              {
                "id": "3796bf0e-c038-47f3-8a0c-49ce6ae18650"
              }
            ]
          }
        ]
      },
      "streamSettings": {
        "network": "tcp"
      },
      "tag": "proxy"
    },
    {
      "protocol": "freedom",
      "tag": "direct"
    }
  ]
}

Start the service:

sudo systemctl enable v2ray
sudo systemctl start v2ray

Check the service status:

sudo systemctl status v2ray

Either configure Firefox to use the SOCKS v5 proxy server on 127.0.0.1 port 1080, or configure system-wide networking to use the SOCKS v5 proxy server on 127.0.0.1 port 1080. In the configuration in this post, you can alternatively use the HTTP proxy server on 127.0.0.1 port 1081.


<
Previous Post
Create Shadowsocks 2022 sing-box Server
>
Next Post
Install Xray VMess+TCP Server and Client on Linux