SS Safe Surf Lab
3x-uixrayvless

VPN with 3x-ui: What It Is and How to Set It Up Safely

Learn what the 3x-ui panel is, how it runs your own Xray-based VPN on a VPS, how to install it the official way, and how to lock it down before you use it.

SS Safe Surf Lab team · · 6 min read · 6 sources
Churchill Club Top 10 Tech Tech Trends Debate 2013 — I chose Deep Learning / Machine Learning
Photo: jurvetson (CC BY 2.0) via Openverse

When people search “vpn 3x-ui”, they are usually looking for a way to run their own VPN-style proxy server with 3x-ui, a free, open-source web panel that manages Xray-core on a VPS. You install 3x-ui on a server with one official command, create an “inbound” (for example VLESS with REALITY) in its browser dashboard, and then connect from your phone or computer with a compatible client app using a QR code or share link.

That is the short version. Below is what 3x-ui actually is, how it differs from a commercial VPN, how to install it the official way, and the security steps worth doing before you rely on it. Details reflect the project as of November 2026, and this project moves quickly, so check the official README before you install.

What 3x-ui is (and isn’t)

3x-ui is a web control panel for Xray-core. The project README describes it as an enhanced fork of the original X-UI panel, built for setups ranging from a single VPS to multiple nodes. It is licensed under GPL-3.0.

Xray-core itself comes from Project X (XTLS). It is a proxy tool forked from v2fly-core, and its own GitHub README lists 3X-UI in its “Web Panel” section alongside alternatives such as Marzban, Hiddify and Remnawave.

So 3x-ui is not a VPN service and not a client app. It is the server half: you rent a server, run 3x-ui on it, and it gives you a dashboard to create users, protocols and share links instead of hand-editing Xray JSON files.

Supported protocols

According to the README, 3x-ui currently supports:

  • VLESS, VMess, Trojan and Shadowsocks
  • WireGuard and AmneziaWG
  • TUIC v5 and Hysteria2
  • MTProto, HTTP, SOCKS (Mixed), Dokodemo-door/Tunnel and TUN

Useful features

  • Per-client traffic quotas, expiry dates, IP limits and device (HWID) limits
  • Share links, QR codes and a built-in subscription server
  • Traffic statistics per inbound, client and outbound
  • Outbound routing rules (including WARP), load balancers and multi-node management
  • Telegram and Discord bots, plus a REST API with scoped tokens
  • SQLite by default, with PostgreSQL as an option

3x-ui vs a commercial VPN

Self-hosted with 3x-uiCommercial VPN service
Who runs the serverYouThe provider
CostFree software, you pay for the VPSSubscription
Server locationsWherever you rent a VPSProvider’s network
Maintenance and security updatesYour jobProvider’s job
Protocol choiceWide (VLESS, REALITY, Trojan, WireGuard, Hysteria2 and more)Whatever the provider offers
Shared IP with other usersNo, the IP is yoursUsually yes

The trade-off is simple: you get control and protocols designed to blend in with normal HTTPS traffic, but you take on the job of a server admin. Your traffic also exits from a single IP that is tied to your VPS account, which is different from the privacy model of a large shared-IP VPN.

The project’s own README says it is “intended for personal use only” and should not be used for illegal purposes or in a production environment. Take that at face value.

Before you start

You need:

  1. A VPS running a supported OS. The README lists Ubuntu, Debian, Fedora, CentOS, RHEL, AlmaLinux, Rocky Linux, Oracle Linux, Amazon Linux, Arch, openSUSE, Alpine and others, plus Windows, on architectures including amd64 and arm64.
  2. Root or sudo access over SSH.
  3. curl installed (the installer is fetched with it).
  4. Optionally, a domain if you want HTTPS for the panel with your own hostname.

How to install 3x-ui (official method)

The installation wiki lists the one-line installer as the recommended method. Only use the script from the official mhsanaei/3x-ui repository; many forks exist on GitHub, and you have no reason to trust them.

  1. SSH into your server as root (or use sudo).

  2. Make sure curl is installed.

  3. Run the official installer:

    bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.sh)
    
  4. Finish the prompts. According to the install script itself, it generates a random username, password and web base path, picks a random free panel port (or lets you set one), and asks how to handle SSL: a Let’s Encrypt certificate for a domain, a short-lived Let’s Encrypt certificate for an IP address, your own certificate files, or no SSL (optionally bound to 127.0.0.1 so you reach the panel through an SSH tunnel or reverse proxy). Write the credentials down; the script also saves them to /etc/x-ui/install-result.env with root-only permissions.

  5. Open the panel in your browser at http://<your-server-ip>:<port>/<path>, using the port and path the installer showed you.

  6. If you lose the details, run x-ui on the server. That opens the management menu, where you can view or reset credentials, start and stop the service, and manage SSL certificates.

