Notes

Part 1, the noob guide on 3x-ui install for Vless/Hysteria2 proxy services on a cheap VPS

Note

If you already have 3x-ui already installed and just go to this setup guide for Vless and/or Hysteria2 proxy services with 3x-ui.

Installing 3x-ui on a VPS for Vless/Reality and Hysteria2 proxy protocols


While I wrote this a guide for installing 3x-ui on really cheap VPS(like 1 vcpu, 1GB RAM, 15GB storage), it doesn't stop anyone from using it for a VPS that has more cpu cores, memory, or storage. I highly recommend selecting Debian 13 from the Linux distro to use for the VPS. As it will use up both least about of RAM and storage.

NOTE

Some VPS providers will only have Debian 12 on their order page, you will have go into their web control panel and select reinstall OS to see Debian 13 as an option. But I also have seen couple of providers still have only Debian 12 in their reinstall option, but Debian 12 will still work for this guide.

VPS Providers


While you can find cheap VPS on LowEndBox.com, as low as US$1/month, I highly recommend getting the ones that cost US$3 to $5/month. There are some real good VPS deals posted over at LowEndTalk.com/categories/offers, like the ones from HostDare, EthernetServers, SoftShellWeb, RareCloud, and etc.

Note

Because I'm China and I mainly access Internet services in the US, so most of my VPSs located at datacenters in the west coast of the US. It's pointless to get one in the east coast, as it will increase the ping latency when you try access it from China. So most of the VPS hosting providers will have their west coast VPS hosted at data centers in Los Angeles, so you most likely end up getting one hosted there.

Optional: Domain Name for the VPS


After the host provider setup your VPS, you should use a domain for your VPS. Using a domain name will mask the proxy traffic and also you need it if planning to use free Cloudflare CDN to high behind it.

I won't go into detail on buying a domain nor creating a DNS record for VPS as there many guides online how to do them. I just register my domain at Cloudflare, as using their free CDN service requires that your domain's DNS servers are controlled by them. If you have already registered your domain with another registrar, you don't have to move your domain to Cloudflare, you just need to point the DNS servers over to their servers.

Note

Your VPS provider will give you an IP4 address for the VPS once it has been setup. Create an A record with the IP address on the DNS server like www.example.com or if you're planning to use multiple servers, lax1.example.com.

Setting up your VPS


SSH into your VPS with your ssh client. On Windows, you use ssh command built-in Command Prompt(cmd.exe). But you should use PuTTY or better yet, MobaXterm. As those 2 program can save profile for each of your VPS.

Attention

You should setup a SSH key pairing for the VPS with ssh-ed25519 and disable password login all together, as that will stop most intruders from trying to guess your login password. There are many guides on how to set that up on the Internet, try doing that first.

Next, update and upgrade system with apt command.

apt update
apt upgrade -y

Installing 3x-ui

Now we ready install 3x-ui using a simple install script from the Github repo.

Note

As writing of this guide, the latest version of 3x-ui is 3.6.0. So couple of new features have added, including support Hysteria2 protocol and chose use of SQLite or ProgresSQL for config storage.

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

It's going to use apt to install any software packages that it will require that not already installed on the VPS.

Database

The 1st chose is the selection of database for the saving all configs for 3x-ui. Use the default [1] for SQLite.

Control Panel Port

The 2nd chose to select the port number for the Web Control Panel. Just type [n] for a random port number.

Note

If you don't want to use a random port number, make sure the port number you will use is between 1024 and 65535, preferably a five digit number. With multiple VPS running 3x-ui, I like using the same port number on all them.

SSL cert

The 3rd chose is setting up SSL for the Web Control Panel and proxy protocol that will use it.

  • Select [1], if you have a domain name and assign the IP address to a hostname for the VPS.
  • Select [2], if you don't have domain name. As this will use IP address for the signed SSL cert.
  • Select [3], if you already setup a signed SSL cert on the VPS.
  • Select [4], only if the VPS is behind a reverse proxy or planning to a SSH tunnel to it.

Assuming you select 1 or 2, will request a new SSL from Let's Encypt for your hostname or IP address. It will either ask for the hostname(lax.example.com) or confirm the IPv4 and IPv6(leave empty, if none), and finally press [Enter] to use default port 80 to connect to Let's Encrypt.

If it ask Would you like to modify --reloadcmd for ACME?, just type [n] for no. As the default setting should automatically renew the SSL cert when it expires. Then it will ask Would you like to set this certificate for the panel?, type [y] for yes, so your browser won't complain when you try access the Web Control Panel.

When the script finish installing, it should display the URL of the Web Control Panel along the username and password. Just scroll up a bit, as it might have scroll by the text for the installation of fail2ban at the end.

Important

You can run the CLI 3x-ui menu like typing x-ui. There are ton of options that who go into. The one is [11] View Current Settings, as will show the current Web Control Panel URL, username, and password. Most of the options can be done with the Web Control Panel. If you mess up and like to start over again, just select [6] Uninstall option and then run the install script again.

3x-ui Web Control Panel


Config the 3x-ui Web Control Panel

Once you paste the URL in your favorite browser then type in the username and password, the first do is select the Panel Settings -> Subscription then disable Subscription Service and [Save] the change. If you, friends, and/or family members are the only ones going to use the proxy services, then you don't need service to be active.

Optional, you can change other settings in the Panel Settings sub-menus like the URI path in General and username/password in Authorization. Make sure to [Restart Panel], if you make any changes to those settings.

Next, on to Part 2 of this guide with creation the different setups of Inbounds and clients with 3-xui