> For the complete documentation index, see [llms.txt](https://support.spiderpool.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://support.spiderpool.com/ai/host/add-machine.md). Agents can also search and read this documentation through its [MCP server](https://support.spiderpool.com/~gitbook/mcp).

# Add a machine

Add a machine in the Console, generate the install command and run it as root; what the installer checks and installs, how long until the machine is online, expired commands, reinstalling and moving,

Adding a machine takes two steps: create the machine in the Console to get an install command, then run that command as root on the machine. Before you start, prepare the OS, driver, Docker and xfs data disk as described in [Machine requirements](https://support.spiderpool.com/ai/host/requirements.md).

## Before you start

* You have accepted the Host Terms and can switch the sidebar to **Host**. See [Hosting guide](https://support.spiderpool.com/ai/host.md).
* Your hosting is not suspended by the platform. While it is, **Add machine** is unavailable with "Hosting is suspended; you cannot add machines".
* Your account is not frozen (a frozen account has every action disabled, with an explanation at the top of the page).
* You have root on the machine, and the machine can reach port 443 outbound.

## Generate the install command

1. Open **Host → Machines** (<https://www.spiderpool.com/ai/host/machines>) and click **Add machine** at the top right. For your first machine you can also use step ③ of **Become a host**.
2. Enter a **Name**, for example `gpu-box-1`:
   * 1–63 letters, digits, `-` or `_`, starting with a letter or digit;
   * unique within your account; a duplicate shows "A machine with this name already exists".
3. You do not choose a region: "The region is detected automatically once the agent connects."
4. Click **Generate install command**. You see "Machine {name} created", the install command with a **Copy** button, and the remaining validity ("expires in …").
5. Click **Copy** and run the command on the machine (next section). Then click **Go to machine and wait for it to come online** to follow the progress, or **View requirements** to check the requirements again.

The machine appears in the list right away with the status **Enrolling**. Until the agent connects, the top of the machine detail page shows the same command and remaining time ("Waiting for the agent. Run the install command on the target machine."), so you can copy it again from there.

## Run the install command on the machine

Run the whole copied command as root on the target machine. It looks like this:

```bash
curl -fsSL https://…/install.sh | sudo bash -s -- …
```

After `--` come the arguments: the platform address, the one-time enrollment token, the agent release address and so on. Paste the complete command exactly as the Console shows it; do not edit it.

* **Single use.** The command carries a one-time enrollment token that stops working after the first successful enrollment.
* **It expires.** The countdown on the page is the remaining time, so run the command soon after generating it. After it expires the page says "Command expired. Delete the machine and add it again."; see "The command expired" below.
* Do not share a command that is still valid: anyone who has it can use it to enroll another machine into your account.

The install takes a few minutes. The script prints one line per step, starting with `OK`, `INFO`, `WARN`, `FAIL` or `Note:`. The last line is the verdict:

| Last line                                                                                           | Meaning                                                                                                                                                                                                                     |
| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `OK install complete`                                                                               | Installed, and every self-check passed                                                                                                                                                                                      |
| `WARN install complete; spagent doctor reports this host outside the support matrix or WARN rows …` | Installed, but some support matrix or warning checks did not pass. The machine can connect; the failed items appear under **Machine self-check** in the Console. Unfixed support matrix items keep the machine **Degraded** |
| `FAIL install complete, but the runtime self-check failed …`                                        | The platform runtime or GPU device description self-check failed. Fix the `FAIL` lines above it, then run `sudo spagent doctor`                                                                                             |
| Any other `FAIL …` line                                                                             | A step failed and the script stopped; see "When the installer refuses" below                                                                                                                                                |

Exit codes: `0` finished; `1` a step or the self-check failed; `2` usage error; `3` the disk layout check refused the machine (nothing was installed).

## What the installer checks and installs

**Checks first, without installing anything:**

1. It runs as root.
2. The distribution is Ubuntu 22.04 / 24.04 (WARN otherwise).
3. Whether sshd allows password login and whether Secure Boot is on (WARN only, nothing is changed).
4. Docker is installed and running.
5. Docker uses the classic image store (a new machine on the containerd store is refused here).
6. systemd exists; `nvidia-smi` exists and lists the GPUs.
7. Downloads the agent release (`spagent` and `sprunc`) and verifies the sha256.
8. Disk layout: if needed it first creates `/var/lib/spagent` as a link to `/var/lib/docker/.spagent`, then checks the data disk and the root partition. On failure it prints the failed items, the recommended partition table and the fstab example, and exits with code 3.

**Installs only after the checks pass:**

9. If `nvidia-ctk` is missing, installs nvidia-container-toolkit from NVIDIA's official repository (the package only; Docker's configuration is not touched).
10. Installs the agent to `/usr/local/bin/spagent`.
11. Installs the platform runtime `sprunc` and merges `/etc/docker/daemon.json` (default runtime, `live-restore=true`, `ipv6=false`; the original is backed up to `daemon.json.spiderpool-backup`), then reloads Docker. The `ipv6` change takes effect only after a Docker restart: with no running containers the script restarts Docker itself, otherwise it prints a WARN line asking you to restart at a convenient time.
12. Holds the installed driver, nvidia-container-toolkit and Docker packages with `apt-mark hold` and writes an unattended-upgrades blacklist (`/etc/apt/apt.conf.d/51spiderpool-unattended-upgrades`).
13. Writes the agent configuration `/etc/spagent/config.toml`.
14. Generates the GPU device description (CDI spec) `/var/lib/spagent/cdi/nvidia.yaml`.
15. Installs and enables the systemd service `spagent.service`.
16. Enrolls the machine with the token.
17. Starts the agent, runs `spagent doctor` once, and prints a reminder not to run `nvidia-ctk runtime configure --runtime=docker` on this machine.

To follow the agent's log: `journalctl -u spagent -f`.

## How long until the machine is online

| Stage                             | What you see in the Console                                                                                                            |
| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| Command not run yet, or running   | Status **Enrolling**; the detail page shows the install command and remaining time                                                     |
| The agent enrolls and connects    | Status **Online**; **Hardware (agent-reported)** and **Machine self-check** fill in; the region is detected                            |
| The platform starts the benchmark | Verification badge **Pending verification** with a yellow **Verifying** next to it; the GPUs under test show **Benchmarking**          |
| Verification passes               | Verification badge **Passed**; you can list the machine on **Listings & pricing**. The platform then measures bandwidth and disk speed |

This usually takes 5–10 minutes ("After install the agent checks the environment, reports hardware and runs platform verification (about 5–10 minutes)."). It takes longer with many GPUs, or when the machine first has to download the benchmark image over a slow connection. Verification is explained in [Verification and spot checks](https://support.spiderpool.com/ai/host/verification.md), listing in [Listings and pricing](https://support.spiderpool.com/ai/host/listings.md).

The platform also pre-downloads the images of common templates to the machine ("Pre-pulling platform images" on the **Cached images** card of the machine detail page). This does not hold up going online or listing; it only makes renters' first instances start faster.

## The command expired

An expired command cannot be used, and the machine detail page says "Command expired. Delete the machine and add it again.":

1. Click **Delete** on the list or the detail page to delete the **Enrolling** machine.
2. **Add machine** again to get a new command.
3. Run the new command on the machine soon.

If an earlier run of the command failed half way, just run the new command; the installer can be run repeatedly.

## Region

* The region is detected by the platform from the agent's public connection IP (GeoIP) and shown as "code name", for example "JP Japan". Before enrollment it shows "Detected after enrollment".
* The machine detail page notes below the region: "Detected by the platform from the agent connection IP. Contact support if it is wrong."
* It is detected again every time the agent reconnects. If the machine moves or uses a different internet exit, the region follows and the machine events record "Region detected".
* If the machine goes out through a proxy or VPN, the country or region of that exit is detected.
* If the detection is wrong, contact support (<support@spiderpool.com> by default; use the address shown in the Console) with the machine name and where the machine actually is.

## Reinstall, move or re-register

**Re-running the install command on an enrolled machine** is safe: the installer updates the agent and runtime and repairs the configuration, keeps the existing enrollment, and ignores the token in the command (it prints `WARN this machine is already enrolled …`). This is one of the fixes the Console suggests for "Agent upgrade failed", "nvidia-ctk missing" and similar problems. Once the machine is enrolled the Console no longer shows the install command, so keep a copy yourself.

**Uninstall the agent:** run the same script address from your install command with `curl -fsSL https://…/install.sh | sudo bash -s -- --uninstall`. It stops the service, restores `daemon.json`, and removes `sprunc` and the systemd service; `/etc/spagent/config.toml` and `/var/lib/spagent` (enrollment identity, instance workspaces) are kept. Uninstalling does not delete the machine in the Console.

**Re-register the same machine as a new machine** (for example after reinstalling the OS, or to get a different name):

1. Delete the old machine in the Console. It cannot be deleted while any instance is still on it; see "Delete a machine" in [Manage machines](https://support.spiderpool.com/ai/host/machines.md).
2. Stop the agent on the machine: `sudo systemctl stop spagent`.
3. Remove the old enrollment identity:
   * if `/var/lib/spagent` is a link to the data disk: `sudo rm /var/lib/spagent/state.json`;
   * if `/var/lib/spagent` is a plain directory on the root partition: `sudo mv -T /var/lib/spagent /root/spagent-old` (removing only `state.json` is not enough; the disk check would still refuse the machine).
4. **Add machine** again in the Console and run the new command on the machine **right away**.

Notes:

* A machine that the platform manually marked as failed cannot be deleted, and if its GPUs show up in another of your machines, that machine inherits the decision (machine event "Platform verdict inherited"). Re-registering does not get around a platform decision.
* Platform containers that the old machine left on the box are cleaned up by the platform (machine event "Container of another machine's instance"); their data volumes are kept.

**Moving the machine to another place:** start maintenance first and wait for the renter instances to end; see "Maintenance" in [Manage machines](https://support.spiderpool.com/ai/host/machines.md). Once it is moved and the agent reconnects, the region updates by itself. Being offline during maintenance does not count against reliability.

**Moving GPUs to another of your machines:** both machines are verified again because their GPU sets changed ("Hardware changed") and cannot be listed until they pass.

## When the installer refuses

| Installer output                                                                                             | What to do                                                                                                                                              |
| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `must be run as root`                                                                                        | Run it as root or with `sudo`                                                                                                                           |
| `docker is missing` / `dockerd is not running …`                                                             | Install docker-ce following Docker's documentation, or `systemctl start docker`                                                                         |
| `docker uses the containerd image store …`                                                                   | Switch to the classic image store; see "Docker settings" in [Machine requirements](https://support.spiderpool.com/ai/host/requirements.md)              |
| `nvidia-smi is missing`                                                                                      | Install the NVIDIA driver first                                                                                                                         |
| `nvidia-smi failed (driver not loaded, or the driver was upgraded and the host has not been rebooted yet) …` | Run `nvidia-smi` to see the error; reboot if you just upgraded the driver                                                                               |
| `failed to download …`                                                                                       | Check outbound access to port 443 and your proxy and firewall settings                                                                                  |
| Disk lines `FAIL disk_not_pquota` / `disk_too_small` / `root_too_small` / `disk_free_too_small`, exit code 3 | Prepare the data disk as in "Disk layout" in [Machine requirements](https://support.spiderpool.com/ai/host/requirements.md), then run the command again |
| `… /var/lib/spagent is a symlink to …, which does not exist …`                                               | The data disk is not mounted: mount the xfs data disk at `/var/lib/docker`, or remove the link as the message says, then run again                      |
| `nvidia-ctk is missing …`                                                                                    | The automatic install failed: install curl / gnupg as the message says and retry, or install nvidia-container-toolkit by hand following NVIDIA's guide  |
| `spagent enroll failed: …`                                                                                   | The token expired or was already used: delete the machine, add it again and run the new command                                                         |

More cases are covered in [Troubleshooting for hosts](https://support.spiderpool.com/ai/host/troubleshooting.md).

## FAQ

**What does the installer change on my machine?** Docker's `daemon.json` (with a backup), two new programs `spagent` / `sprunc` and the `spagent` service, package holds for the driver and Docker packages, one unattended-upgrades blacklist file, and the agent's configuration and data directories. It does not install or upgrade the driver or Docker.

**Can one command enroll several machines?** No. Add each machine separately; each gets its own command.

**Can I rename a machine after enrollment?** The Console has no rename action. To change the name, re-register the machine as described above.

**The machine already runs other Docker containers. Can I still add it?** Yes, but a GPU used by a non-platform process is not rented out, and if that GPU is rented or being spot-checked at the time, the machine's earnings are frozen. See [Hosting rules](https://support.spiderpool.com/ai/host/rules.md).

## Related

* [Machine requirements](https://support.spiderpool.com/ai/host/requirements.md)
* [Manage machines](https://support.spiderpool.com/ai/host/machines.md)
* [Verification and spot checks](https://support.spiderpool.com/ai/host/verification.md)
* [Listings and pricing](https://support.spiderpool.com/ai/host/listings.md)
* [Troubleshooting for hosts](https://support.spiderpool.com/ai/host/troubleshooting.md)
