DanOps-1/Xray-VPN-OneClick
About
🚀 5分钟部署 VLESS+Reality VPN | 访问 ChatGPT/Claude/Google | npm CLI 管理工具 | One-Click Xray Server with Traffic Stats | 科学上网 翻墙 梯子 魔法
Systems & InfrastructureMeasured 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 | 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
⚡ 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
- 🌐 Use Cases
- 🎯 Key Features
- 🆚 Protocol Comparison
- 🚀 Quick Start
- 🛠️ Service Management
- 📱 Client Configuration
- 🗑️ Uninstall & Cleanup
- 💡 FAQ
- 📖 Documentation
- 🤝 Contributing
- 📄 License
✨ 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
|
🔒 Privacy & Security
|
💼 Remote Work
|
🎓 Academic Research
|
👨💻 Developer Tools
|
🌍 Content Access
|
🎯 Key Features
🚀 Deployment Features
|
🔒 Security Features
|
🛠️ Management Features
|
📱 Client Features
|
🆚 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
|
Recommended Configuration
|
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
|
Method 2: Accelerated Install
|
Method 3: Clone Repository
|
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)
- Copy the VLESS share link from installation output
- Open client application
- Select "Import from Clipboard" or "Scan QR Code"
- 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-managerto 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:
- Confirm uninstall: Type
yesto confirm - Choose whether to keep config backup:
- Type
Yor press Enter: Keep backup in/var/backups/xray/ - Type
n: Don't keep backup
- Type
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
- Complete Installation Guide - Detailed manual installation steps
- Client Setup Guide - Platform-specific client configuration
- User Management Guide - How to add, delete, and manage users
- Open Source Review Guide - Generate open source maturity report
- FAQ - Troubleshooting and solutions
- Performance Optimization - Tips to improve server performance
🔒 Security Recommendations
Basic Security Measures
- ✅ Rotate keys regularly (every 3-6 months recommended)
- ✅ Use strong passwords or key authentication
- ✅ Configure firewall, only open necessary ports
- ✅ Keep Xray updated to latest version
- ✅ 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:
- Confirm service is running:
sudo systemctl status xray - Check firewall rules:
sudo ufw status - Confirm cloud provider security group has opened port 443
- Verify configuration info is correct (UUID, public key, etc.)
- 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
- Fork this project to your account
- Create feature branch:
git checkout -b feature/AmazingFeature - Commit your changes:
git commit -m 'Add some AmazingFeature' - Push to branch:
git push origin feature/AmazingFeature - 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
- Xray Official Website
- VLESS Protocol Specification
- Reality Protocol Introduction
- Xray-core Source Code
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
- Using proxy technology requires compliance with local laws and regulations
- In some countries/regions (such as mainland China), unauthorized VPN use may be illegal
- Users must bear all legal consequences themselves
- The author is NOT responsible for any consequences arising from the use of this project
- 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
- 📧 Submit Issue: GitHub Issues
- 💡 FAQ: Check FAQ Documentation
- 📖 Read Docs: Complete Installation and Configuration Tutorial
- 🔍 Search Existing Issues: Search before asking if same issue exists
Issue Submission Guidelines
Please provide the following information in your issue:
- Your operating system and version
- Xray version number
- Detailed problem description and error messages
- Related configuration files (hide sensitive information)
- 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…