Skip to content
Projects

DanOps-1/Xray-VPN-OneClick

View on GitHub

About

🚀 5分钟部署 VLESS+Reality VPN | 访问 ChatGPT/Claude/Google | npm CLI 管理工具 | One-Click Xray Server with Traffic Stats | 科学上网 翻墙 梯子 魔法

Systems & Infrastructure

How these counts are measured

Measured star growth

in 24h
0
in 7 days
Update delayed
in 15 days
-1
in 1 month
Collecting history

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

docs/README-en.md

Original
Xray VPN OneClick Logo

🚀 Xray VPN OneClick | One-Click Proxy Setup

Deploy VLESS+Reality Proxy Server in 5 Minutes — The Strongest Anti-Censorship Protocol

🔥 No Domain/Certificate Required | TLS 1.3 Traffic Camouflage | Active Probe Defense | Cross-Platform Support

Self-hosted Proxy · Bypass Restrictions · VPN Alternative · Access ChatGPT/Claude

npm version npm downloads GitHub Stars GitHub Forks

CI codecov License Last Commit

Platform Protocol TypeScript Node.js

PRs Welcome GitHub Issues

中文 | English


⚡ Quick Install (30 seconds)

# One-click install Xray + VLESS + Reality (just copy & paste)
wget https://raw.githubusercontent.com/DanOps-1/Xray-VPN-OneClick/main/scripts/install.sh -O xray-install.sh && sudo bash xray-install.sh
📦 Alternative install methods (npm / git clone)
# npm global install (requires Node.js 18+)
npm install -g xray-manager && sudo xm install

# Clone and install
git clone https://github.com/DanOps-1/Xray-VPN-OneClick.git && cd Xray-VPN-OneClick/scripts && sudo bash install.sh

Requirements: Linux (Ubuntu 22.04+ / Debian 11+ / CentOS 9+), 512MB RAM, public IP


📑 Table of Contents


✨ Introduction

Xray VPN OneClick is a fully automated Xray server deployment project using the latest VLESS + XTLS-Reality protocol, providing secure, high-speed, and hard-to-detect proxy services.

Why Choose This Project?

Feature Description
🎯 Zero-Config Deployment Complete installation with one command, auto-generate all parameters
🔐 Top-Level Security Reality protocol makes traffic indistinguishable from normal TLS
⚡ High Performance Built-in BBR congestion control and TCP Fast Open optimization
📱 Cross-Platform Supports Windows, macOS, Linux, Android, iOS
🛠️ Complete Tools User management, backup/restore, one-click updates
📚 Comprehensive Docs Complete bilingual documentation and troubleshooting guides

🌐 Use Cases

🤖 Access AI Services

  • ChatGPT / GPT-4
  • Claude / Anthropic
  • Google Gemini / Bard
  • Midjourney / DALL-E
  • GitHub Copilot

🔒 Privacy & Security

  • Public WiFi protection
  • Prevent ISP traffic monitoring
  • Protect sensitive communications
  • Anonymous browsing

💼 Remote Work

  • Secure access to corporate intranet
  • Cross-border team collaboration
  • Remote development environment
  • Enterprise VPN alternative

🎓 Academic Research

  • Access Google Scholar
  • Download academic papers
  • Use international academic resources
  • Participate in international academic exchanges

👨‍💻 Developer Tools

  • Access GitHub / GitLab
  • Use npm / Docker Hub
  • Read technical documentation
  • Stack Overflow

🌍 Content Access

  • YouTube / Netflix
  • Twitter / Instagram
  • Telegram / Discord
  • International news media

🎯 Key Features

🚀 Deployment Features

  • ✅ One-Click Install - Deploy in 5 minutes
  • ✅ Auto Configuration - UUID & keys auto-generated
  • ✅ systemd Integration - Auto-start on boot
  • ✅ Multiple Install Methods - wget, curl, git clone
  • ✅ China Acceleration - Mirror acceleration available

🔒 Security Features

  • ✅ VLESS Protocol - Lightweight & high-performance
  • ✅ Reality Camouflage - Traffic hard to identify
  • ✅ x25519 Keys - Strong encryption
  • ✅ Short ID - Enhanced security
  • ✅ Anti-Replay - Built-in protection

🛠️ Management Features

  • ✅ User Management - Add/delete users
  • ✅ Config Backup - Auto backup & restore
  • ✅ One-Click Update - Upgrade to latest version
  • ✅ View Config - Display connection info
  • ✅ Safe Uninstall - Complete system cleanup

