Update from the original repo:
- Add additional notes for trouble shooting
- Update guidelines such as the latest usage of docker compose
- Add more helper script to speed up and simplify deployment
Using Azure as an example
- Create a Virtual Machine
- Any kind of Size (schema) will work, but you can use exactly the same as mine
- Size: Standard B2s (2 vcpus, 4 GiB memory)
- Operating system: Linux (ubuntu 20.04)
- Location: Japan East
- Disk: Standard SSD
- Make sure you disable the auto-shutdown scheduling
- Any kind of Size (schema) will work, but you can use exactly the same as mine
- Once the VM creation complete
- Open necessary ports, in this case you need to open 80, 443
- Create a DNS name: such as
your-dns-name
- You can use a dynamic IP address
- You will be able to connect to your machine by using
your-dns-name.japaneast.cloudapp.azure.com
depending on the machine's location
ssh
into your machine
- Install docker with
install_docker.sh
Legacy Steps
- Install
docker
- Download the auto setup script and run:
curl -fsSL https://get.docker.com -o get-docker.sh
thensh get-docker.sh
- Add user to the docker user group (so you don't need
sudo
to usedocker
):sudo gpasswd -a $USER docker
- Make docker auto start on boot:
sudo systemctl start docker
thensudo systemctl enable docker
Install(Install Docker Compose | Docker Documentation) (Currently docker compose is a built-in)docker compose
DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
mkdir -p $DOCKER_CONFIG/cli-plugins
curl -SL https://github.com/docker/compose/releases/download/v2.4.1/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose
chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose
- Download some CLI tools
sudo apt update
sudo apt install git vim tmux
git clone https://github.com/daviddwlee84/DockerCompose-V2Ray.git
andcd DockerCompose-V2Ray
- Modify settings
- Modify
your_domain
andyour_email_address
ininitial_https.sh
and execute docker-compose.yml
- No need to modify
data/v2ray/config.json
- Change id to use your own
"id": "bae399d4-13a4-46a3-b144-4af2c0004c2e"
(or you can leave it as what it is) - You can generate a new UUID using this online tool: Online UUID Generator Tool (not sure what is the difference between different version UUIDs, seems not all UUID-like strings will work)
- Change id to use your own
- Modify
- Start server
tmux
docker compose up --build
(permission issue just addsudo
in the front)- Exit you can use
Ctrl + b
thend
to detach tmux and typeexit
to close the terminal
Legacy Steps
init-letsencrypt.sh
- Modify
domains
and- If you are using Azure, the
domains
isyour-dns-name.japaneast.cloudapp.azure.com
(DNS name).- Note that
domains
SHOULD BE AN ARRAY, that is you should keep the parenthesis there.data/nginx/conf.d/v2ray.conf
- Modify all
your_domain
- You can use vim
:%s/your_domain/your-dns-name.japaneast.cloudapp.azure.com/g
- Setup Nginx and HTTPS encryption stuff
chmod +x ./init-letsencrypt.sh
./init-letsencrypt.sh
- if you can't use this, might because docker need
sudo
permission- must make sure the ports (firewall) are opened
Type: Vmess
- Address:
your-dns-name.japaneast.cloudapp.azure.com
- Port:
443
- UUID:
bae399d4-13a4-46a3-b144-4af2c0004c2e
- Alert ID: 64
- Method: auto
- TLS
- enable
- allow insecure
- Transport:
websocket
- Path:
/v2ray
- Path:
- Clash for Windows: Releases · Fndroid/clash_for_windows_pkg
- It has "mac" version
# ...
proxies:
- name: "Your Customized Name"
type: vmess
server: your-dns-name.japaneast.cloudapp.azure.com
port: 443
uuid: bae399d4-13a4-46a3-b144-4af2c0004c2e
alterId: 64
cipher: auto
udp: false
tls: true
skip-cert-verify: true
network: ws
ws-opts:
path: /v2ray
# ...
You can see logs/
folder
Use sudo tail -f ./path/to/log.log
to see the error message then debug
- If you forgot to open
80,443
ports, you will fail at certbot step. Removedata/certbot
folder and try again. - If your Nginx server successfully running, you can connect to
https://your-dns-name.japaneast.cloudapp.azure.com
using a browser and see "Congratulation!" which basically is this HTML (data/nginx/html/v2ray/index.html
) - You can connect to
https://your-dns-name.japaneast.cloudapp.azure.com/v2ray
- If you get a 502 error, that means your V2Ray server is not running correctly.
- If you get the text "bad request", that means it is successfully running.
- If you changed UUID and failed to connect but every other thing is fine (v2ray log can see traffic income), maybe change UUID back to the default value.