bolt Valebyte VPS from $4/mo — NVMe, 60s deploy.

Get a VPS arrow_forward

Set up 3x-ui on a VPS: Full Configuration & Monitoring

calendar_month September 06, 2026 schedule 21 min read visibility 17 views
person
Valebyte Team
Set up 3x-ui on a VPS: Full Configuration & Monitoring
summarize

TL;DR

  • A 3x-ui VPS needs minimum 1 vCPU, 1GB RAM, and 20GB NVMe disk.
  • Secure 3x-ui with HTTPS, change access paths, and set up firewalls.
  • Configure VLESS Reality clients with individual traffic limits and expiration dates.
  • Automate client disconnection on quota exceedance and receive Telegram notifications.
  • Implement automatic backups for your 3x-ui database and learn restoration.

To fully set up a 3x-ui panel on your VPS, including installation, securing with HTTPS, issuing VLESS Reality clients with individual traffic limits, and automatic backups, you will need a VPS with a minimum of 1 vCPU, 1 GB RAM, and 20 GB NVMe disk, along with executing the installation and configuration commands detailed below.

Over the past few months, we at Valebyte have observed an explosive growth in interest in private network connection technologies. Statistics show that impressions for queries related to such technologies have surged from 1.7k to 8.7k, and demand clearly outstrips current supply. Users are actively searching for reliable, self-managed solutions, and 3x-ui, deployed on your own VPS, is becoming one of the key tools for this. This panel provides a powerful and flexible interface for managing Xray-core, allowing you to create and control multiple users with different configurations, including the popular VLESS Reality.

In this in-depth guide, we won't just show you how to install 3x-ui on your server. We'll delve into practical aspects often overlooked in brief tutorials: from securing the panel with HTTPS and changing its access path to fine-tuning traffic limits and expiration dates for each user. You'll learn how to automatically disconnect clients upon quota exceedance, receive notifications via a Telegram bot, and how to regularly back up your 3x-ui database and restore it if necessary. We will also cover optimal VPS specifications for various workloads and key security aspects to keep your 3x-ui panel protected.

Why is 3x-ui popular, and do you need a VPS for it?

The relevance of private and secure network connections is growing daily. Users are increasingly looking for ways to ensure data confidentiality, bypass geo-restrictions, and gain stable access to information. In this context, Xray-core based solutions, managed through user-friendly panels like 3x-ui, are becoming highly sought after. The increase in search queries and cluster impressions we mentioned confirms this trend: people are actively searching for how to deploy their own servers.

Using your own VPS for 3x-ui offers several undeniable advantages over public services:

  • Full Control: You have complete control over the server, its configuration, and traffic, without relying on third-party providers.
  • High Performance: By choosing a Valebyte VPS with NVMe disks and high-speed channels, you ensure minimal latency and maximum speed for yourself and your users.
  • Flexible Configuration: 3x-ui offers extensive options for fine-tuning protocols, ports, routing rules, and limits.
  • Security: You control all security aspects, from OS selection to firewall setup and panel obfuscation.
  • Long-term Savings: For a large number of users or high traffic volume, your own VPS can be significantly more cost-effective than subscriptions to commercial VPN services.

3x-ui allows you not only to manage a single connection but also to issue multiple 3x-ui users, controlling their access and resource consumption. This makes it an ideal solution for small teams, families, or even for providing access to friends and acquaintances.

How to Install 3x-ui Panel on Your VPS: A Quick Start Guide

Before you begin configuring 3x-ui, you need to prepare your VPS. Ensure you have SSH root access to your server and a clean operating system installed. We recommend using Debian 10/11/12 or Ubuntu 20.04/22.04 LTS for maximum stability and compatibility.

VPS Preparation and Dependency Installation

The first step is always to update your system and install basic utilities that may be needed during the process. Connect to your VPS via SSH and execute the following commands:

sudo apt update && sudo apt upgrade -y
sudo apt install -y curl wget unzip net-tools

These commands will update the package list, install all available updates, and add the curl, wget, unzip, and net-tools utilities, which are frequently used for file downloads and network diagnostics.

Deploying the 3x-ui Panel

For 3x-ui panel installation, a convenient script automates the process. Execute the following command:

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