📱 Client Features

  • ✅ Share Links - Auto-generate VLESS URLs
  • ✅ QR Codes - Quick scan import
  • ✅ All Platforms - Major systems covered
  • ✅ Multi-Protocol - v2ray ecosystem compatible
  • ✅ Detailed Guides - Platform-specific tutorials

🆚 Protocol Comparison

Protocol Speed Security Anti-Detection Config Difficulty Recommendation
VLESS+Reality ⭐⭐⭐⭐⭐ ⭐⭐⭐⭐⭐ ⭐⭐⭐⭐⭐ ⭐⭐⭐⭐ ✅ Recommended
VMess+WebSocket+TLS ⭐⭐⭐ ⭐⭐⭐⭐ ⭐⭐⭐ ⭐⭐⭐ ⚠️ Average
Shadowsocks ⭐⭐⭐⭐ ⭐⭐⭐ ⭐⭐ ⭐⭐⭐⭐⭐ ⚠️ Easily Blocked
Trojan ⭐⭐⭐⭐ ⭐⭐⭐⭐ ⭐⭐⭐⭐ ⭐⭐⭐ ✅ Alternative
V2Ray (Legacy) ⭐⭐⭐ ⭐⭐⭐ ⭐⭐⭐ ⭐⭐ ❌ Outdated

VLESS+Reality Advantages:

  • 🎯 Traffic characteristics identical to real TLS 1.3 connections
  • 🎯 No need to purchase domain or configure certificates
  • 🎯 Minimal performance overhead, near direct-connection speed
  • 🎯 Active probing cannot identify proxy characteristics

🚀 Quick Start

📋 System Requirements

Click to view detailed requirements

Minimum Requirements

  • OS: Linux (see supported list below)
  • RAM: 512 MB
  • Storage: 100 MB available
  • Network: Public IP address

Recommended Configuration

  • OS: Ubuntu 22.04 LTS / Debian 12
  • RAM: 1 GB
  • CPU: 1 core
  • Bandwidth: 10 Mbps+

Supported Operating Systems

Distribution Minimum Version Status
Ubuntu / Debian / Kali 22.04 / 11 / 2023+ ✅ Fully Supported
CentOS Stream / AlmaLinux / Rocky 9 ✅ Fully Supported
Fedora / Amazon Linux 39 / 2023 ✅ Fully Supported

⚡ One-Click Installation

Choose the installation method that suits you (Method 1 recommended):

Method 1: Direct Install

wget https://raw.githubusercontent.com/DanOps-1/Xray-VPN-OneClick/main/scripts/install.sh -O xray-install.sh
sudo bash xray-install.sh

Method 2: Accelerated Install

# Recommended for China servers
wget https://ghproxy.com/https://raw.githubusercontent.com/DanOps-1/Xray-VPN-OneClick/main/scripts/install.sh -O xray-install.sh
sudo bash xray-install.sh

Method 3: Clone Repository

git clone https://github.com/DanOps-1/Xray-VPN-OneClick.git
cd Xray-VPN-OneClick/scripts
sudo bash install.sh

After installation, the script will output server information and client configuration. Please save them properly.


📱 Client Configuration

Supported Clients

Platform Recommended Client Download Link
Windows v2rayN GitHub Releases
macOS V2rayU / V2RayXS V2rayU | V2RayXS
Linux v2ray-core / Qv2ray v2ray | Qv2ray
Android v2rayNG GitHub Releases
iOS Shadowrocket / Quantumult X App Store (US Account Required)

Quick Import

Method 1: Using Share Link (Recommended)

  1. Copy the VLESS share link from installation output
  2. Open client application
  3. Select "Import from Clipboard" or "Scan QR Code"
  4. Connect and start using

Method 2: Manual Configuration

See detailed tutorial: Client Setup Guide


🛠️ Service Management

🎯 Interactive CLI Tool (Recommended)

Use the powerful CLI tool to manage Xray service after installation:

# Install CLI tool
npm install -g xray-manager

# Start interactive menu
xray-manager
# Or use short alias
xm

💡 Tip: You can also use npx xray-manager to run without installation

🎨 Main Features

Module Description
📊 Service Management View status, start/stop/restart service
👥 User Management Add/delete users, generate share links
📊 Traffic Quota ⭐ Set quotas, traffic alerts, auto-disable on excess
⚙️ Config Management Backup/restore config, modify settings
📝 Log Viewer Real-time logs, filter by level/time
📈 Dashboard Service overview, user stats, traffic stats
View detailed feature list

