- One command VPN setup and remote monitoring
- Send metrics and created configs' link to a central dashboard
- Collect vital VM metrics such as CPU, Memory usage and Traffic
- Auto Cloudflare DNS management
- Direct configs or configs behind Cloudflare proxy
- Auto certificate generation for TLS configs (zerossl or letsencrypt)
- Support Warp and Direct outbound
- Auto discovery of the best Warp endpoint and auto rotation
- Create variety of VPN configs
- Auto update
- Auto configs rotation
- Auto block torrent or internal websites (download geosite files automatically)
- Support Free Grafana Cloud or Pushgateway for metric collection and dashboard
- Configs self testing using xray-knife
- and more...
- AMD64/ARM64 VPS (2 vCPUs and 2GB RAM recommended)
- Including but not limited to Ubuntu (20.04, 22.04 or 24.04), Debian 10-12 and Fedora
Creates config.json, monitor configs and export xray configs via /metrics path.
This service reads config.json from xray-config service and runs the xray-core.
Export v2ray configs metrics
Prometheus node exporter that collects all important metrics of the agent machine.
Reads xray-config, node-exporter and v2ray-exporter metrics and push them to the remote manager pushgateway service or Grafana Cloud promotheus endpoint.
Please follow this tutorial to create a manager (Options: Grafana Cloud or hosted Grafana+Prometheus).
We need authentication values from the manager to include in the "env_file" of the agent.
The following must run on a VPS that you want to use as a VPN server.
- git clone https://github.com/compassvpn/agent.git
- cd agent
- cp env_file.example env_file
- set METRIC_PUSH_METHOD to either "pushgateway" or "grafana_cloud" (depending on your selected option for the Manager)
- if METRIC_PUSH_METHOD=grafana_agent (comes from the manager setup [Option 1])
- set GRAFANA_AGENT_REMOTE_WRITE_URL
- set GRAFANA_AGENT_REMOTE_WRITE_USER
- set GRAFANA_AGENT_REMOTE_WRITE_PASSWORD
- if METRIC_PUSH_METHOD=pushgateway (comes from the manager setup [Option 2])
- set PUSHGATEWAY_URL (pushgateway URL)
- set PUSHGATEWAY_AUTH_USER (pushgateway basic auth user)
- set PUSHGATEWAY_AUTH_PASSWORD (pushgateway basic auth password)
- DONOR=noname (will be used as a label in the promtheus metrics)
- REDEPLOY_INTERVAL (reset IDENTIFIER and create new configs on each interval. e.g: 1d=1 day, 14d=every two weeks)
- IPINFO_API_TOKEN (https://ipinfo.io/signup - not mandatory)
- CF_ENABLE (true or false)
- CF_ONLY (true or false) - if the ip of the server is not clean (already filtered), set this to "true"
- CF_API_TOKEN (https://developers.cloudflare.com/fundamentals/api/get-started/create-token/ - for one zone)
- CF_ZONE_ID (zone id that is selected when creating CF API token)
- SSL_PROVIDER=letsencrypt (or zerossl)
- XRAY_OUTBOUND=direct # or warp
- set XRAY_INBOUNDS to your desired inbounds, listed in inbounds.json
- AUTO_UPDATE=on or off ("off" if it's not provided or commented)
./bootstrap.sh
./restart.sh
./update.sh
./restart.sh