# Host on a server with root

> Let your agent do it: Install Hermitbox on this Linux systemd server with the server preset, which runs as root. Check that the domain's DNS A record points at this server and that inbound TCP 443 is open. Show me `curl -fsSL https://hbx.sh | sudo HERMITBOX_DOMAIN=<domain> sh` with my domain, and run it only after I confirm. Then run `hermitbox run --image alpine:3.22 -- echo hello` and `hermitbox doctor`, and tell me which tiers are on. Never copy the key into a file or this chat. Follow the exact steps in https://docs.hermitbox.dev/v0.3.2/hosting/server.md.

One command as root turns a Linux systemd server into a Hermitbox host with the tiers an ordinary
user can't have: containers, gVisor, virtual machines and a separate user for each process
sandbox. Give it a domain and it serves the API over HTTPS with a certificate it renews itself.

```sh
curl -fsSL https://hbx.sh | sudo HERMITBOX_DOMAIN=sandboxes.example.com sh
```

This is the server preset.

## Before you install

Point a DNS A record for the domain at the server, and allow inbound TCP 443 for HTTPS and
certificate validation. The edge needs local TCP ports 80 and 443 for its HTTP and TLS fronts.

Omit `HERMITBOX_DOMAIN` to install a local server on loopback port 7331, with path aliases. To
print the plan without changing anything, run
`sudo hermitbox up --check --domain sandboxes.example.com` on an installed CLI.

## Verify the install

The installer prints the API URL, the key and a first command, and saves the URL and key for the
account that ran `sudo`. Run the command it prints:

```sh
hermitbox run --image alpine:3.22 -- echo hello
```

It prints `hello`. Then list what this host serves:

```sh
hermitbox doctor
```

`hermitbox doctor` shows each tier as on or off, with the reason and what would change it.

## What root turns on

| Capability | What the server preset adds |
| --- | --- |
| Containers from images | Docker and an nftables host firewall policy (`host-firewall`) |
| gVisor | gVisor's pinned `runsc`, registered with Docker on `x86_64`; off elsewhere, with the reason |
| Virtual machines | The signed VM bundle descriptor and `hermitboxd-vm-worker.service`, on `x86_64` with KVM |
| Separate users | A UID pool for process sandboxes (`separate-users`), where the credential-drop probe passes |
| Kernel network policy | Per-sandbox cgroup programs for process sandboxes: `host-firewall`, hostname egress and address rules |
| HTTPS | A certificate for the domain from ACME, renewed by the `hermitbox-api-tls` unit |

The preset requires every sandbox to have a private network, private PIDs and enforced CPU and
memory limits. That shapes the defaults:

- A sandbox that names no image or tier runs on a container from a pinned Debian image with
  Python.
- Process sandboxes run beside the other tiers with network `none`
  (`--isolation process --network none`), in network, PID and user namespaces of their own. A
  process sandbox has `private-network` only with network `none`.
- The Wasm tier is off on a server: it gives no private network, PIDs or limits.

The main daemon's unit hardening stays in force. [Isolation tiers](https://docs.hermitbox.dev/v0.3.2/concepts/isolation.md)
explains each tier, and [host capabilities](https://docs.hermitbox.dev/v0.3.2/reference/host-capabilities.md) lists every
guarantee.

## Server notes

A systemd host gets Docker, nftables, persistent Docker volumes for the database and object store,
control and edge units, and its enrolled local node. Debian and Ubuntu install missing packages
automatically. Other distributions need Docker and nftables installed first, and the installer
names them before it provisions anything.

Without an `--allow-image` list of your own, the node admits `alpine:` and `node:` images, the
release's built-in template images (`ghcr.io/hermitbox/hermitbox-<name>:`), the pinned
coding-agent and language-stack images, and the images the VM bundle is proven with. See
[virtual machines](https://docs.hermitbox.dev/v0.3.2/guides/virtual-machines.md) for the VM tier's host requirements.

The API is at `https://sandboxes.example.com` with an automatically renewed certificate.
Exposed ports and template previews share that address and certificate, at
`https://sandboxes.example.com/sandboxes/<id>/ports/<port>`, so the one A record is all the DNS
they need. Existing domains stay immutable. See [operations](https://docs.hermitbox.dev/v0.3.2/guides/operate.md) for DNS, TLS,
server upgrades, more nodes and explicit data removal.