The script will prompt you to choose an Xray-core version for installation. In most cases, you can select the recommended version. After the installation is complete, the panel will be accessible at http://YOUR_VPS_IP_ADDRESS:2053. The default login and password are: admin / admin. Be sure to change them immediately after your first login!

To manage the 3x-ui service, you can use standard systemctl commands:

  • Start: systemctl start 3x-ui
  • Stop: systemctl stop 3x-ui
  • Restart: systemctl restart 3x-ui
  • Check status: systemctl status 3x-ui

After successful installation and your first login, you will see the panel's main interface, where you can start creating and managing connections.

Looking for a reliable server for your projects?

VPS from $10/month and dedicated servers from $9/month with NVMe, DDoS protection, and 24/7 support.

View offers →

Securing Your 3x-ui Panel: HTTPS, Port, and Path Obfuscation

Leaving your 3x-ui panel on the default port 2053 and without HTTPS encryption is a serious risk. Any port scanner can discover your panel, and transmitting credentials over an unencrypted channel makes them vulnerable to interception. We strongly recommend following these steps to ensure security.

Configuring HTTPS for Panel Access

To secure access to your 3x-ui panel with HTTPS, you'll need a domain name pointed to your VPS's IP address and a web server like Nginx or Caddy to act as a reverse proxy and handle SSL certificates. We'll demonstrate with Nginx and Let's Encrypt.

1. Install Nginx and Certbot:

sudo apt install -y nginx certbot python3-certbot-nginx

2. Create an Nginx configuration file for your domain (e.g., /etc/nginx/sites-available/yourdomain.conf):

sudo nano /etc/nginx/sites-available/yourdomain.conf

Add the following content, replacing yourdomain.com with your domain and YOUR_VPS_IP with your VPS's IP address:

