3X-UI on Railway

Deploy a full proxy panel on Railway — no VPS required.
Docker + Nginx + TCP Proxy · One public port.

3X-UI v3.12.0 Docker Nginx Reverse Proxy Railway TCP Proxy 50 Inbound Routes

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

  1. Fork the repository.
  2. Create a new project on Railway and click Deploy from GitHub repo.
  3. Select your forked repository and wait for the build to finish.
  4. From Settings › Networking, generate a domain (Generate Domain) and set its port to 3000.
  5. Open the panel:
    https://your-app.up.railway.app/managepanel/
  6. Log in with the default credentials and change them right now:
    Field Default Value
    Username admin
    Password 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 diagram: how Nginx and the TCP Proxy split traffic Nginx on port 443 routes /managepanel/ to internal port 3000, /sub/ to port 2096, and /in1 through /in50 to internal ports 8001 through 8050. A separate Railway TCP Proxy on port 8080 connects directly to internal port 8080 for Reality, xHTTP, and gRPC. WEB LAYER · VIA NGINX Nginx :443 /managepanel/ → :3000 /sub/ → :2096 /in1 – /in50 → :8001–8050 DIRECT LAYER · VIA RAILWAY TCP PROXY TCP Proxy :8080 :8080 Reality · xHTTP · gRPC
The two-layer architecture. Nginx on port 443 serves the panel, the subscription link, and the 50 WS/HTTPUpgrade inbounds. The Railway TCP Proxy on port 8080 carries Reality, xHTTP, and gRPC directly to the core. The full route table follows below.

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: WebSocket or HTTPUpgrade
  • Security in panel: must be none (TLS is handled by the Railway/CDN layer)
  • Path: /in1 for port 8001, /in2 for 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

2. Port 8080 (Direct connection via TCP Proxy)

Port 8080 is reserved for transport-layer protocols.

Step 1: Enable TCP Proxy in Railway

  1. In your Railway project, go to Settings › Networking.
  2. Click Add TCP Proxy.
  3. Set the internal port to 8080.
  4. 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

  1. In the panel, edit the inbound on port 8080 and click Add Host.
  2. Address / Host: the TCP Proxy domain
  3. Port: the port provided by TCP Proxy

Usable Modes on Port 8080

TCP Reality

Transport: TCP Security: Reality SNI: yahoo.com / cloudflare.com

xHTTP Reality

Transport: xHTTP Path: / Security: Reality

Trojan gRPC Reality

Protocol: Trojan Transport: gRPC gRPC Mode: Multi Service Name: / Security: Reality

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
  1. Sets port 3000 for the Railway entrypoint (the panel and all routes are available on this port)
  2. Sets the panel path to /managepanel/
  3. Generates nginx.conf from nginx.conf.template
  4. 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.app domain.