V2Ray Docker Compose
This repository introduces V2Ray-based solutions to bypass limitations in highly restricted networks without direct/safe/stable access to upstream servers (servers with access to free Internet).
Table of contents
Server Solutions
V2Ray Upsream and Bridge Servers
In this solution, you need these two servers:
- Upstream Server: A server that has access to the free Internet.
- Bridge Server: A server that is available to clients and has access to the upstream server.
(Client) <-> [ Bridge Server ] <-> [ Upstream Server ] <-> (Internet)
This solution consists of two steps and provides VMESS and Shadowsocks (AEAD) protocols.
Step 1: Setup Upstream Server
- Install Docker and Docker-compose.
- Copy the
v2ray-upstream-server
and theutils
directories into the upstream server. - Run
./utils/bbr.sh
to speed up server network. - Run
cat /proc/sys/kernel/random/uuid
in your terminal to generate a UUID. - Replace
<UPSTREAM-UUID>
inv2ray/config/config.json
with the generated UUID. - Run
docker-compose up -d
.
Step 2: Setup Bridge Server
- Install Docker and Docker-compose.
- Copy the
v2ray-bridge-server
and theutils
directories into the bridge server. - Run
./utils/bbr.sh
to speed up server network. - Replace the following variables in
v2ray/config/config.json
with appropriate values.<SHADOWSOCKS-PASSWORD>
: A password for Shadowsocks users likeFR33DoM
.<BRIDGE-UUID>
: A new UUID for bridge server (Runcat /proc/sys/kernel/random/uuid
).<UPSTREAM-IP>
: The upstream server IP address (like13.13.13.13
).<UPSTREAM-UUID>
: The upstream server UUID from previous step.
- Run
docker-compose up -d
. - Run
./clients.py
to generate client configurations and links.
V2Ray Behind a CDN Service
In this solution, you need one server (upstream) and a domain/subdomain added to a CDN service.
- Upstream Server: A server that has free access to the Internet.
- CDN Service: A Content delivery network like Cloudflare, ArvanCloud or DerakCloud.
(Client) <-> [ CDN Service ] <-> [ Upstream Server ] <-> (Internet)
This solution provides VMESS over Websockets + TLS + CDN. Read more...
Follow these steps to setup V2Ray + Caddy (Web server) + CDN:
- In your CDN, create an
A
record pointing to your server IP with the proxy option turned off. - Install Docker and Docker-compose on your server.
- Copy the
v2ray-caddy-cdn
and theutils
directories into the server. - Run
./utils/bbr.sh
to speed up server network. - Run
cat /proc/sys/kernel/random/uuid
to generate a UUID. - Replace
<UPSTREAM-UUID>
inv2ray/config/config.json
with the generated UUID. - Replace
<EXAMPLE.COM>
incaddy/Caddyfile
with your domain/subdoamin. - Run
docker-compose up -d
. - Visit your domain/subdomain in your web browser. Wait until the homepage is loaded.
- (Optional) In your CDN, turn the proxy option on for the record.
- Run
./vmess.py
to generate client configuration (link).
If you prefer NGINX as web server, read V2RAY_NGINX_CDN instead.
Some CDN services don't offer unlimited traffic for free plans. Please check CDN Free Plans.
You don't need to turn the cloud (proxy) on in your CDN (step 10) when the Internet is not blocked. When it's off, clients connect to the server directly and CDN services also don't charge you any fee.
V2Ray as Outline Bridge Server (Recommended)
Moved here: Outline Bridge Server
Client Applications
VMESS Protocol
This is the list of recommended applications to use the VMESS protocol:
- Nekoray for macOS, Windows, and Linux
- Qv2ray for macOS, Windows, and Linux
- V2RayX for macOS
- ShadowLink for iOS
- v2rayNG for Android
Shadowsocks Protocol
This is the list of recommended applications to use the Shadowsocks protocol:
- Outline for all platforms
- ShadowsocksX-NG for macOS
- shadowsocks-libev for Linux
- shadowsocks-windows
- shadowsocks-android
- ShadowLink for iOS
HTTP and SOCKS Protocols
Moved here: HTTP_SOCKS
Subscription Link
Moved here: SUBSCRIPTION_LINK
Tips
- Some hostings might ban your proxy traffic. Use an appropriate hosting.
- Some Internet providers might ban your proxy traffic. Changing AlterID could be helpful. See #57.
Docker Images
By default, this repository uses the GitHub registry. You can modify the Docker-compose file to use Docker Hub.
- GitHub:
- Image:
ghcr.io/getimages/v2fly-core:v4.45.2
- URL: https://github.com/orgs/getimages/packages/container/package/v2fly-core
- Digest:
sha256:289fc9451f21a265f95615e29f05ea23bc32026db152863eee317738813521d7
- Image:
- Docker Hub:
- Image:
v2fly/v2fly-core:v4.45.2
- URL: https://hub.docker.com/r/v2fly/v2fly-core/tags
- Digest:
sha256:289fc9451f21a265f95615e29f05ea23bc32026db152863eee317738813521d7
- Image: