Report this

What is the reason for this report?

How I can use DigitalOcean server to build V2ray Vmess VPN

Posted on August 12, 2025
Hadi

By Hadi

Hi,

I know someone who lives in a country with very harsh internet access, and they can’t access free internet. The only way they can access internet is to use V2ray VPN.

Could you help me how I can use DigitalOcean to build a Vmess server to have access to free internet?

I can use DigitalOcean for Shadowbox internet access now; however, I don’t know if I can access Vmess VPN later with that, or I can’t. Please help me how I can use DigitalOcean server for V2ray Vmess internet.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Heya,

Step 1: Server Setup

First, create a new droplet on DigitalOcean:

  • Choose Ubuntu 20.04 or 22.04
  • Select at least the $6/month plan (1GB RAM)
  • Choose a datacenter location outside the restricted region

Step 2: Install V2Ray

SSH into your server and run these commands:

# Update system
sudo apt update && sudo apt upgrade -y

# Install curl if not present
sudo apt install curl -y

# Install V2Ray using official script
bash <(curl -L https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh)

Step 3: Generate UUID

Generate a UUID for your VMess configuration:

cat /proc/sys/kernel/random/uuid

Save this UUID - you’ll need it for both server and client configuration.

Step 4: Configure V2Ray Server

Create the configuration file:

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

Add this configuration (replace YOUR_UUID_HERE with your generated UUID):

{
  "inbounds": [{
    "port": 443,
    "protocol": "vmess",
    "settings": {
      "clients": [{
        "id": "YOUR_UUID_HERE",
        "alterId": 0
      }]
    },
    "streamSettings": {
      "network": "ws",
      "wsSettings": {
        "path": "/v2ray"
      }
    }
  }],
  "outbounds": [{
    "protocol": "freedom",
    "settings": {}
  }]
}

Step 5: Start and Enable V2Ray

# Start V2Ray service
sudo systemctl start v2ray

# Enable auto-start on boot
sudo systemctl enable v2ray

# Check status
sudo systemctl status v2ray

Step 6: Configure Firewall

# Allow port 443
sudo ufw allow 443

# Enable firewall if not already enabled
sudo ufw enable

Step 7: Client Configuration

For your friend to connect, they’ll need these details:

  • Server: Your DigitalOcean droplet IP
  • Port: 443
  • UUID: The UUID you generated
  • Protocol: VMess
  • Network: WebSocket (ws)
  • Path: /v2ray
  • TLS: None (for basic setup)

Optional: Add TLS/SSL

For better security and to avoid detection, consider adding TLS:

  1. Install Nginx and Certbot
  2. Get an SSL certificate for a domain pointing to your server
  3. Configure V2Ray to use TLS

Regarding Your Shadowbox Question

Your existing Shadowbox (Shadowsocks) setup and V2Ray VMess are different protocols. You can:

  1. Run both: Use different ports for each service
  2. Replace: Stop Shadowbox and use only V2Ray
  3. Choose based on performance: Test both and see which works better

V2Ray VMess often performs better in heavily censored environments due to better traffic obfuscation.

Important Notes

  • Keep your server updated regularly
  • Monitor server resources and upgrade if needed
  • Consider changing ports periodically if connections become unstable
  • Always ensure you’re complying with local laws regarding VPN usage

This setup should provide reliable access to unrestricted internet. The WebSocket configuration helps disguise traffic as regular HTTPS traffic, making it harder to detect and block.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.