# VPS Forwarding — Use Proxy from Anywhere

> For AI tools: this is the Markdown copy of https://xproxy.io/document/vps-forwarding-to-use-difference-place. Every XProxy guide has one at its URL + `.md`; the index of all guides is https://xproxy.io/llms.txt.

Reach your proxies from anywhere through a VPS, with a guided setup and monitoring.

Use your proxies from anywhere without changing your home router. A cloud server (a VPS) gets the customers' connections and passes them to your box.

**You need:** a VPS with Ubuntu and SSH access (`root`, or a user with sudo), and a plan that includes VPS forwarding (Premium or above). It takes about 10 minutes.

In short

**How it works**

Customer, then the VPS, then a tunnel to your box, then the mobile network. Customers only see the VPS address.

**Why use it**

No router setup. It works when your router cannot forward ports. The VPS address stays the same, and your home IP stays hidden.

**One click for the hard part**

The panel checks the VPS, installs the relay and starts the tunnels for you. If a check fails, nothing is changed.

## Which way is right for you?

There are three ways to reach your box from outside. This guide covers VPS forwarding.

| What to compare | Router | VPS forwarding | VPN |
| --- | --- | --- | --- |
| What you do | Forward ports on your home router | Connect a VPS to your box once | Add your box to a private VPN |
| Who can connect | Anyone with your IP or domain | Anyone with the VPS address | Only devices on that VPN |
| Needs router access | Yes | No | No |
| Works if your ISP shares one IP between customers | No | Yes | Yes |
| You pay for | Nothing extra | A VPS from any provider | Nothing extra (depends on the VPN) |