The README notes you can pass a version tag to install a specific release, and that release assets ship with SHA-256 checksums the installer and updater verify.

Docker alternative

The wiki also documents a Docker Compose setup using the ghcr.io/mhsanaei/3x-ui:latest image, started with docker compose up -d. In that setup the panel is published on port 2053, and inbound proxy ports are not exposed automatically: add each one to ports, or use host networking. The wiki lists admin/admin as the Docker default login, while the v3.11.0 release notes say fresh databases now get a random first admin credential. Check what your install actually uses and change it straight away.

Creating your first connection

Once you are logged in, the general flow is:

  1. Go to Inbounds and add a new inbound.
  2. Choose a protocol. VLESS with REALITY security is a common choice because, according to the REALITY repository, it needs no domain or certificate of your own and presents a genuine TLS session for the SNI you pick.
  3. Pick a port and save.
  4. Add a client to the inbound, set any traffic or expiry limits, and open its share link or QR code.
  5. Import that link or QR code into a client app that supports the protocol.

REALITY settings worth understanding

The REALITY project sets out a few rules that matter when you fill in the panel fields:

  • Target (dest) site: should be a foreign website that supports TLS 1.3 and HTTP/2 and does not redirect elsewhere. A site whose IP is close to your server can look more natural and lower latency.
  • serverNames (SNI): the client’s server name must match one entry. Wildcards are not supported.
  • shortIds: hex characters only, even length, up to 16 characters. An empty value is allowed.
  • Flow: if the server uses xtls-rprx-vision, the client must enable XTLS too.
  • Don’t pair REALITY with non-XTLS protocols. The developers say those combinations have a known TLS-in-TLS signature.

Lock it down

The installation wiki lists these steps, and they are worth doing on day one:

  1. Change the default credentials under Panel Settings > Authentication.
  2. Enable two-factor authentication.
  3. Use a custom panel web path rather than a guessable one.
  4. Keep Fail2ban enabled for IP-limit enforcement. In Docker it needs the NET_ADMIN and NET_RAW capabilities.
  5. Publish only the ports you need instead of opening everything.
  6. Stay updated. The releases page shows frequent security fixes. As of early November 2026 the latest stable release is v3.11.0 (October 25), which bundles Xray-core v26.10.21. Recent releases also sandboxed the systemd service (v3.10.0) and fixed a log-path check bypass (v3.8.0).

Avoid the rolling dev-latest build unless you are testing. The releases page labels it “Not a stable release.”

Our take

If you are comfortable with a Linux server and want protocols that a typical VPN app doesn’t offer, 3x-ui is the most widely used way to run Xray without editing config files by hand. If you would rather not patch servers, rotate credentials and watch release notes, a well-audited commercial VPN is the lower-effort option. Either way, install only from the official repository and treat the panel login like any other admin account.

Frequently asked questions

Is 3x-ui a VPN app I can install on my phone? +

No. 3x-ui is a server-side web panel that you install on a Linux (or Windows) server. You then connect to that server with a separate client app that supports protocols like VLESS, Trojan or WireGuard, usually by scanning a QR code or importing a share link from the panel.

Is 3x-ui free? +

Yes. The panel is open source under the GPL-3.0 licence, and the underlying Xray-core is licensed under MPL-2.0. You still pay for the server (VPS) it runs on.

Do I need a domain name to use 3x-ui? +

Not necessarily. The REALITY protocol from the Xray project is designed to work without your own domain or certificate, because it borrows the TLS handshake of an existing website. You will want a domain and certificate if you prefer to reach the panel itself over HTTPS with your own hostname.

What is the default 3x-ui login? +

The one-line installer generates a random username, password and web path, which you can view or reset later by running x-ui. The project wiki lists admin/admin for the Docker setup, while the v3.11.0 release notes say fresh databases now get a random first admin credential, so check what your install shows and change it immediately either way.

Is 3x-ui safe to use? +

It is a popular, actively maintained open-source project, and recent releases include a steady stream of security fixes. The developers themselves describe it as intended for personal use and not for production, so keep it updated, change credentials, enable two-factor authentication and expose only the ports you need.

Sources

  1. MHSanaei/3x-ui: An Advanced Web Panel Built on Xray Core (GitHub) (github.com)
  2. 3x-ui Wiki: Installation (github.com)
  3. 3x-ui official install.sh script (raw.githubusercontent.com)
  4. 3x-ui Releases (github.com)
  5. XTLS/Xray-core (GitHub) (github.com)
  6. XTLS/REALITY (GitHub) (github.com)
About this guide. Researched and drafted with AI assistance from the sources above, then checked against our editorial rules. It reflects what was publicly known on November 6, 2026; details can change, so confirm with the official source before acting on it. How we work →

Our reviews

In-depth reviews from Safe Surf Lab that go with this topic.

Keep reading