Menu
User

DropVPS Team

Writer: Cooper Reagan

How to install V2Ray on Docker?

How to install V2Ray on Docker?

Publication Date

06/28/2025

Category

Articles

Reading Time

2 Min

Table of Contents

configuration file, and run the container. Let’s get right into it.

Step 1: Create a Configuration File

Make a folder for your V2Ray setup:

mkdir ~/v2ray-docker
cd ~/v2ray-docker

Create a basic config.json file:

nano config.json

Paste a minimal configuration like this (modify as needed):

{
  "inbounds": [{
    "port": 10086,
    "protocol": "vmess",
    "settings": {
      "clients": [{
        "id": "YOUR-UUID-HERE",
        "alterId": 0
      }]
    }
  }],
  "outbounds": [{
    "protocol": "freedom",
    "settings": {}
  }]
}

Generate a UUID if needed:

cat /proc/sys/kernel/random/uuid

Step 2: Pull the V2Ray Docker Image

Use the official image from v2fly:

docker pull v2fly/v2fly-core

Step 3: Run the Container

Now, run the V2Ray container with your configuration:

docker run -d \
--name v2ray \
-v $(pwd)/config.json:/etc/v2ray/config.json \
-p 10086:10086 \
v2fly/v2fly-core run -c /etc/v2ray/config.json

Make sure the port 10086 is allowed in your firewall or security group if you’re on a VPS.

Step 4: Check Logs

To make sure V2Ray is running:

docker logs -f v2ray

You should see logs confirming V2Ray is listening on the specified port.

Step 5: Update or Stop the Container (Optional)

To update the container:

docker pull v2fly/v2fly-core
docker stop v2ray
docker rm v2ray
# then run it again with the same command as before

To stop and remove:

docker stop v2ray
docker rm v2ray

 

Linux VPS
U
Loading...

Related Posts