How to Install 3X-UI on Ubuntu VPS (Complete Step-by-Step Guide)

If you want to manage an Xray server through a simple web interface, 3X-UI is one of the tools you can explore. It provides a web-based control panel for managing different proxy protocols, creating client configurations, monitoring traffic, and controlling server settings.

In this guide, you will learn how to install 3X-UI on an Ubuntu VPS, access its web panel, and complete some important initial security steps. Even if you are new to Linux servers, you can follow these instructions carefully.

Important: The 3X-UI project describes itself as intended for personal use and advises against using it in production environments. Review the project’s official warnings and documentation before deploying it. Do not use it for illegal activities.

What Is 3X-UI?

3X-UI is an open-source web control panel designed to manage Xray-core servers. Instead of configuring every server setting manually through terminal commands, users can manage many settings through a browser-based dashboard.

It supports multiple protocols and connection technologies, including:

  • VLESS
  • VMess
  • Trojan
  • Shadowsocks
  • WireGuard
  • Hysteria 2
  • HTTP and SOCKS
  • Different transport and security configurations, depending on compatibility

Some of its main features include client management, traffic statistics, subscription links, QR codes, expiry dates, and multi-server management.

3X-UI is a management panel, not a VPN provider by itself. You need a VPS and an appropriate server configuration to use it.

Requirements Before Installing 3X-UI

Before starting the installation, prepare the following:

RequirementDescription
VPSA Linux virtual private server
Operating SystemUbuntu 22.04 or a supported newer Ubuntu release
Root AccessRoot account or sudo privileges
InternetWorking internet connection
SSH ClientTerminal, PuTTY, or another SSH application
Server IPPublic IP address of your VPS

For a small personal test installation, a basic VPS may be sufficient. However, actual resource requirements depend on the number of clients, traffic, and server configuration.

You should also have access to your VPS provider’s firewall settings.

Step 1: Connect to Your Ubuntu VPS

First, connect to your VPS using SSH.

On Windows, you can use Windows Terminal, PowerShell, or PuTTY. On Linux and macOS, open the terminal.

Run this command:

ssh root@YOUR_SERVER_IP

Replace YOUR_SERVER_IP with your actual VPS IP address.

For example:

ssh root@192.0.2.10

The IP address above is only an example. Enter your real server address.

If your VPS uses a different SSH port or a non-root account, adjust the command accordingly.

After connecting, enter your password or authenticate using your SSH key.

Step 2: Update Ubuntu Packages

Before installing 3X-UI, update your Ubuntu package list and install available updates.

Run:

apt update && apt upgrade -y

Next, install the basic tools required for downloading the installer:

apt install -y curl ca-certificates

These packages help your server communicate securely with external repositories and download files.

If Ubuntu requests a restart after a system update, follow the appropriate restart procedure.

Step 3: Install 3X-UI on Ubuntu VPS

Now you are ready to install 3X-UI.

The official 3X-UI project provides an installation script. Run the following command:

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

This command downloads and executes the installer from the official project’s GitHub repository.

Security recommendation: Before executing any remote installation script, review its contents and make sure the source is the official project repository. You can also inspect the project’s installation documentation.

The installation process will guide you through the required setup.

Depending on the installer version, it may generate:

  • A panel username
  • A panel password
  • A custom web access path
  • A panel port and other settings

Important: Save the login details displayed after installation. Store them somewhere secure and do not share them publicly.

Step 4: Open the 3X-UI Management Menu

After installation, you can access the management menu by running:

x-ui

This command opens the 3X-UI management interface in your terminal.

Depending on the installed version, the menu provides options for managing the service, viewing or resetting login credentials, configuring SSL certificates, and performing other administrative tasks.

Follow the options displayed by your installed version.

Step 5: Check Whether 3X-UI Is Running

To check the service status, execute:

systemctl status x-ui

If the service is active, you should see an active status in the output.

You can also use these commands:

Start the service:

systemctl start x-ui

Stop the service:

systemctl stop x-ui

Restart the service:

systemctl restart x-ui

Enable automatic startup:

systemctl enable x-ui

These commands help you manage the panel service through Ubuntu’s systemd service manager.

Step 6: Access the 3X-UI Web Panel

Once the installation is complete and the service is running, open your browser.

Use the panel address and access path provided by the installer:

http://YOUR_SERVER_IP:YOUR_PANEL_PORT/YOUR_WEB_BASE_PATH

Replace the example values with your actual server IP, port, and web base path.

Enter the username and password generated during installation.

If the page does not open, check:

  1. Whether the 3X-UI service is running.
  2. Whether you entered the correct port.
  3. Whether the web base path is correct.
  4. Whether your VPS provider’s firewall allows the required connection.
  5. Whether Ubuntu’s firewall is blocking the panel port.

Do not assume the panel always uses the same port or URL path. Use the values shown by your installer.

Step 7: Configure Firewall Rules

Firewall configuration is important when running a service on a public VPS.

If you use UFW, first allow SSH access so that you do not accidentally lock yourself out:

ufw allow OpenSSH

If your SSH service uses a custom port, allow that port instead.

You can then allow the specific panel port selected during installation:

ufw allow YOUR_PANEL_PORT/tcp

Replace YOUR_PANEL_PORT with your actual panel port.

Enable UFW if it is not already enabled:

ufw enable

Check the firewall rules:

ufw status

You must also check your VPS provider’s cloud firewall or security group. Allow only the ports required for your setup.

