Configuring Trojan in 3X-UI with Xray

3X-UI Trojan setup guide for Xray. Learn how to configure inbound and outbound settings, DNS, TLS, and secure your VPS step by step.

Natasha M. 28 May 2026 4 min reading
Configuring Trojan in 3X-UI with Xray
Table of Contents

TL;DR

  • 3X-UI with Xray and Trojan helps you create a fast, secure, and block-resistant VPN with a user-friendly web management interface.
  • Step-by-step Trojan setup in 3X-UI from VPS preparation to establishing a secure connection.
  • Configure TLS 1.3, DNS, gRPC, and traffic obfuscation to improve privacy and bypass restrictions.
  • VPS security recommendations: firewall, SSH keys, secure panel access, and Xray-core updates.
  • Trojan troubleshooting for common connection issues, DNS, Reality keys, and client-server compatibility.

Anyone who has spent significant time with VPNs knows the potential problems with virtual servers: unstable connections, traffic restrictions, blocked protocols, and settings that resemble server-farm maintenance more than privacy protection.

DataReportal's global digital report claims that over 5.5 billion people worldwide use the internet. In some countries, over 30% of internet users rely on VPNs for secure communications and unrestricted access.

Traditional VPN solutions often struggle to balance speed, stealth, and ease of management, especially in regions with aggressive network filtering.

That's where 3X-UI with Xray-core and Trojan comes in.

3X-UI with Xray and Trojan: Beyond the Basic VPN

3X-UI is a powerful, easy-to-use web control panel designed to simplify the setup and operation of Xray and V2Ray servers. The panel supports various protocols, such as Trojan, VMess, VLESS, ShadowSocks, WireGuard, and others. 3X-UI offers an efficient way to manage, monitor, and deploy secure VPN or proxy solutions thanks to its comprehensive features and intuitive interface.

The main difference between 3X-UI and similar services lies in its advanced settings and enhanced data security.

Trojan is a traffic obfuscation protocol that uses the Xray core to ensure high speed and security, making a VPN connection appear like regular HTTPS traffic (web surfing). The 3X-UI control panel makes it easy to configure this protocol, hiding the fact that it bypasses blocking from ISPs.

In our guide, we offer a simple and straightforward way to configure Trojan on an Xray server using the 3X-UI control panel. No advanced administration experience is required. We'll cover every step, from panel installation to establishing a reliable and secure connection with state-of-the-art protection and obfuscation.

VPS

We handle setup, updates, and monitoring. You handle the project.

GET MANAGED VPS

Configuring Trojan in 3X-UI with Xray: A Step-by-Step Guide

Before running Trojan on your Xray server using the 3X-UI control panel, make sure your environment meets the following requirements. Good preparation will help avoid connection, compatibility, and security issues during setup.

So, let's get started.

Step 1: Buying a Server

The first step in installing and configuring the 3X-UI panel on your server is buying or renting the server.

Recommended system requirements:

  • OS: Debian 12 (default) or Ubuntu 24.04 (for self-configuration)
  • RAM: Minimum 2 GB
  • Virtualization: KVM
  • Network: IPv4 required
  • Pre-installed software: 3X-UI
  • Access to the server with root or sudo privileges
  • Open firewall ports for incoming connections
  • Access to the server via SSH
  • Access to public internet resources that support TLS 1.3
  • Correct DNS configuration pointing to your server's IP address

The article will use Ubuntu 24.04.

With its high performance and flexible management, is*hosting is an excellent solution for VPS rental. We offer both a clean VPS for self-configuration (the minimum Lite plan is sufficient) and a ready-to-use solution with the 3X-UI panel pre-installed. Once you have access to the service installed from the template, you can proceed to Step 4.

After ordering a server, you'll receive access information by email in the form:

Panel address: http://IP_address:PORT/
Server IP: 38.xxx.xxx.xxx
Root / xxxxxxxxxx
http://38.xxx.xxx.xxx:xxxx/
User = xxxxxxxx
Password = xxxxxxxx

Step 2: Initial Server Setup