Service Management

  • View service status (uptime, memory usage)
  • Start/stop/restart service
  • Auto-detect permissions and systemd

User Management

  • List all users (with traffic usage info)
  • Add new user (auto-generate UUID)
  • Delete user
  • Display share link (auto-copy to clipboard)

Traffic Quota Management ⭐ NEW

  • Set traffic quota for users (preset/custom)
  • View traffic usage and remaining quota
  • Traffic alerts (80% yellow / 100% red)
  • Auto-disable users exceeding quota
  • Reset traffic and re-enable users

Config Management

  • View current configuration
  • Create config backup (timestamped)
  • List all backups
  • Restore configuration
  • Modify config items

Log Viewer

  • View recent logs
  • Real-time log tracking (Ctrl+C to stop)
  • Filter by level (error/warning/info/debug)
  • Filter by time range

Dashboard

  • Service status overview
  • User statistics (active/warning/exceeded)
  • Total traffic usage statistics
  • Real-time data refresh

Terminal Compatibility 🌍

View terminal compatibility details

The CLI tool supports various terminal environments with automatic adaptation:

Supported Terminals

  • ✅ Modern terminals: xterm, iTerm2, GNOME Terminal, Konsole (Unicode + colors)
  • ✅ Windows CMD: Fully compatible (pure ASCII text icons)
  • ✅ SSH sessions: Auto-detect and adapt to remote terminal
  • ✅ Legacy terminals: vt100, dumb terminal (fallback to ASCII)
  • ✅ Pipe output: Auto-switch to plain text + timestamp mode when redirected

Three Output Modes

Mode Use Case Features
RICH Modern terminals (default) Colors + Unicode icons + formatting
PLAIN_TTY No-color terminals ASCII icons + formatting (no colors)
PIPE Pipe/log files Plain text + timestamps + structured output

Recommended Terminal Sizes

Size Type Terminal Size Layout Mode
Minimum 60x20 COMPACT
Standard 80x24 STANDARD (recommended)
Widescreen 120+ columns WIDE

🔧 Native systemd Commands

If not using the CLI tool, you can use systemd commands directly:

# Check service status
sudo systemctl status xray

# Start/stop/restart service
sudo systemctl start xray
sudo systemctl stop xray
sudo systemctl restart xray

# View logs
sudo journalctl -u xray -f        # Real-time logs
sudo journalctl -u xray -n 100    # Last 100 lines
View Bash script tools

User Management Scripts

# Add new user
sudo bash scripts/add-user.sh [email protected]

# Delete user
sudo bash scripts/del-user.sh [email protected]

# List all users
sudo bash scripts/show-config.sh users

# Show user's share link
sudo bash scripts/show-config.sh link [email protected]

System Maintenance Scripts

# Update Xray to latest version
sudo bash scripts/update.sh

# Backup current configuration
sudo bash scripts/backup.sh

# Restore configuration
sudo bash scripts/restore.sh <backup-file>

# Uninstall Xray
sudo bash scripts/uninstall.sh

🗑️ Uninstall & Cleanup

One-Click Uninstall (Recommended)

Use the provided uninstall script to safely remove Xray:

# If you cloned the repository
sudo bash scripts/uninstall.sh

# If you don't have the repository, download the uninstall script
wget https://ghproxy.com/https://raw.githubusercontent.com/DanOps-1/Xray-VPN-OneClick/main/scripts/uninstall.sh
sudo bash uninstall.sh

Uninstall Process:

  1. Confirm uninstall: Type yes to confirm
  2. Choose whether to keep config backup:
    • Type Y or press Enter: Keep backup in /var/backups/xray/
    • Type n: Don't keep backup

Auto Cleanup:

  • ✅ Stop and disable Xray service
  • ✅ Backup configuration files (optional)
  • ✅ Uninstall Xray-core program
  • ✅ Remove config directory /usr/local/etc/xray
  • ✅ Remove log directory /var/log/xray
  • ✅ Remove systemd service files

Manual Cleanup

If the uninstall script doesn't work, manually execute these commands:

# 1. Stop and disable service
sudo systemctl stop xray
sudo systemctl disable xray

# 2. Backup configuration (optional)
sudo mkdir -p /var/backups/xray
sudo cp /usr/local/etc/xray/config.json /var/backups/xray/config-backup-$(date +%Y%m%d).json

# 3. Uninstall Xray using official script
bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ remove --purge

