# Connect More Boxes to X-Hub

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

Pair another XProxy box with your X-Hub using one command and a short code. Name it, add tags, see it online, and remove it later if needed.

Add another XProxy box to your X-Hub with one command on that box and a short code in X-Hub. You never type a password for the box.

**You need:** a running [X-Hub](https://xproxy.io/document/xproxy-hub-setup) and an XProxy box that can reach it. The box that runs X-Hub on itself is added automatically.

## How do I connect a box?

**Step 1: Open a terminal on the box you want to add**

Log in to the second box over SSH, or use its screen and keyboard. If you are not sure how, see [Open the dashboard](https://xproxy.io/document/how-access-dashboard-xproxy) and [Remote support](https://xproxy.io/document/remote-support).

That box needs a recent XProxy version and a connection to your X-Hub.

**Step 2: Run the pair command**

Type this and press Enter. Use the address of **your** X-Hub. X-Hub on a box looks like `http://192.168.1.50:81`, X-Hub on a VPS like `https://hub.example.com`.

Terminal

```
sudo xtool hub pair http://192.168.1.50:81 --insecure
```

Add `--insecure` **only** when the address starts with `http://` (X-Hub on your own network). Leave it out for `https://`.

The box prints a **Pairing code** like `6QV8-MEKV` and a link. It then waits.

![The terminal on the second box after the pair command: the pairing code, the link, Waiting for confirmation, Paired and the agent service line](https://media1.xproxy.io/docs/hub/term-pair.webp)

> The code works once and expires after 10 minutes. If it expires, run the command again for a new code.

**Step 3: Open Add Server in X-Hub**

In X-Hub, click **Add Server** in the left menu (or open the link the box printed, which has the code already filled in). Type the code and click **Continue**.

![The Connect a box to this hub page with the code typed in and the Continue button marked (demo)](https://media1.xproxy.io/docs/hub/pair-2-code-typed.webp)

> Operators and owners can add servers. A viewer does not see Add Server.

**Step 4: Check the box and give it a name**

X-Hub shows the box: name, XProxy version and license. Type a **Server name**, for example the place where the box lives. Add **Tags** if you like (for example `us`, `office`); you can filter by tag later. Click **Add server**.

![The confirm step with the box details, the server name, the tags and the Add server button marked (demo)](https://media1.xproxy.io/docs/hub/pair-3-confirm.webp)

> Unknown code? X-Hub says **Unknown code. Check the code xtool printed on the box.** A used code says **This code was already used.** and an old one says **This code expired.**

**Step 5: The box connects**

The page says **... added** and **The box connects within a few seconds.** Click **View its proxies** to see its modems. On the box, the terminal says **Paired** and that the agent service starts with the box.

![The success page: server added, with View its proxies and Add another buttons (demo)](https://media1.xproxy.io/docs/hub/pair-4-connected.webp)

## How do I check the link on the box?

Terminal

```
xtool hub status
```

It shows the X-Hub address, the Box ID, when it was paired and whether the agent is running.

## How do I remove a box from X-Hub?

1. In X-Hub, open **Dashboard** and click the server name to open its page.
2. An owner clicks **Remove server** and confirms. Its open incidents close and its stored events are deleted.
3. The box keeps working. Its agent logs `this hub no longer knows this box; run: sudo xtool hub disconnect` and stops. Run that command on the box to forget X-Hub.

To use the box with an X-Hub again, pair it again with a new code.

## FAQ

### The command says the X-Hub address uses plain http://

Add `--insecure` if X-Hub is on your own network. For X-Hub on the internet, use an `https://` address instead.

### The command says it cannot reach X-Hub

Open the X-Hub address in a browser on the same network as the box. X-Hub on a box only answers your LAN and Tailscale. See [Troubleshooting](https://xproxy.io/document/xproxy-hub-troubleshooting).

### It says the box is already connected

Run `sudo xtool hub disconnect` first, then pair again.

### Does X-Hub see my box passwords?

No. Pairing needs only the code. The box hides every password, token and key before it answers X-Hub.

## What next?

See all your boxes in one place.

[Dashboard and proxies →](https://xproxy.io/document/xproxy-hub-dashboard) [Telegram bot →](https://xproxy.io/document/xproxy-hub-telegram)

---

Source: https://xproxy.io/document/xproxy-hub-connect-boxes
