Certainly! Here is a step-by-step guide to setting up a VPS with V2Ray:
1. Choose a VPS provider and create a new instance. Most providers offer a range of operating systems to choose from, but we recommend using a Linux-based OS such as Ubuntu or Debian.
2. Connect to your VPS instance using SSH. You can use a tool like PuTTY (Windows) or Terminal (Mac/Linux) to do this.
3. Update your system's package list and install necessary dependencies:
Code:
sudo apt-get update
sudo apt-get install curl gnupg2 ca-certificates
4. Add the V2Ray repository to your system's package sources:
Code:
curl -L https://github.com/v2fly/v2ray-core/releases/latest/download/v2ray-linux-64.zip -o v2ray-linux-64.zip
unzip v2ray-linux-64.zip
sudo mv v2ray /usr/local/bin/
sudo mv v2ctl /usr/local/bin/
sudo chmod +x /usr/local/bin/v2ray /usr/local/bin/v2ctl
sudo mkdir /etc/v2ray
sudo curl -L https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/systemd/v2ray.service -o /etc/systemd/system/v2ray.service
5. Configure V2Ray by editing the
/etc/v2ray/config.json
file. You can use the following template as a starting point:
Code:
{
"inbounds": [
{
"port": 8080,
"listen": "127.0.0.1",
"protocol": "socks",
"settings": {
"auth": "noauth",
"udp": false
}
}
],
"outbounds": [
{
"protocol": "vmess",
"settings": {
"vnext": [
{
"address": "your_server_ip",
"port": 443,
"users": [
{
"id": "your_uuid",
"alterId": 64
}
]
}
]
}
},
{
"protocol": "freedom",
"tag": "direct",
"settings": {}
}
],
"routing": {
"rules": [
{
"type": "field",
"outboundTag": "direct",
"ip": [
"geoip:private"
]
},
{
"type": "field",
"outboundTag": "direct",
"domain": [
"geosite:cn"
]
}
]
}
}
Make sure to replace
your_server_ip
and
your_uuid
with your own server IP address and UUID, respectively.
6. Start and enable the V2Ray service:
Code:
sudo systemctl start v2ray
sudo systemctl enable v2ray
7. Verify that V2Ray is running by checking the service status:
Code:
sudo systemctl status v2ray
You should see a message indicating that the service is active and running.
That's it! Your VPS is now set up with V2Ray. You can use a V2Ray client to connect to your server and start using the SOCKS5 proxy.