---
title: Configuring Trojan in 3X-UI with Xray
description: 3X-UI Trojan setup guide for Xray. Learn how to configure inbound and outbound settings, DNS, TLS, and secure your VPS step by step.
image: https://blog.ishosting.com/hubfs/3x-ui-trojan-setup/trojan.png
---

<https://ishosting.com/en>

[VPS](https://ishosting.com/en/vps) [Dedicated hosting](https://ishosting.com/en/dedicated) [VPN](https://ishosting.com/en/vpn) [Storage](https://ishosting.com/en/storage) [About us](https://ishosting.com/en/about)

[Client area](https://my.ishosting.com/en/account)

[is\*hosting Blog](https://blog.ishosting.com/en)

- [News](https://blog.ishosting.com/en/tag/news)
- [VPS](https://blog.ishosting.com/en/tag/vps)
- [Hosting](https://blog.ishosting.com/en/tag/hosting)
- [Technology](https://blog.ishosting.com/en/tag/technology)
- [is\*ai](https://blog.ishosting.com/en/tag/isai)
- Other 
    - [Marketing](https://blog.ishosting.com/en/tag/marketing)
    - [Security](https://blog.ishosting.com/en/tag/security)

[News](https://blog.ishosting.com/en/tag/news)

 Categories

[Search](https://blog.ishosting.com/hs-search-results)

 Hosting Services

[About Us](https://ishosting.com/en/about)

[Client Area](https://my.ishosting.com/en/account)

[News](https://blog.ishosting.com/en/tag/news) [VPS](https://blog.ishosting.com/en/tag/vps) [Hosting](https://blog.ishosting.com/en/tag/hosting) [Technology](https://blog.ishosting.com/en/tag/technology) [is\*ai](https://blog.ishosting.com/en/tag/isai) [Marketing](https://blog.ishosting.com/en/tag/marketing) [Security](https://blog.ishosting.com/en/tag/security)

[VPS](https://ishosting.com/en/vps) [Dedicated hosting](https://ishosting.com/en/dedicated) [VPN](https://ishosting.com/en/vpn) [Storage](https://ishosting.com/en/storage)

1. [Blog](https://blog.ishosting.com/en)
2. [How to](https://blog.ishosting.com/en/tag/how-to)
3. Configuring Trojan in 3X-UI with Xray

How to

# 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.](https://blog.ishosting.com/en/author/natasha-m) 28 May 2026 4 min reading

![Configuring Trojan in 3X-UI with Xray](https://blog.ishosting.com/hubfs/3x-ui-trojan-setup/trojan.png)

Table of Contents

- [Introduction](https://blog.ishosting.com/en/3x-ui-trojan-setup#introduction)
- [3X-UI with Xray and Trojan: Beyond the Basic VPN](https://blog.ishosting.com/en/3x-ui-trojan-setup#beyond-basic-vpn)
- [Configuring Trojan in 3X-UI with Xray: A Step-by-Step Guide](https://blog.ishosting.com/en/3x-ui-trojan-setup#step-by-step-guide)
- [Troubleshooting Common Problems](https://blog.ishosting.com/en/3x-ui-trojan-setup#troubleshooting)
- [Recommended Security Measures](https://blog.ishosting.com/en/3x-ui-trojan-setup#security-measures)
- [Conclusion](https://blog.ishosting.com/en/3x-ui-trojan-setup#conclusion)

## 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](https://datareportal.com/reports/digital-2025-global-overview-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](https://ishosting.com/en/vps/managed-server)

## 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](https://ishosting.com/en) 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](https://ishosting.com/en/vpn) 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](https://blog.ishosting.com/hs-fs/hubfs/3x-ui-trojan-setup/1Configuring%203X-UI%20Panel.png?width=367&height=452&name=1Configuring%203X-UI%20Panel.png)
3. To configure the first connection, click the **Inbounds** tab in the side menu → **Add Inbound**.  
   ![Add Inbound](https://blog.ishosting.com/hs-fs/hubfs/3x-ui-trojan-setup/2Add%20Inbound.png?width=1918&height=452&name=2Add%20Inbound.png)
4. Configure the protocols in the window that appears; the remaining fields can be generated by clicking certain buttons:  
   **Note** — connection name.  
   **Protocol** — **Trojan**.  
   **IP Port** — leave blank; the panel will automatically fill this field.  
   **Port** — xxx.  
   **Transmission** — **gRPC**.  
   **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](https://blog.ishosting.com/hs-fs/hubfs/3x-ui-trojan-setup/3Add%20Inbound.png?width=502&height=909&name=3Add%20Inbound.png)
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](https://blog.ishosting.com/hs-fs/hubfs/3x-ui-trojan-setup/4Get%20New%20Cert.png?width=509&height=885&name=4Get%20New%20Cert.png)
8. Congratulations! You have configured your first 3X-UI connection and your first client.  
   ![You have configured your first 3X-UI connection](https://blog.ishosting.com/hs-fs/hubfs/3x-ui-trojan-setup/5You%20have%20configured%20your%20first%203X-UI%20connection.png?width=1914&height=435&name=5You%20have%20configured%20your%20first%203X-UI%20connection.png)
9. Using the **Menu**, you can open the list and add new users, either individually or all at once.  
   ![Add new users](https://blog.ishosting.com/hs-fs/hubfs/3x-ui-trojan-setup/7add%20new%20users.png?width=1916&height=738&name=7add%20new%20users.png)

## 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](https://ishosting.com/en/vps)

Table of Contents

- [Introduction](https://blog.ishosting.com/en/3x-ui-trojan-setup#introduction)
- [3X-UI with Xray and Trojan: Beyond the Basic VPN](https://blog.ishosting.com/en/3x-ui-trojan-setup#beyond-basic-vpn)
- [Configuring Trojan in 3X-UI with Xray: A Step-by-Step Guide](https://blog.ishosting.com/en/3x-ui-trojan-setup#step-by-step-guide)
- [Troubleshooting Common Problems](https://blog.ishosting.com/en/3x-ui-trojan-setup#troubleshooting)
- [Recommended Security Measures](https://blog.ishosting.com/en/3x-ui-trojan-setup#security-measures)
- [Conclusion](https://blog.ishosting.com/en/3x-ui-trojan-setup#conclusion)

<http://www.facebook.com/share.php?u=https%3A%2F%2Fblog.ishosting.com%2Fen%2F3x-ui-trojan-setup%3Futm_medium%3Dsocial%26utm_source%3Dfacebook> <https://twitter.com/intent/tweet?original_referer=https%3A%2F%2Fblog.ishosting.com%2Fen%2F3x-ui-trojan-setup%3Futm_medium%3Dsocial%26utm_source%3Dtwitter&url=https%3A%2F%2Fblog.ishosting.com%2Fen%2F3x-ui-trojan-setup%3Futm_medium%3Dsocial%26utm_source%3Dtwitter&source=tweetbutton&text=> <http://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fblog.ishosting.com%2Fen%2F3x-ui-trojan-setup%3Futm_medium%3Dsocial%26utm_source%3Dlinkedin> <http://pinterest.com/pin/create/button/?url=https%3A%2F%2Fblog.ishosting.com%2Fen%2F3x-ui-trojan-setup%3Futm_medium%3Dsocial%26utm_source%3Dpinterest&media=https%3A%2F%2F25913237.fs1.hubspotusercontent-eu1.net%2Fhubfs%2F25913237%2F3x-ui-trojan-setup%2Ftrojan.png&description=3X-UI%20Trojan%20setup%20guide%20for%20Xray.%20Learn%20how%20to%20configure%20inbound%20and%20outbound%20settings,%20DNS,%20TLS,%20and%20secure%20your%20VPS%20step%20by%20step.>

## Related articles

![Clawdbot with Docker and Ollama: Self-Hosted AI Stack Guide](https://blog.ishosting.com/hubfs/blog/clawdbot-with-docker-and-ollama-on-vps/clawdbot-with-docker-and-ollama-on-vps.png)

How to

### Clawdbot with Docker and Ollama: Self-Hosted AI Stack Guide

Build your own private AI stack on a VPS! Learn how to deploy Clawdbot with Docker and Ollama in this complete,...

is\*hosting team 4 Jun 2026 5 min reading 

<https://blog.ishosting.com/en/clawdbot-with-docker-and-ollama-on-vps>

![How to Set up a Linux VPS: a Step-by-step User Guide](https://blog.ishosting.com/hubfs/blog/how-to-set-up-linux-vps/configuring-linux.png)

VPS

### How to Set up a Linux VPS: a Step-by-step User Guide

A complete Linux VPS setup guide for beginners: connect via SSH, create users, configure a firewall, enable...

Natasha M. 25 Jun 2024 9 min reading 

<https://blog.ishosting.com/en/how-to-set-up-linux-vps>

![Keitaro on VPS: A Complete Setup Guide for Self-Hosted Ad Tracking](https://blog.ishosting.com/hubfs/blog/keitaro-on-vps/keitaro-on-vps.png)

How to

### Keitaro on VPS: A Complete Setup Guide for Self-Hosted Ad Tracking

Step-by-step guide to installing Keitaro (a self-hosted ad tracker) on a VPS. Covers CentOS 9, server sizing by click...

is\*hosting team 14 Jul 2026 7 min reading 

<https://blog.ishosting.com/en/keitaro-on-vps>

## Subscribe to Newsletter

The latest news, profitable discounts, and informative articles - subscribe to the is\*hosting blog and be the first to receive a useful newsletter.

- **Services**
  
  Services
  
  
  
  
  
    - [Virtual Private Servers](https://ishosting.com/en/vps)
    - [Dedicated Servers](https://ishosting.com/en/dedicated)
    - [Storage](https://ishosting.com/en/storage)
    - [VPN](https://ishosting.com/en/vpn)
    - [Special Offers](https://ishosting.com/en/special-offers)
- ---
- **Company**
  
  Company
  
  
  
  
  
    - [About Us](https://ishosting.com/en/about)
    - [Data Centers](https://ishosting.com/en/datacenters)
    - [Blog](https://blog.ishosting.com/en)
    - [Contacts](https://ishosting.com/en/about#offices)
- ---
- **Information**
  
  Information
  
  
  
  
  
    - [Knowledge Base](https://help.ishosting.com/en)
    - [Support](https://ishosting.com/en/support)
    - [Payments Methods](https://ishosting.com/en/payment-methods)
- ---
- **Account**
  
  Account
  
  
  
  
  
    - [Create Account](https://my.ishosting.com/en/register)

---

<https://ishosting.com> © 2026

 WEBRAIN OÜ, Harju maakond, Tallinn, Kesklinna linnaosa, Endla tn 4, 10142

<https://www.facebook.com/ishostingcom> <https://twitter.com/ishostingcom> <https://www.instagram.com/is.hosting> <https://www.linkedin.com/company/is-hosting> <https://www.youtube.com/@ishosting> <https://www.pinterest.com/ishostingcom>

- [![](https://blog.ishosting.com/hs-fs/hubfs/raw_assets/public/ishosting-theme/images/rating-sm.png?width=328&height=70&name=rating-sm.png) ![](https://blog.ishosting.com/hs-fs/hubfs/raw_assets/public/ishosting-theme/images/rating.png?width=421&height=70&name=rating.png)](https://hostadvice.com/hosting-company/ishosting-reviews/#main-info)

---

- [Terms of Use](https://ishosting.com/en/terms-of-use)
- [Privacy Policy](https://ishosting.com/en/privacy-policy)
- [KYC Policy](https://ishosting.com/en/kyc-policy)
- [SLA](https://ishosting.com/en/service-level-agreement)
- [AUP](https://ishosting.com/en/acceptable-use-policy)
- en
  
    - [en](https://blog.ishosting.com/en)
    - [ru](https://blog.ishosting.com/ru/3x-ui-trojan-setup)

```json
{
  "@context" : "https://schema.org",
  "@type" : "BlogPosting",
  "abstract" : "3X-UI Trojan setup guide for Xray. Learn how to configure inbound and outbound settings, DNS, TLS, and secure your VPS step by step.",
  "alternativeHeadline" : "Configuring Trojan in 3X-UI with Xray",
  "articleSection" : "How to",
  "author" : {
    "@type" : "Organization",
    "name" : "Natasha M.",
    "sameAs" : [ "https://www.linkedin.com/company/is-hosting", "https://twitter.com/ishostingcom", "https://www.instagram.com/is.hosting" ],
    "url" : "https://blog.ishosting.com/en/author/natasha-m"
  },
  "dateModified" : "2026-05-29T08:34:42.000Z",
  "datePublished" : "2026-05-28T08:00:00.000Z",
  "description" : "3X-UI Trojan setup guide for Xray. Learn how to configure inbound and outbound settings, DNS, TLS, and secure your VPS step by step.",
  "headline" : "Configuring Trojan in 3X-UI with Xray",
  "image" : [ {
    "@type" : "ImageObject",
    "height" : 1348,
    "name" : "Configuring Trojan in 3X-UI with Xray",
    "url" : "https://25913237.fs1.hubspotusercontent-eu1.net/hubfs/25913237/3x-ui-trojan-setup/trojan.png",
    "width" : 2396
  } ],
  "inLanguage" : "en",
  "mainEntityOfPage" : {
    "@id" : "https://blog.ishosting.com/en/3x-ui-trojan-setup",
    "@type" : "WebPage"
  },
  "publisher" : {
    "@type" : "Organization",
    "address" : [ {
      "@type" : "PostalAddress",
      "addressCountry" : "EE",
      "addressLocality" : "Tallinn",
      "addressRegion" : "Harju maakond",
      "postalCode" : "10120",
      "streetAddress" : "Kesklinna linnaosa, Tuukri tn 19-315"
    }, {
      "@type" : "PostalAddress",
      "addressCountry" : "GB",
      "addressLocality" : "London",
      "addressRegion" : "England",
      "postalCode" : "W1W 7LT",
      "streetAddress" : "85 Great Portland Street, First Floor"
    } ],
    "description" : "is*hosting is an IaaS provider since 2005. We provide VPS, VPN, dedicated servers and data storage to help you achieve your biggest dreams.",
    "email" : "sales@ishosting.com",
    "foundingDate" : "2005",
    "legalName" : "WEBRAIN OÜ",
    "logo" : {
      "@type" : "ImageObject",
      "height" : 26,
      "url" : "https://help.ishosting.com/hubfs/logo-ishosting.png",
      "width" : 138
    },
    "name" : "is*hosting"
  },
  "thumbnailUrl" : "https://25913237.fs1.hubspotusercontent-eu1.net/hubfs/25913237/3x-ui-trojan-setup/trojan.png",
  "timeRequired" : "PT4M",
  "url" : "https://blog.ishosting.com/en/3x-ui-trojan-setup",
  "wordCount" : 1405
}
```

```json
{
  "@context" : "https://schema.org",
  "@type" : "BreadcrumbList",
  "itemListElement" : [ {
    "@type" : "ListItem",
    "item" : "https://blog.ishosting.com/en",
    "name" : "Blog",
    "position" : 1
  }, {
    "@type" : "ListItem",
    "item" : "https://blog.ishosting.com/en/tag/how-to",
    "name" : "How to",
    "position" : 2
  }, {
    "@type" : "ListItem",
    "item" : "https://blog.ishosting.com/en/3x-ui-trojan-setup",
    "name" : "Configuring Trojan in 3X-UI with Xray",
    "position" : 3
  } ]
}
```

```json
{
  "@context" : "https://schema.org",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "Natasha M.",
    "url" : "https://blog.ishosting.com/en/author/natasha-m"
  },
  "dateModified" : "2026-05-29T08:34:42.085Z",
  "datePublished" : "2026-05-28T08:00:00.000Z",
  "headline" : "Configuring Trojan in 3X-UI with Xray",
  "image" : [ "https://blog.ishosting.com/hubfs/3x-ui-trojan-setup/trojan.png" ],
  "mainEntityOfPage" : {
    "@id" : "https://blog.ishosting.com/en/3x-ui-trojan-setup",
    "@type" : "WebPage"
  },
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "url" : "https://blog.ishosting.com/hubfs/logo-ishosting.png"
    },
    "name" : "WEBRAIN OÜ"
  }
}
```