3X-UI on Railway
Deploy a full proxy panel on Railway — no VPS required.
Docker + Nginx + TCP Proxy · One public port.
About the Project
3X-Ui-on-railway runs the 3X-UI panel with Docker on Railway — no VPS and no dedicated server required. Nginx sits in front of the panel and manages all web traffic (panel, subscription link, and WS/HTTPUpgrade inbounds) from a single public address on port 443.
For protocols that require direct TCP (Reality, xHTTP, gRPC),
Railway TCP Proxy on port 8080 is
used.
Why this structure?
Railway web services only expose ports 80/443 publicly. With Nginx, 50 inbounds sit behind one address, and for direct traffic, a separate TCP Proxy connects to the core.
Join the Telegram channel for news and tutorials: @ayhandeveloper
Features
| Feature | Description |
|---|---|
| 3X-UI v3.12.0 | Official and up-to-date 3X-UI version |
| Nginx Reverse Proxy | Manages routes and web protocols behind a single port |
| Railway TCP Proxy |
Direct path on port 8080 for Reality / xHTTP /
gRPC
|
| 50 inbound routes |
From /in1 (internal port 8001) to
/in50 (internal port 8050)
|
| WS and HTTPUpgrade | Full support on internal ports 8001 to 8050 |
| TCP Reality and xHTTP | Direct support on port 8080 |
| Panel and Subscription |
/managepanel/ path for the panel and
/sub/ for the subscription link
|
| Real IP behind CDN | Detects the user's real IP; works only with a personal domain behind a CDN |
Quick Start
- Fork the repository.
- Create a new project on Railway and click Deploy from GitHub repo.
- Select your forked repository and wait for the build to finish.
-
From Settings › Networking, generate a domain
(Generate Domain) and set its port to
3000. -
Open the panel:
https://your-app.up.railway.app/managepanel/ -
Log in with the default credentials and
change them right now:
Field Default Value Username adminPassword admin
The panel is public with the default password.
Anyone who knows the address can log in. Before creating any config, change the username and password in Panel Settings.
Architecture & Route Map
Route Map
| Route / Port | Internal Destination | Purpose |
|---|---|---|
/managepanel/ |
127.0.0.1:3000 |
3X-UI management dashboard |
/sub/ |
127.0.0.1:2096 |
Retrieve client subscription link |
/in1 to /in50 |
127.0.0.1:8001 to 8050 |
WS / HTTPUpgrade inbounds via Nginx |
| Port 8080 | 127.0.0.1:8080 |
Direct inbound via Railway TCP Proxy |
Inbound Setup Guide
1. Routes /in1 to
/in50 (WS / HTTPUpgrade)
For the 50 inbounds behind Nginx (internal ports
8001 to 8050):
-
Transport:
WebSocketorHTTPUpgrade -
Security in panel:
must be
none(TLS is handled by the Railway/CDN layer) -
Path:
/in1for port 8001,/in2for 8002, and so on -
Host settings (the
Add Host button in the panel):
-
Address / Host: Railway domain, e.g.
your-app.up.railway.app - Port:
443 - Security / TLS: on
- SNI: the same Railway domain
-
Address / Host: Railway domain, e.g.
2. Port 8080 (Direct
connection via TCP Proxy)
Port 8080 is reserved for transport-layer protocols.
Step 1: Enable TCP Proxy in Railway
- In your Railway project, go to Settings › Networking.
- Click Add TCP Proxy.
-
Set the internal port to
8080. -
Copy the TCP Proxy domain (e.g.
domain.proxy.rlwy.net) and the assigned port (e.g.12345).
Step 2: Configure Host in the Panel
-
In the panel, edit the inbound on port
8080and click Add Host. - Address / Host: the TCP Proxy domain
- Port: the port provided by TCP Proxy
Usable Modes on Port 8080
TCP Reality
xHTTP Reality
Trojan gRPC Reality
Sample Links and Client Settings
VLESS over WebSocket (behind Nginx)
vless://[UUID]@[PUBLIC_DOMAIN]:443?type=ws&security=tls&host=[PUBLIC_DOMAIN]&path=%2Fin1&sni=[PUBLIC_DOMAIN]#WS_Inbound_Sample
Equivalent streamSettings in the client core:
"streamSettings": {
"network": "ws",
"security": "tls",
"tlsSettings": { "serverName": "[PUBLIC_DOMAIN]" },
"wsSettings": {
"path": "/in1",
"headers": { "Host": "[PUBLIC_DOMAIN]" }
}
}
Trojan gRPC Reality (via TCP Proxy)
trojan://[PASSWORD]@[TCP_PROXY_DOMAIN]:[TCP_PROXY_PORT]?type=grpc&mode=multi&serviceName=%2F&security=reality&pbk=[PUBLIC_KEY]&fp=chrome&sni=[SNI_DOMAIN]#Trojan_gRPC_Sample
Project Structure
3X-Ui-on-railway/
├── Dockerfile # Docker image including Nginx and 3X-UI
├── nginx.conf.template # Nginx configuration template (routes and Real IP)
├── start.sh # Run script: configure panel, generate nginx.conf, and start
└── README.md
What start.sh does
-
Sets port
3000for the Railway entrypoint (the panel and all routes are available on this port) - Sets the panel path to
/managepanel/ -
Generates
nginx.conffromnginx.conf.template - Runs 3X-UI in the background, then starts Nginx
Security and Important Notes
Change the default admin/admin password
immediately.
You can also change the panel path from
/managepanel/ to something else.
Persist your data. If you don't attach a
Railway Volume, settings and clients may be lost after each
deploy. Attach a Volume to the panel database path (usually
/etc/x-ui) and take backups from the panel.
Monitor your Railway usage and costs. Proxy traffic is billed to your account.
Review Railway's Terms of Service yourself. You are responsible for your use of the service.
Updating: To get a new 3X-UI version, rebuild the image.
Limitations
- Railway only exposes ports 80/443 for web services; everything else must go through TCP Proxy.
- Each TCP Proxy has its own random domain and port; if you delete and recreate it, you must update the Host in the panel.
-
The Real IP feature only works when using a personal domain behind
a CDN, not the
up.railway.appdomain.
Useful Links
| Resource | Address |
|---|---|
| This project's repository | AyhanMansur/3X-Ui-on-railway |
| Main 3X-UI panel | MHSanaei/3x-ui |
| Railway platform | railway.app |
| Telegram channel | @ayhandeveloper |