For better security, restrict access to the administrative panel to your own trusted IP address whenever possible. Avoid exposing the management interface publicly without appropriate protection.

Step 8: Secure Your 3X-UI Panel

After installation, take time to secure your server.

Here are some important recommendations:

1. Use a strong password

Avoid simple passwords. Use a long, unique password that is not used on another website or service.

2. Protect the management interface

Use HTTPS with a properly configured certificate. Restrict panel access to trusted IP addresses or a private management network where possible.

3. Keep Ubuntu updated

Regularly install security updates:

apt update && apt upgrade -y

4. Protect SSH access

Use SSH keys where possible. Avoid unnecessary remote login access and maintain a reliable recovery method.

5. Back up your configuration

Keep secure backups of your panel database, server settings, and required certificates. Store backups somewhere separate from the VPS.

6. Use trusted software sources

Download updates and installation files only from the official project repository or its documented release channels.

Step 9: Create Your First Server Configuration

After logging into the dashboard, you can explore the available server configuration options.

The exact interface may vary between releases, but the general process involves:

  1. Open the Inbounds section.
  2. Select the option to add a new inbound.
  3. Choose a supported protocol.
  4. Configure the listening port and required settings.
  5. Configure the appropriate transport and security options.
  6. Add a client with its required authentication details.
  7. Save the configuration.
  8. Test the connection using a compatible client application.

For example, VLESS is one of the protocols supported by 3X-UI. However, remember that VLESS does not encrypt traffic by itself. A suitable security layer and compatible client/server configuration are necessary.

Do not copy random configurations from unknown websites. Incorrect settings can prevent connections from working or expose your server unnecessarily.

Common 3X-UI Installation Problems and Solutions

Sometimes the installation or login process does not work as expected. Here are a few common problems.

1. 3X-UI Web Panel Is Not Opening

Possible reasons include:

  • Incorrect panel port
  • Incorrect web base path
  • Firewall restrictions
  • Service not running

Check the service:

systemctl status x-ui

Also verify the port and access path shown by the installer.

2. Installation Command Is Not Working

Make sure your VPS has a working internet connection and that curl is installed:

apt install -y curl ca-certificates

Then check the official installation instructions and try again if appropriate.

3. Forgot 3X-UI Password

Run:

x-ui

Check the management menu for the credential reset option supported by your installed version.

4. 3X-UI Service Is Not Running

Restart the service:

systemctl restart x-ui

If the problem continues, inspect the logs:

journalctl -u x-ui -n 100 --no-pager

The output may help identify configuration errors or other service problems.

5. Firewall Is Blocking Connections

Check UFW:

ufw status

Also review your VPS provider’s firewall rules. Make sure you allow only the ports needed for your configuration.

How to Update 3X-UI

Keeping software updated is important for security and compatibility.

The official project documentation describes using its installer to update an existing installation. Before updating, make a backup of your panel data and configuration.

Review the latest instructions here:

https://github.com/MHSanaei/3x-ui

Follow the update procedure documented for your installed version. Avoid using development builds on a system where stability is important.

Is 3X-UI Free to Use?

3X-UI is an open-source project released under the GNU General Public License version 3 (GPL-3.0). Its source code is publicly available on GitHub.

However, running it on a VPS is not necessarily free. You may need to pay for:

  • VPS hosting
  • Domain registration
  • SSL or other certificate services, depending on your setup
  • Additional server resources

Always review the project’s licence and usage warnings before using it.

Conclusion

Installing 3X-UI on an Ubuntu VPS can be straightforward when you follow the official installation instructions. The process involves connecting to your server, updating Ubuntu, running the official installer, saving your login details, and checking the panel service.

After installation, pay particular attention to firewall configuration, panel access, passwords, HTTPS, and backups.

Remember that 3X-UI is a management panel for Xray-core, not a complete VPN service by itself. Its functionality depends on your VPS, server configuration, compatible clients, and supported protocols. Also review the upstream project’s personal-use warning before deciding how to deploy it.

Frequently Asked Questions (FAQs)

1. What is 3X-UI used for?

3X-UI is a web-based control panel for managing Xray-core servers. It supports client configuration, traffic monitoring, protocol management, and other server administration features.

2. Can I install 3X-UI on Ubuntu VPS?

Yes. The official project supports Ubuntu and provides an installation script for supported Linux systems.

3. Is 3X-UI free?

Yes. 3X-UI is open-source software under the GPL-3.0 licence. However, VPS hosting and other infrastructure services may cost money.

4. Does 3X-UI support VLESS?

Yes. VLESS is among the protocols supported by 3X-UI. The exact available options depend on the installed version and compatible Xray configuration.

5. How do I access the 3X-UI dashboard?

Open the panel URL using your VPS IP address, configured panel port, and web base path. Enter the login credentials generated during installation.

6. How can I restart 3X-UI?

Use this command:

systemctl restart x-ui

7. What should I do if I forget my 3X-UI password?

Run x-ui in your VPS terminal and use the credential-management options available in the installed version.

8. Is 3X-UI the same as Xray-core?

No. Xray-core is the underlying networking platform, while 3X-UI is a web-based panel used to manage it.

9. Can I use 3X-UI without a VPS?

A typical self-hosted installation requires a server or another supported environment. A VPS is a common way to run it.

10. Is 3X-UI suitable for production use?

The upstream project’s README says it is intended for personal use and advises against production deployment. Review the current official documentation and warnings before using it.