Skip to content

YerdosNar/3x-ui-auto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

60 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ 3X-UI Auto Installer

Automated one-liner installer for 3X-UI panel with Docker, Caddy reverse proxy, smart firewall, and network optimization.

✨ Features

  • 🐳 Docker & Docker Compose - Automatic installation and configuration
  • πŸ”’ Caddy Reverse Proxy - HTTPS with automatic SSL certificates
  • πŸ›‘οΈ Smart Firewall (UFW) - Auto-detects and opens required ports
  • ⚑ Network Optimization - BBR congestion control for 20-30x faster speeds
  • 🎯 Smart Port Detection - Never locks you out of SSH
  • πŸ”§ Automatic Configuration - 3X-UI panel ready to use
  • πŸ“Š Multiple Installations - Support for multiple 3X-UI instances

πŸš€ Quick Start

One-Liner Installation

bash <(curl -Ls https://raw.githubusercontent.com/YerdosNar/3x-ui-auto/master/install.sh)

Modular Installation (Recommended)

bash <(curl -Ls https://raw.githubusercontent.com/YerdosNar/3x-ui-auto/master/modular/install.sh)

With Logging (for troubleshooting)

bash <(curl -Ls https://raw.githubusercontent.com/YerdosNar/3x-ui-auto/master/custom_logs.sh)

⚠️ Requires sudo privileges and Ubuntu/Debian system


πŸ“‹ What Gets Installed

Core Components

  1. Docker & Docker Compose - Container runtime
  2. 3X-UI Panel - Web-based VPN/proxy management
  3. Caddy (Optional) - HTTPS reverse proxy with auto SSL

Optional Enhancements

  1. UFW Firewall - Smart port management and security
  2. Network Optimization - BBR congestion control and TCP tuning

🎯 Installation Process

The installer will guide you through:

  1. Domain Setup - Enter your domain or use IP address
  2. Caddy Configuration (if domain provided)
    • Admin credentials
    • Route path (e.g., /admin)
    • API and backend ports
  3. Network Optimization - Apply BBR and TCP tuning (recommended)
  4. Firewall Setup - Configure UFW with smart port detection (recommended)

🌐 Access Your Panel

After installation:

Setup Type URL Default Login
With Domain https://yourdomain.com/admin Your custom credentials
Without Domain http://YOUR_IP:2053 admin / admin

⚠️ Change default credentials immediately if not using Caddy!


πŸ›‘οΈ Firewall & Network Features

Smart Firewall (UFW)

  • βœ… Auto-detects SSH port (never locks you out!)
  • βœ… Opens required ports: HTTP (80), HTTPS (443), 3X-UI (2053)
  • βœ… Configures port ranges for VPN inbounds (8380-8400, 9380-9400)
  • βœ… Enables IP forwarding for proxy functionality

Network Optimization

  • ⚑ BBR Congestion Control - 20-30x faster speeds
  • πŸ“¦ Fair Queue Scheduling - Reduced latency
  • πŸ’Ύ 64MB TCP Buffers - Better throughput
  • πŸš€ TCP Fast Open - Faster connections

Performance: Shadowsocks/VLESS speeds improved from 5 Mbps to 150-170 Mbps!

πŸ“– Details: See Firewall & Network Guide


πŸ”§ Useful Commands

Docker Management

cd ~/3x-uiPANEL*
docker compose up -d        # Start
docker compose down         # Stop
docker compose restart      # Restart
docker compose logs -f      # View logs

Caddy Management

sudo systemctl status caddy    # Check status
sudo systemctl restart caddy   # Restart
sudo caddy validate            # Test config

Firewall Management

sudo ufw status               # View rules
sudo ufw allow 9000/tcp       # Open port
sudo ufw delete allow 9000    # Close port

Network Check

sysctl net.ipv4.tcp_congestion_control  # Check BBR
sysctl net.core.default_qdisc           # Check queue

πŸ—‘οΈ Uninstallation

Remove Single Installation

# Interactive - choose which installation to remove
bash <(curl -Ls https://raw.githubusercontent.com/YerdosNar/3x-ui-auto/master/uninstall.sh)

# Or specify directory number
bash <(curl -Ls https://raw.githubusercontent.com/YerdosNar/3x-ui-auto/master/uninstall.sh) -d 1

List All Installations

bash <(curl -Ls https://raw.githubusercontent.com/YerdosNar/3x-ui-auto/master/uninstall.sh) -l

πŸ“– Details: See Uninstall Guide


πŸ“š Documentation


πŸ—‚οΈ Directory Structure

3x-ui-auto/
β”œβ”€β”€ one_liner.sh           # Standalone installer
β”œβ”€β”€ custom_logs.sh         # Installer with logging
β”œβ”€β”€ uninstall.sh          # Uninstaller with smart detection
β”œβ”€β”€ modular/              # Modular installer
β”‚   β”œβ”€β”€ install.sh        # Main entry point
β”‚   β”œβ”€β”€ functions/        # Function modules
β”‚   β”‚   β”œβ”€β”€ logger.sh
β”‚   β”‚   β”œβ”€β”€ docker.sh
β”‚   β”‚   β”œβ”€β”€ caddy.sh
β”‚   β”‚   β”œβ”€β”€ firewall.sh           # Smart UFW management
β”‚   β”‚   β”œβ”€β”€ network_optimization.sh  # BBR + TCP tuning
β”‚   β”‚   └── ...
β”‚   └── md_files/         # Documentation
└── README.md             # This file

βš™οΈ Requirements

  • OS: Ubuntu 20.04+ or Debian 10+
  • Access: Root or sudo privileges
  • Network: Internet connection
  • Kernel: 4.9+ (for BBR support)

πŸ” Troubleshooting

Docker Permission Issues

newgrp docker
# Or logout and login again

Port Conflicts

Check if ports are in use:

sudo lsof -i :2053
sudo lsof -i :443

Firewall Locked Out

Access via VPS console and run:

sudo ufw disable
# Or
sudo ufw allow 22/tcp

BBR Not Enabled

Check kernel version:

uname -r  # Should be 4.9+

For more troubleshooting, see the documentation section.


πŸ’‘ Tips

  • βœ… Use a domain for HTTPS and better security
  • βœ… Enable network optimization for 20-30x faster speeds
  • βœ… Configure firewall for security
  • βœ… Change default credentials if not using Caddy
  • βœ… Regular backups of ~/3x-uiPANEL*/db/ directory

🀝 Contributing

Contributions welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Submit a pull request

πŸ§‘β€πŸ’» Author

Yerdos Narzhigitov πŸ“¦ GitHub: @YerdosNar


πŸͺͺ License

This project is released under the GPL-v3 License (Same as the 3X-UI project)


πŸ“– Related Projects


πŸ’¬ Feedback and pull requests are welcome!

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages