# Turn On X-Hub on Your Box or a VPS

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

Turn on X-Hub from the panel in a few clicks, choose the port, sign in and change the password. Or install it on a VPS with your own domain.

Turn X-Hub on in a few clicks from the box panel, or install it on a small server with your own domain. Then sign in and change the password.

**You need:** an XProxy box with a recent version and internet access. For a VPS: a Linux server and a domain. Not sure which one? Read [What is X-Hub](https://xproxy.io/document/xproxy-hub).

## How do I turn on X-Hub?

**Step 1: Open X-Hub in the panel (On my box (easiest))**

Open your box panel. In the left menu, open **General Settings**, then **XProxy Hub** (X-Hub).

The **Hub on this box** card shows the **Status**. It says **Off** until you turn X-Hub on.

> If the card says **This XProxy version has no hub. Update XProxy to get it.**, update first: [Update XProxy](https://xproxy.io/document/update-xproxy).

**Step 2: Pick a port (On my box (easiest))**

The **Port** box starts at **81**. Keep it, unless another app on this box already uses it. Then type any free port from 1 to 65535.

> Port in use? The panel says **port N is already used on this box; choose another port**. Pick a new number and try again.

**Step 3: Click Turn on the hub (On my box (easiest))**

Click **Turn on the hub**. The box downloads X-Hub from x-proxy.io (it checks the signature), starts it and joins it as its first server. This needs an internet connection and takes about a minute.

When it is ready, **Status** says **Running**, and the card shows the **Address** of your X-Hub, for example `http://192.168.1.50:81`.

> The top bar of the panel now has an X-Hub icon with the number of servers online. Click it to open X-Hub.

**Step 4: Copy the first password (On my box (easiest))**

The first time, a window called **Sign in to your hub** shows the password for the user **admin**. Click the copy button and keep it. **It is shown only once.**

Click **Open hub**.

> Lost it before you signed in? Turn X-Hub off with **Also delete the hub accounts, servers and settings** ticked, and turn it on again for a new password.

**Step 5: Sign in as admin**

Type **admin** and the password, then click **Sign in**.

![The X-Hub sign-in page with the username, password and Sign in button marked (demo)](https://media1.xproxy.io/docs/hub/login-1.webp)

> After 10 wrong passwords in 15 minutes X-Hub makes you wait. This protects you from guessing.

**Step 6: Change the password**

Click your name in the top right, then **Change password**. Type the current password and a new one with at least 10 characters. You are signed out and sign in again with the new password.

**Step 7: Get a domain and a small server (On a VPS with a domain)**

You need a Linux server (amd64 or arm64) that your boxes can reach, and a domain name that points to it, for example `hub.example.com`. The domain must use **https**: passkeys and Claude or ChatGPT in the browser need it.

Open only port **443** to the internet. Boxes connect out to X-Hub, X-Hub never connects to boxes.

**Step 8: Download and install X-Hub (On a VPS with a domain)**

On the server, run these commands. Use `arm64` instead of `amd64` on an ARM server.

Terminal

```
arch=amd64
curl -fsSLO https://x-proxy.io/hub-cli/xproxy-hub-linux-$arch
curl -fsSL https://x-proxy.io/hub-cli/xproxy-hub-linux-$arch.sha256 | sha256sum -c -
sudo useradd --system --no-create-home --shell /usr/sbin/nologin xproxy-hub
sudo install -m 755 xproxy-hub-linux-$arch /usr/local/bin/xproxy-hub
```

The second command must print `OK`. Then copy the two files `xproxy-hub.service` and `xproxy-hub.env.example` from the `hub/deploy` folder of the XProxy repository to `/etc/systemd/system/xproxy-hub.service` and `/etc/xproxy-hub.env`.

> Prefer Docker? Build the image from the `hub` folder and run it with `-v xproxy-hub:/data` and `XPROXY_HUB_TLS_DOMAIN` set to your domain.

**Step 9: Set your address and start it (On a VPS with a domain)**

Edit `/etc/xproxy-hub.env`. Set `XPROXY_HUB_PUBLIC_URL` to your address, for example `https://hub.example.com`. To let X-Hub get a free certificate itself, also set `XPROXY_HUB_TLS_DOMAIN=hub.example.com`. Behind your own web server (nginx, Caddy), set `XPROXY_HUB_TRUSTED_PROXY` to its address and pass WebSockets and live updates through it.

Terminal

```
sudo systemctl daemon-reload
sudo systemctl enable --now xproxy-hub
sudo journalctl -u xproxy-hub | grep -A1 'First start'
```

The last command shows the password of the user **admin**. It is printed once. Open your address, sign in, and change the password (next steps).

> Back up `/var/lib/xproxy-hub/hub.db`. It holds your accounts, passkeys, paired boxes, webhooks and Telegram settings. Keep the copy private.

## What is the X-Hub icon in the panel?

Once X-Hub runs on the box, the top bar of the panel shows a small X-Hub icon with a number. The number is how many servers are online in your X-Hub. A green dot means all of them are online, an orange dot means some are not. Click the icon to open X-Hub in a new tab. Hover to see the address.

## How do I change the port or turn it off?

- **Change the port:** type a new port. The button changes to **Move to port N**. Click it.
- **Turn off:** click **Turn off**. X-Hub stops and the box leaves it. Telegram alerts and AI access stop too. Tick **Also delete the hub's accounts, servers and settings** to wipe everything.

The card also says **Your network only**: X-Hub on the box answers only your LAN and Tailscale, never the internet.

## FAQ

### The panel says this box is connected to another hub

A box can join one X-Hub at a time. Remove the server in the other X-Hub, then run `sudo xtool hub disconnect` on this box. Then turn on X-Hub here.

### Can I open the box's X-Hub from my phone?

Yes, when the phone is on the same network or on Tailscale. Use the address from the panel card.

### How does X-Hub get updates?

X-Hub running on a box checks once a day and installs a newer release only if its signature is valid. On a VPS, replace the program file and restart.

## What next?

Add your other boxes, or set up alerts.

[Connect more boxes →](https://xproxy.io/document/xproxy-hub-connect-boxes) [Telegram bot →](https://xproxy.io/document/xproxy-hub-telegram) [Troubleshooting →](https://xproxy.io/document/xproxy-hub-troubleshooting)

---

Source: https://xproxy.io/document/xproxy-hub-setup