# 4. Remove residual files
sudo rm -rf /usr/local/etc/xray
sudo rm -rf /var/log/xray
sudo rm -f /etc/systemd/system/xray.service
sudo rm -f /etc/systemd/system/[email protected]
sudo systemctl daemon-reload

Complete Cleanup (Including Backups)

To completely remove all related files:

# Remove configuration backups
sudo rm -rf /var/backups/xray

# Remove project directory (if cloned)
rm -rf ~/Xray-VPN-OneClick

Verify Cleanup

After uninstall, run these commands to verify cleanup:

# Check service status (should show "could not be found")
systemctl status xray

# Check if program exists (should have no output)
which xray

# Check config directory (should not exist)
ls /usr/local/etc/xray

# Check port usage (port 443 should be free)
sudo lsof -i :443

📖 Documentation


🔒 Security Recommendations

Basic Security Measures

  1. ✅ Rotate keys regularly (every 3-6 months recommended)
  2. ✅ Use strong passwords or key authentication
  3. ✅ Configure firewall, only open necessary ports
  4. ✅ Keep Xray updated to latest version
  5. ✅ Regularly check logs and backup configuration
View advanced security configuration
# Restrict SSH access
sudo ufw allow 22/tcp
sudo ufw allow 443/tcp
sudo ufw enable

# Disable root login (recommended)
sudo nano /etc/ssh/sshd_config
# Set: PermitRootLogin no
sudo systemctl restart sshd

# Configure automatic security updates
sudo apt install unattended-upgrades
sudo dpkg-reconfigure --priority=low unattended-upgrades

📊 Supported Cloud Platforms

This project has been tested on the following cloud platforms:

View supported cloud platform list

International Cloud Platforms

  • ✅ AWS EC2, Google Cloud Platform, Microsoft Azure
  • ✅ DigitalOcean, Vultr, Linode, Hetzner

Chinese Cloud Platforms

  • ✅ Alibaba Cloud, Tencent Cloud, Huawei Cloud

Note: Using on Chinese cloud platforms may face compliance risks, please choose carefully.


💡 FAQ

1. Port 443 is already in use?

# Check which process is using the port
sudo lsof -i :443

# Stop the occupying service
sudo systemctl stop nginx  # or other service

# Or modify Xray config to use another port
sudo nano /usr/local/etc/xray/config.json

2. Client cannot connect?

Troubleshooting Steps:

  1. Confirm service is running: sudo systemctl status xray
  2. Check firewall rules: sudo ufw status
  3. Confirm cloud provider security group has opened port 443
  4. Verify configuration info is correct (UUID, public key, etc.)
  5. Check service logs: sudo journalctl -u xray -f

3. How to change the target camouflage website?

Edit config file /usr/local/etc/xray/config.json:

"dest": "www.cloudflare.com:443",
"serverNames": ["www.cloudflare.com"]

Recommended: www.microsoft.com, www.apple.com, www.cloudflare.com

4. How to improve connection speed?

# Enable BBR congestion control
echo "net.core.default_qdisc=fq" | sudo tee -a /etc/sysctl.conf
echo "net.ipv4.tcp_congestion_control=bbr" | sudo tee -a /etc/sysctl.conf
sudo sysctl -p

# Enable TCP Fast Open
echo "net.ipv4.tcp_fastopen=3" | sudo tee -a /etc/sysctl.conf
sudo sysctl -p

More questions: Complete FAQ List


🤝 Contributing

Issues and Pull Requests are welcome!

Contributing Process

  1. Fork this project to your account
  2. Create feature branch: git checkout -b feature/AmazingFeature
  3. Commit your changes: git commit -m 'Add some AmazingFeature'
  4. Push to branch: git push origin feature/AmazingFeature
  5. Submit Pull Request

Contribution Suggestions

  • 📝 Improve documentation and tutorials
  • 🐛 Fix bugs and issues
  • ✨ Add new features and tools
  • 🌍 Translate documentation to other languages
  • 📊 Optimize script performance

📝 Changelog

v1.6.0 (2026-01-15)

Auto-Enable Stats API

  • ✅ Auto-detect Stats API configuration status
  • ✅ One-click auto-configure Stats API (add stats/api/inbound/routing)
  • ✅ Auto-backup before configuration, auto-rollback on failure
  • ✅ Smart port detection, auto-select available port
  • ✅ Traffic quota menu adds "Configure Stats API" option
  • ✅ Auto-prompt configuration when viewing traffic details

v1.5.0 (2026-01-14)