This article will set up a new connection on Ubuntu 24.04 via one of the best, lightest, and most efficient protocols: the Trojan protocol. This protocol is used as a bridge between the client and the server.

To set up the server for installing 3X-UI, do the following:

  1. Open a command prompt by pressing the key combination "Ctrl+Alt+T" (Ubuntu).
  2. In the command prompt that appears, install the latest updates:
    sudo apt update
    sudo apt upgrade
  3. After installing the updates, reboot the device.
  4. To make sure that the necessary packages are installed on your server, enter the following command:
    apt-get install wget curl -y

Step 3: Installing the 3X-UI Panel

To install the 3X-UI panel, follow these steps:

  1. Run the installation script on the server:
    bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.sh)
  2. The script will ask the following question in the command line:
    Would you like to customize the Panel Port settings? (If not, a random port will be applied) [y/n]:
    To set the port yourself, answer "y". If you want the script to set the port automatically, answer "n".
  3. Next, specify the user password, the panel port (we recommend setting a non-standard one), and the web path to the panel site:
    Please set up your password: **********
    Your password will be: **********
    Please set up your panel port: ***
    Your panel port will be: ***
    Initializing, please wait...
  4. Congratulations! The panel has been installed successfully.

Step 4: Configuring 3X-UI Panel

To proceed with configuring 3X-UI, follow these steps:

  1. Connect to the panel via a browser using the link ipserver:port. In our case, the link looks like this: http://38.xxx.xxx.xxx:xxxx.
  2. After entering the address in the browser, a login window for the panel will appear where you must enter your username and password.
    Configuring 3X-UI Panel
  3. To configure the first connection, click the Inbounds tab in the side menu → Add Inbound.
    Add Inbound
  4. Configure the protocols in the window that appears; the remaining fields can be generated by clicking certain buttons:
    Note — connection name.
    ProtocolTrojan.
    IP Port — leave blank; the panel will automatically fill this field.
    Port — xxx.
    TransmissiongRPC.
    Security — select Reality (other fields will be filled automatically; for uTLS, Chrome is common, but most recommendations agree that you should specify Mozilla Firefox).
    Add Inbound 2
  5. Scroll down and click Get New Cert to generate a Public Key and Private Key.
  6. Enable Sniffing.
  7. Click Create.
    Get New Cert
  8. Congratulations! You have configured your first 3X-UI connection and your first client.
    You have configured your first 3X-UI connection
  9. Using the Menu, you can open the list and add new users, either individually or all at once.
    Add new users

Troubleshooting Common Problems

When setting up Trojan in 3X-UI, connection or configuration issues may occur. Most issues arise due to incorrect Reality settings, firewall restrictions, outdated versions of Xray-core, or incorrect DNS settings.

If the client is unable to connect, first ensure the following:

  • The Reality keys, UUID, port, and server IP address are specified correctly.
  • 3X-UI and Xray-core have been updated to the latest versions.
  • Firewall rules allow traffic on a specific port.
  • DNS records accurately specify the IP address of your VPS.
  • The target website supports the TLS 1.3 protocol.
  • The client configuration accurately matches the server settings.

After implementing changes, restarting the Xray service may help resolve temporary issues.

Recommended Security Measures

  • Regularly update Xray-core, 3X-UI, and the OS to the latest versions.
  • Disable unused ports and services.
  • Configure a firewall, such as UFW or iptables.
  • Use strong passwords or SSH keys.
  • Change the path to the 3X-UI panel and login credentials.
  • Avoid publicly sharing Reality keys or client configurations.

Regularly monitor server logs and connection activity to identify suspicious behavior or unauthorized access attempts.

Conclusion

Configuring Trojan in 3X-UI with Xray is an effective method for creating a fast, secure, and censorship-resistant VPN solution. With proper configuration, you can improve connection stability, enhance traffic obfuscation, and simplify server management using the user-friendly 3X-UI interface. This guide helps you create a reliable and secure VPS environment so you can communicate securely in your daily life.

VPS

Choose your perfect setup and enjoy everything a VPS can do.

See Plans