server {
    listen 80;
    listen [::]:80;
    server_name yourdomain.com;

    location / {
        proxy_pass http://127.0.0.1:2053; # Or the port 3x-ui is running on
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

3. Activate the configuration and check its syntax:

sudo ln -s /etc/nginx/sites-available/yourdomain.com /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx

4. Obtain an SSL certificate from Let's Encrypt using Certbot:

sudo certbot --nginx -d yourdomain.com

Follow Certbot's instructions. It will automatically modify your Nginx configuration to use HTTPS. After this, your panel will be accessible at https://yourdomain.com.

Changing the 3x-ui Panel Port and Access Path

Even with HTTPS, open access to the panel via a domain might be undesirable. You can change the port 3x-ui listens on and/or add a secret path for access. To change the port and path within the 3x-ui panel itself:

  1. Log in to the 3x-ui panel.
  2. Navigate to the "Settings" section.
  3. In the "Panel Port" field, change 2053 to any other number, for example, 45678.
  4. In the "Panel Path" field, specify a secret path, for example, /admin_secret_path_123.
  5. Click "Save".

After this, you will need to update your Nginx configuration to proxy requests to the new port and path:

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name yourdomain.com;

    ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;
    include /etc/letsencrypt/options-ssl-nginx.conf;
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;

    location /admin_secret_path_123 { # Your new secret path
        proxy_pass http://127.0.0.1:45678; # Your new 3x-ui panel port
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

server {
    listen 80;
    listen [::]:80;
    server_name yourdomain.com;
    return 301 https://$host$request_uri;
}

Restart Nginx: sudo systemctl reload nginx. Now, the panel will only be accessible at https://yourdomain.com/admin_secret_path_123, significantly enhancing its security. Remember why the panel should not be kept on the default port and exposed to the internet: it makes it an easy target for automated attacks and scanning.

Quick pick
Need a dedicated server?
Bare metal with NVMe in 70+ locations — configure and order in minutes.
Browse servers

Creating VLESS Reality Inbounds: Issuing Clients and Subscriptions

One of the key features of 3x-ui is the ability to quickly create and manage Inbound connections, which serve as entry points for your clients. We will focus on configuring VLESS Reality, which provides high performance and traffic masquerading.

Configuring VLESS Reality with TLS and XTLS-rPRX

VLESS Reality is a powerful protocol that uses TLS encryption and traffic masquerading under legitimate traffic to avoid detection. To configure it, follow these steps in the 3x-ui panel:

  1. In the 3x-ui panel, navigate to the "Inbounds" section.
  2. Click the "Add Inbound" button.
  3. Fill in the fields:
    • Protocol: Select VLESS.
    • Port: Specify any free port, for example, 443 (if not occupied by Nginx), or 8443.
    • Remark: Give it a descriptive name, for example, VLESS_Reality_Main.
    • Users: Here you can add multiple 3x-ui users, but for now, we'll keep one.
  4. Go to "TLS Settings" and enable "Flow", selecting xtls-rprx-vision for optimal performance.
  5. Enable "Reality" and fill in the following fields:
    • Dest (Destination): Specify the IP address or domain of a legitimate website under which traffic will be masked, for example, www.google.com:443.
    • Xver (Xray Version): Leave as default.
    • Server Names: Specify the domain names to be used as SNI, for example, www.microsoft.com,www.apple.com.
    • Keys: Generate a new key by clicking the "Generate" button.
    • Short IDs: Generate new short IDs.
  6. Click "Create".

After creating the Inbound, you will be able to get the connection link (URL) for each client. Click the QR code or link icon next to the created Inbound and copy the configuration for the client.

Managing Multiple 3x-ui Users and Subscriptions

3x-ui allows you to efficiently manage multiple users, assigning individual settings and limits to each. This is especially useful if you provide access to different people or want to segment traffic.

Adding users to an existing Inbound:

  1. In the "Inbounds" section, find your VLESS Reality Inbound and click the "Edit" button.
  2. In the "Users" section, click "Add User".
  3. For each new user, specify:
    • Remark: User's name (e.g., "Client_John").
    • UUID: Generate a new UUID or use an existing one.
  4. Click "Save".

Each added user will receive their unique connection link, which can be copied and provided to the client. The panel also supports creating subscription files, which simplifies distributing configurations for a large number of clients. Simply click the "Subscription" icon for your Inbound, and you will get a URL that clients can use in their applications to automatically retrieve configurations.

Efficient Traffic Management: 3x-ui Traffic Limits and Automation

Managing resource consumption is a critically important aspect when working with a VPS and multiple users. 3x-ui provides powerful tools for setting limits and automating actions, which helps prevent traffic overages and maintain server stability.

Setting Traffic Limits and Expiry Times

For each user in 3x-ui, you can set individual traffic volume limits and account expiry times. This is especially useful if you manage access for different user groups or offer temporary subscriptions.

How to set limits:

  1. In the 3x-ui panel, navigate to the "Inbounds" section.
  2. Click "Edit" next to the Inbound for which you want to configure limits.
  3. In the "Users" section, click "Edit" next to the specific user.
  4. You will see the fields:
    • Traffic Limit: Enter the maximum traffic volume (in GB) that the user can consume. For example, 50 for 50 GB.
    • Expiry Time: Specify the date and time after which the user's account will be disabled. Date format: YYYY-MM-DD HH:MM:SS.
  5. Click "Update".

When a user reaches their traffic limit or their account expires, their connection will be automatically terminated. This is an excellent way to control resource consumption and align with your VPS traffic-limited plans. You can learn more about configuring limits and quotas in our article "User Limits and Quotas in 3x-ui and Marzban: How to Stay Within Your Plan".

Notifications and Automatic Disconnection via 3x-ui Telegram Bot

3x-ui provides the ability to receive notifications about important events, such as traffic limit overages, via a Telegram bot. This allows you to react promptly to changes and inform users.

Configuring the Telegram Bot:

  1. Create your bot in Telegram via @BotFather. Obtain the API token.
  2. Find your Chat ID. You can send a message to @userinfobot, and it will show your Chat ID.
  3. In the 3x-ui panel, navigate to the "Settings" section.
  4. Scroll down to the "Telegram Bot" section.
  5. Enable "Telegram Bot".
  6. In the "Telegram Bot Token" field, paste the API token obtained from @BotFather.
  7. In the "Telegram Chat ID" field, paste your Chat ID.
  8. Click "Save".

After configuration, the 3x-ui Telegram bot will send you notifications about traffic limit overages, account expirations, and other important events. This significantly simplifies monitoring and managing your panel.

Reliability and Recovery: 3x-ui Backup and Migration

Your 3x-ui panel data, including Inbound configurations, user information, and limits, is stored in an SQLite database. Regularly backing up this database is critically important to ensure reliability and the ability to quickly recover in case of failures or migration needs.

Regular 3x-ui Database Backup

The 3x-ui database is typically located at /etc/x-ui/x-ui.db (for older versions) or /opt/3x-ui/db/3x-ui.db (for newer versions installed via script). Make sure you know the exact path to your database.

Let's create a simple script for automatic backup:

#!/bin/bash

# Путь к базе данных 3x-ui
DB_PATH="/opt/3x-ui/db/3x-ui.db" # Verify this path!

# Директория для хранения бэкапов
BACKUP_DIR="/var/backups/3x-ui"

# Имя файла бэкапа с датой
BACKUP_FILE="${BACKUP_DIR}/3x-ui_backup_$(date +%Y%m%d_%H%M%S).db"

# Количество дней, в течение которых хранить бэкапы
RETENTION_DAYS=7

# Создаем директорию для бэкапов, если она не существует
mkdir -p "$BACKUP_DIR"

echo "Starting 3x-ui database backup..."

# Останавливаем сервис 3x-ui для обеспечения целостности бэкапа
systemctl stop 3x-ui

# Копируем базу данных
cp "$DB_PATH" "$BACKUP_FILE"

# Запускаем сервис 3x-ui обратно
systemctl start 3x-ui

# Проверяем успешность копирования
if [ $? -eq 0 ]; then
    echo "Backup successfully created: $BACKUP_FILE"
else
    echo "Error creating backup."
fi

# Удаляем старые бэкапы
find "$BACKUP_DIR" -type f -name "3x-ui_backup_*.db" -mtime +"$RETENTION_DAYS" -delete
echo "Old backups deleted (older than ${RETENTION_DAYS} days)."

Save this script, for example, as /usr/local/bin/backup_3x-ui.sh, make it executable (chmod +x /usr/local/bin/backup_3x-ui.sh), and add it to your cron scheduler for regular execution (e.g., daily):

sudo crontab -e

Add the line for daily backup at 3:00 AM:

0 3 * * * /usr/local/bin/backup_3x-ui.sh >> /var/log/3x-ui_backup.log 2>&1

Restoring the Panel from a Backup

If you need to restore 3x-ui from a backup (e.g., after a failure or migration to a new VPS), follow these steps:

  1. Stop the 3x-ui service:
    systemctl stop 3x-ui
  2. Move the existing (corrupted) database or create a backup of it:
    mv /opt/3x-ui/db/3x-ui.db /opt/3x-ui/db/3x-ui.db.old
    (Again, verify the path to your database!)
  3. Copy the backup file to the database directory and rename it to 3x-ui.db:
    cp /var/backups/3x-ui/3x-ui_backup_YYYYMMDD_HHMMSS.db /opt/3x-ui/db/3x-ui.db
    (Replace YYYYMMDD_HHMMSS with your backup file's name.)
  4. Ensure the database file permissions are correct (usually 3x-ui:3x-ui or root:root, depending on the installation):
    chown 3x-ui:3x-ui /opt/3x-ui/db/3x-ui.db
    chmod 600 /opt/3x-ui/db/3x-ui.db
  5. Start the 3x-ui service:
    systemctl start 3x-ui

After this, your 3x-ui panel should start with the data from the backup. This is a reliable method to ensure operational continuity and preserve your configurations. More detailed instructions on backup and migration can be found in our article "Updating Xray-core and the Panel on a VPS Without Losing Users".

Quick pick
Need a dedicated server?
Bare metal with NVMe in 70+ locations — configure and order in minutes.
Browse servers

Choosing the Optimal VPS for 3x-ui: Workload-Based Specifications

Choosing the right VPS for 3x-ui depends on the anticipated workload: the number of active users, the volume of traffic generated, and speed requirements. While 3x-ui and Xray-core are quite efficient, a certain level of resources is necessary for stable operation.

For 50 concurrent users, 4 vCPU, 8 GB RAM, and an 80 GB NVMe disk are sufficient.

Clients vCPU RAM Disk Port Speed Price (approx., Valebyte.com, July 2024)
up to 10 1-2 1-2 GB 20-40 GB NVMe 1 Gbps from $5/month
up to 50 2-4 4-8 GB 40-80 GB NVMe 1 Gbps from $10/month
up to 200 4-8 8-16 GB 80-160 GB NVMe 10 Gbps from $25/month
200+ 8+ 16+ GB 160+ GB NVMe 10 Gbps from $50/month

Explanation of Specifications:

  • vCPU: For a small number of users (up to 10-20), 1-2 vCPUs are sufficient. When the number of clients increases to 50-200 and active traffic processing is involved, especially with protocols like Reality, 4-8 vCPUs are recommended.
  • RAM: 3x-ui itself doesn't consume much RAM, but Xray-core and the operating system require a certain amount. 1-2 GB is enough for initial configurations. For 50+ clients with active traffic, it's better to aim for 4-8 GB RAM.
  • Disk: The disk type is important. NVMe SSDs significantly outperform regular SSDs and HDDs in read/write speeds, which is critical for stable Xray-core operation. 20-40 GB is sufficient for the system and the 3x-ui database, but if you plan to store logs or other data, consider 80 GB or more.
  • Network Port: For one or two users, a 1 Gbps channel is more than sufficient. For 50+ active clients, especially if they will consume large volumes of traffic, a 10 Gbps port will be preferable to prevent bottlenecks.
  • VPS Location: Choose a data center located as close as possible to your end-users to minimize latency (ping). Valebyte offers VPS in various locations, allowing for optimized routing.

Always start with a smaller plan and scale resources as your load grows. Valebyte offers flexible pricing plans that allow you to easily upgrade your VPS to a more powerful configuration without service interruptions.

Frequently Asked Questions

Can I use 3x-ui on a home computer?

Theoretically yes, but it is not recommended for stable and secure operation. Home computers often have dynamic IP addresses, limited bandwidth, lack a persistent internet connection, and insufficient protection against external threats. A VPS provides a stable static IP, high speed, reliability, and professional protection, which is critically important for a 3x-ui server.

What is the difference between 3x-ui and X-UI?

3x-ui is a fork or an improved version of the original X-UI panel. It includes numerous bug fixes, security enhancements, new features, and more active community support. If you are choosing a panel to manage Xray-core, 3x-ui is the more current and preferred option, offering capabilities such as more advanced Reality settings and an improved Telegram bot.

Which protocol is best to choose for 3x-ui?

For maximum stealth and resistance to blocking, VLESS Reality is recommended in most cases. It uses sophisticated traffic masquerading under legitimate TLS connections, making it highly effective. However, for less demanding scenarios or in regions with low censorship, VMess or Trojan can also be considered, as they are simpler to configure and can be quite performant.

How can I ensure maximum security for 3x-ui?

In addition to HTTPS and changing the panel's port/path, for maximum security, it is recommended to regularly update 3x-ui and Xray-core, use strong passwords, configure a firewall (e.g., UFW) to allow access only to necessary ports, and periodically check server logs for suspicious activity. Using two-factor authentication for VPS access will also significantly enhance security.

Can 3x-ui be migrated to another VPS?

Yes, migrating 3x-ui to another VPS is possible. To do this, you need to back up the 3x-ui.db database from the old server, install 3x-ui on the new VPS, copy the database file there, and restore it. It's also important to transfer any Nginx configurations (if used) and ensure that domain names point to the new IP address. This process is described in detail in our article on 3x-ui backup and migration.

Conclusion

3x-ui on your own Valebyte VPS provides a powerful and flexible tool for creating and managing private network connections. By following this in-depth guide, you will not only be able to perform 3x-ui panel installation but also secure it with HTTPS, configure VLESS Reality Inbounds, efficiently manage 3x-ui traffic limits for each of your multiple 3x-ui users, receive notifications via the 3x-ui Telegram bot, and set up automatic 3x-ui backups. Choosing the correct VPS configuration for your workload will ensure stability and high performance.

Start with a basic Valebyte plan of 2 vCPU, 4 GB RAM, and a 40 GB NVMe disk, then scale resources as your needs grow to always have reliable and fast access to your panel and services.

SSD NVMe
Ready to launch your VPS?

NVMe VPS with 60-second activation: full root access, 20+ locations, pay with card or crypto.

Choose a plan
support_agent
Valebyte Support
Usually replies within minutes
Hi there!
Send us a message and we'll reply as soon as possible.