Router instead: [Open your router for the box](https://xproxy.io/document/how-public-access-xproxy). VPN instead: in your panel open **General Settings → System Setting** and look for **VPN tunnel setting** (Tailscale, ZeroTier or OpenVPN).

## Set up VPS forwarding

**Step 1: Open Forwarding Ports**

Open your box panel. In the left menu click **General Settings**, then **Forwarding Ports**.

A guided setup has 4 parts: **Security**, **Connect VPS**, **Services** and **Go live**. Click **Protect all in one step**.

![Panel, General Settings, Forwarding Ports page: step 1 Security, with the Protect all in one step button](https://media1.xproxy.io/docs/anywhere/vps-1-security.webp)

> Prefer to see every setting at once? Turn on **Expert mode** at the top of the page.

**Step 2: Set two logins**

Through the VPS, your dashboard and proxies can be reached from the internet. So both need a login. XProxy makes strong ones for you.

1. Click **Copy logins** and paste them somewhere safe.
2. Tick **I've saved them**.
3. Click **Protect &amp; continue**.

The dashboard login is for you. The proxy login is the one you give to your customers.

![Protect your box before it goes online: a dashboard login and a proxy login, with Copy logins, I've saved them and Protect and continue](https://media1.xproxy.io/docs/anywhere/vps-2-protect.webp)

> **The logins are shown only once.** Copy them before you continue.

**Step 3: Connect your VPS**

Fill in the form:

1. **VPS address**: the public IP of your VPS.
2. **SSH user**: `root`, or a user with sudo. The SSH port is 22 unless you changed it.
3. **SSH password**. To use a key instead, choose **Private key** in **Sign in with**.
4. Click **Test connection**.

The test checks the login, admin rights, the CPU type and the relay on the VPS. When you see **VPS is ready**, click **Next**.

![Connect VPS form: VPS address, SSH user, SSH password and the Test connection button](https://media1.xproxy.io/docs/anywhere/vps-3-connect.webp)

> The VPS must run **Ubuntu** and have the **same CPU type** as your box. Nothing is saved until you go live. A VPS near you gives lower delay.

**Step 4: Choose what to share**

Pick the **Tunnel engine**:

- **WireGuard** (recommended): the fastest, and the most features. With **Direct Mode** your box sees each customer's own IP and SOCKS5 UDP works on every proxy port. It uses more VPS CPU and needs UDP port 65001 open on the VPS firewall.
- **Relay**: light on the VPS, fine on the smallest VPS. Pick it when your VPS has 1 vCPU and many dongles, when UDP cannot reach the VPS, or when you need **Network isolation**.

Then switch on what people can reach: **Dashboard**, **Proxies** (HTTP, SOCKS5, VLESS, Shadowsocks), **VPN**, **Selling ports** and **SSH**. Each card shows the address people will use.

![Services step: tunnel engine Relay or WireGuard, and cards for Dashboard, Proxies, VPN, Selling ports and SSH](https://media1.xproxy.io/docs/anywhere/vps-4-services.webp)

> Not sure? Choose **WireGuard** on a VPS with 2 vCPU, and tick **Real client IP &amp; UDP Socks5** under Advanced. The differences are in [Relay or WireGuard](#engines). You can change it later.

**Step 5: Ports and tunnel options (optional)**

Most people skip this. Open **Advanced: port offsets &amp; tunnel options** when you need it:

- **Port offsets**: the VPS port is the box port plus the offset. Use it when two boxes share one VPS, so their ports do not clash.
- **Tunnel**: the starting relay port (default 65001, the tunnel uses 4 ports from it) and **Parallel tunnels per port** (1 to 16). More tunnels are faster when many customers share one port, and use a little more VPS CPU. **Network isolation** sends each modem over its own SIM instead of your home internet, and uses about twice the SIM data (Relay only). With WireGuard this shows the **WireGuard port** (UDP 65001).
- **Real client IP &amp; UDP Socks5** (WireGuard only, also called Direct Mode): the box sees each customer's own IP, so the proxy logs show it and the IP whitelist works with it, and SOCKS5 UDP works on every proxy port through the VPS. It opens one block of 400 UDP ports in 61000–64999 on the VPS firewall.
- **UDP Socks5** (Relay only): SOCKS5 UDP on the main proxy port of each modem. It opens UDP 32768 to 60999 on the VPS firewall.

How to test UDP: [SOCKS5 UDP through a VPS](https://xproxy.io/document/socks5-udp-associate#vps).

![Advanced options: port offsets for each service, the tunnel settings and the UDP Socks5 option](https://media1.xproxy.io/docs/anywhere/vps-5-advanced.webp)

> You do not need to switch the VPS firewall off. If `ufw` or `firewalld` runs on the VPS, XProxy opens the ports it needs. If your VPS provider has its own firewall (a "security group"), open the same ports there.

**Step 6: Go live**

Click **Check only** to run all the checks. It changes nothing.

Click **Go live** to do it all in one click:

1. It checks the VPS first: protection, SSH, admin rights, CPU, memory, firewall and the ports.
2. If every check passes, it sets up the VPS and saves. If a check fails, it stops and **nothing is changed**.
3. It starts the tunnels right away, without restarting the panel.

It takes under a minute. Connections made through the VPS may drop for a few seconds.

![Go live step: a summary of the VPS and services, with the Check only and Go live buttons](https://media1.xproxy.io/docs/anywhere/vps-6-golive.webp)

> When it is live, the panel shows the **Dashboard** address and the **First proxy** address. Click **Done**.

**Step 7: Check that it works**

Open the **Monitoring** tab. **Healthy** means all forwarded ports run. The services bar shows how many run.

- **Speed check** finds where it is slow: your internet line at the box, a SIM, or the route to the VPS.
- **Run doctor** checks security, SSH, relay, ports, services and capacity in 5 to 20 seconds. It changes nothing.

Below, every forwarded port has its own status. A port that fails shows in red.

![Port Monitoring tab: Healthy status, VPS capacity with Speed check and Run doctor, and the number of running services](https://media1.xproxy.io/docs/anywhere/vps-8-monitoring.webp)

> Many UDP connections? Watch the VPS RAM here, and move to a VPS with more RAM if it runs high.

**What's next?**

Give customers the proxy addresses and the proxy login you saved. See [how to use the proxy format](https://xproxy.io/document/how-use-proxy-format-http-socks5).

Want a name instead of an IP address? See [Dynamic DNS](https://xproxy.io/document/dynamic-dns-setup).

## Relay or WireGuard?

Both engines carry the same services. WireGuard does more and runs faster; Relay is lighter on the VPS.

| What to compare | WireGuard + Direct Mode (recommended) | Relay |
| --- | --- | --- |
| Speed with many dongles | About 330 Mbit/s in our 32-connection test: the VPS forwards packets in the kernel | About 40 Mbit/s in the same test with one tunnel. Raise Parallel tunnels per port to go faster |
| Customer IP on the box | Each customer's own IP, in the proxy logs and for the IP whitelist | The VPS, for every customer |
| SOCKS5 UDP (QUIC, games, calls) | On every SOCKS5 port: main, separate SOCKS5, IPv6 and Dual Stack | On the main proxy port of each modem |
| Proxy rules on the box | Logins, whitelist, website rules, limits and logs see the real customer | The same rules, but the box sees the VPS as the client |
| VPS CPU | About 1 vCPU per 300 Mbit/s. Choose 2 vCPU for 10 or more dongles | Low. Fine on the smallest 1 vCPU VPS |
| Ports on the VPS firewall | UDP 65001, plus one block of 400 UDP ports in 61000–64999 with Direct Mode | TCP 65001–65004, plus UDP 32768–60999 with UDP Socks5 |
| Only Relay has | — | Network isolation (each modem over its own SIM), Process isolation, and a tunnel over TCP when UDP to the VPS is blocked |

Switching engine is one setting in **Services**, then **Go live**. Customers keep the same VPS addresses and ports.

## How ports work

Each shared service opens a port on the VPS. **VPS port = box port + offset.** With offset 0, the VPS port is the same as the box port. The Services step shows the exact address of each service before you go live.

| Example | Box port | Offset | VPS port |
| --- | --- | --- | --- |
| Box A, first modem | 4001 | 0 | `4001` |
| Box B, same VPS | 4001 | 1000 | `5001` |

If two services, or two boxes on one VPS, want the same port, they clash. **Go live** checks which ports are already used on the VPS. Change the offsets under **Advanced** to fix it.

## Something not working?

| You see | What to do |
| --- | --- |
| "This function is available on higher plan license only" | VPS forwarding needs the Premium plan or above. See [Manage your subscription](https://xproxy.io/document/how-upgrade-subscription). |
| You cannot continue the Security step | Set the logins first. A service that you switch off in **Services** does not need one. |
| **Test connection** fails | Check the address, SSH port, user and password or key. The VPS needs Ubuntu, and a root or sudo user. |
| A check in **Go live** fails | Nothing was changed. Read the failed line, fix it, then click **Go live** again. |
| Ports are not reachable from the internet | Open the ports from the Services step in your VPS provider's firewall. Add UDP 65001 for WireGuard, the UDP block the panel shows (in 61000 to 64999) for Direct Mode, and UDP 32768 to 60999 for Relay's UDP Socks5. |
| SOCKS5 UDP apps get no answer through the VPS | Tick **Real client IP &amp; UDP Socks5** (WireGuard) or **UDP Socks5** (Relay) under Advanced, open the UDP ports above, and test with the [test script](https://xproxy.io/document/socks5-udp-associate#test). |
| A port is red in **Monitoring** | Click **Run doctor**. It lists what is wrong and changes nothing. |
| Two boxes clash on one VPS | Give each box a different **port offset** under Advanced. |

---

Source: https://xproxy.io/document/vps-forwarding-to-use-difference-place
