Skip to main content

How to install and set up luci-app-xray on OpenWRT?

Prerequisite: Installing the terminal

💡

Easy installation via the web interface

luci-app-ttyd can be installed directly from the OpenWRT web interface, which makes the whole setup much easier.

1

Go to System → Software

Open the router's web interface and go to the System tab, then select Software

System Software
2

Update the package list

Click the "Update lists" button to refresh the list of available packages

Update lists
3

Install luci-app-ttyd

Find the luci-app-ttyd package via search and install it

Install ttyd

Installing dependencies

1

Open the terminal

Go to Services → Terminal in the router's web interface

Open Terminal
2

Install git and curl

Run the command to install the required packages:

opkg install git-http git curl
Install git and curl
3

Install geodata for v2ray

Update the package list and install geodata:

opkg update && opkg install v2ray-geoip v2ray-geosite
Install geodata

Installing luci-app-xray

1

Download files from the release

Run the command to download the latest release:

curl -s https://api.github.com/repos/Torinomii/luci-app-xray/releases/latest | grep -o 'https://[^"]*\.ipk' | while read url; do curl -LO "$url"; done

Files can also be downloaded manually from GitHub

Download release
2

Install the downloaded packages

Run the install commands:

opkg update
opkg install *.ipk
3

Reboot the router

You must reboot the router for the changes to take effect:

reboot

Done!

After rebooting, a new menu item Xray will appear

Xray menu

Configuring Xray

1

Get the VLESS key

Go to the bot → SubscriptionVLESS Key and copy your link

2

Generate a config

Open the XKeen Config Generator and paste your VLESS link

Config Generator
3

Add a server in Xray

Click the "Add" button in the Xray Servers section

Add Server
4

Transfer the settings from the generator

Copy the data from the config generator into the corresponding Xray settings fields

Transfer Settings
5

Fill in Transport Settings

Go to the next tab and fill in the transport settings

Transport Settings
6

Save and activate

Enable Enable Xray Service, select the server in TCP/UDP Server, and click "Save & Apply"

Enable and Save
7

Configure LAN Hosts Access Control

Go to the LAN Hosts Access Control tab and select the devices to route traffic for

LAN Access Control

We also recommend