Traffic Quota Management & UI Enhancement

  • ✅ Traffic quota management system - Allocate and manage user traffic quotas
  • ✅ Real-time traffic statistics - Get user traffic usage via Xray Stats API
  • ✅ Quota alert system - Yellow warning when approaching limit, red when exceeded
  • ✅ Auto-disable feature - Automatically disable users exceeding quota
  • ✅ Progress bar component - Visualize traffic usage percentage
  • ✅ Dashboard enhancement - Display traffic overview and user status statistics
  • ✅ Support preset quotas (1GB/5GB/10GB/50GB/100GB/Unlimited)
  • ✅ Support custom quotas (MB/GB/TB units)
  • ✅ Traffic reset and user re-enable functionality
  • ✅ Complete unit tests and integration tests
View historical versions

v1.4.1 (2026-01-12)

Bug Fix

  • ✅ Fix CLI unable to start interactive menu issue

v1.4.0 (2026-01-11)

Cross-Platform Support

  • ✅ Support more Linux distributions (CentOS Stream 9, AlmaLinux 9, Rocky Linux 9, Fedora 39)
  • ✅ Auto-detect package manager (apt/dnf)
  • ✅ Improved installation script compatibility

v1.3.0 (2026-01-10)

Config Management Enhancement

  • ✅ Config backup and restore functionality
  • ✅ Config item modification
  • ✅ Backup list management

v1.2.0 (2026-01-09)

Responsive Layout System

  • ✅ Terminal size adaptive layout (COMPACT/STANDARD/WIDE)
  • ✅ Multi-column display support for wide terminals
  • ✅ Compact mode for narrow terminals

v1.1.0 (2026-01-08)

CLI User Interface Optimization

  • ✅ Terminal capability auto-detection system (TTY/color/Unicode/width)
  • ✅ Smart icon resolver (Unicode ↔️ ASCII auto-adaptation)
  • ✅ Three output modes (RICH/PLAIN_TTY/PIPE)
  • ✅ Windows CMD fully compatible (pure ASCII text icons)
  • ✅ All emojis replaced with text labels [label] format
  • ✅ Clear menu grouping (Service Operations/Management Functions/Exit)
  • ✅ 80-column layout optimization (all UI element width verified)
  • ✅ 210 tests all passed, coverage >90%

v1.0.0 (2026-01-07)

Initial Release

  • ✅ Complete VLESS + XTLS-Reality configuration tutorial
  • ✅ Fully automated one-click installation script
  • ✅ User management tools (add, delete, list)
  • ✅ Service maintenance tools (update, backup, uninstall)
  • ✅ Detailed bilingual documentation
  • ✅ Multi-platform client configuration guides
  • ✅ Performance optimization and security hardening guides

📚 References

Official Documentation

Related Projects


📄 License

This project is licensed under the MIT License.

Important: Please read NOTICE - Terms of Use and Disclaimer before using

This means you can:

  • ✅ Freely use, copy, modify, and distribute this project
  • ✅ Use for commercial or non-commercial purposes (must comply with laws)
  • ✅ Freely modify under license terms

But you must:

  • ⚠️ Retain original author's copyright notice
  • ⚠️ Provide license copy
  • ⚠️ Comply with restrictions in NOTICE file

⚠️ Disclaimer

Important: This project is for educational and research purposes only.

Usage Restrictions

  • ✅ Allowed: Personal learning, technical research, legitimate corporate intranet, authorized security testing
  • ❌ Prohibited: Any violation of local laws, accessing illegal content, unauthorized commercial use

Legal Liability

  1. Using proxy technology requires compliance with local laws and regulations
  2. In some countries/regions (such as mainland China), unauthorized VPN use may be illegal
  3. Users must bear all legal consequences themselves
  4. The author is NOT responsible for any consequences arising from the use of this project
  5. Users should assess legal risks independently

Detailed Information

Must read before use: NOTICE - Complete Terms of Use and Disclaimer

If you do not agree with the terms or cannot ensure legal use, do NOT use this project.


💬 Get Help

How to Get Support

Issue Submission Guidelines

Please provide the following information in your issue:

  1. Your operating system and version
  2. Xray version number
  3. Detailed problem description and error messages
  4. Related configuration files (hide sensitive information)
  5. Solutions you've already tried

⭐ Star History


👥 Contributors

Thanks to all the people who have contributed to this project!


⭐ If this project helps you, please give it a Star!

🔄 Also welcome to Fork and share with friends!

Made with ❤️ by DanOps-1

Explore related projects

Loading…