# Host on your own machine

> Let your agent do it: Install Hermitbox on my Linux machine with cloud-init. Create the machine from an image that runs cloud-init, such as Ubuntu 24.04 or 26.04, with the page's `user-data.yaml` as its user data. On the machine, check that `curl -fsS http://127.0.0.1:8080/healthz` answers `"status":"ok"`, and have me read the `apiKey` from `sudo journalctl -u hermitbox-image` myself. Then give me the SSH tunnel command to reach the welcome page at `http://127.0.0.1:8080`. Never copy the key into this chat. Follow the exact steps in https://docs.hermitbox.dev/v0.2.4/hosting/own-machine.md.

Deploy Hermitbox on a Linux machine with a persistent disk by supplying the shipped
[cloud-init user data](https://github.com/hermitbox/hermitbox/blob/c61777fdb140d97cded5ef039bce3a7e7c7a2a18/deploy/platforms/cloud-init/user-data.yaml). It runs the installer
and `hermitbox up --image` once as root, keeping state on the machine's disk.

## Install with cloud-init

1. Create the machine from an image that runs cloud-init. CI boots Ubuntu 24.04 and 26.04 with
   this file.
2. Supply [user-data.yaml](https://github.com/hermitbox/hermitbox/blob/c61777fdb140d97cded5ef039bce3a7e7c7a2a18/deploy/platforms/cloud-init/user-data.yaml) as its user data.
   The installer puts only the CLI on the machine, and `hermitbox up --image` runs the release
   image as the `hermitbox-image` systemd service.
3. Find the key in the service journal: the image prints `apiKey` once, on its first successful
   start.

```sh
sudo journalctl -u hermitbox-image
```

## Verify and connect

On the machine:

```sh
curl -fsS http://127.0.0.1:8080/healthz
```

It answers with `"status":"ok"`.

The service endpoint is HTTP, and its default origin is loopback. Reach the welcome page through
an SSH tunnel, then open `http://127.0.0.1:8080` on your own computer:

```sh
ssh -L 8080:127.0.0.1:8080 <user>@<machine-address>
```

The welcome page shows the key location and the configured tier. Enter the key there, then choose
a [caller guide](https://docs.hermitbox.dev/v0.2.4/get-started/connect.md).

## Machine notes

This is the server installation of the release image. It installs Docker and its host firewall
policy, and the image uses the container tier, refusing a missing policy. On `x86_64` it also
registers gVisor's `runsc` with Docker.

A public HTTPS deployment needs your own DNS and TLS setup and `HERMITBOX_PUBLIC_URL`. This file
doesn't invent a domain or weaken TLS. No cloud-init provider or operating system can allocate a
verified domain for a machine from this repository alone.

This path needs root, systemd, Docker and the host firewall policy. On a host without them, the
[installer](https://docs.hermitbox.dev/v0.2.4/get-started/install.md) selects a preset that fits, an ordinary user's included.
A requested capability the host lacks is refused.

Keep the state directory. See [operations](https://docs.hermitbox.dev/v0.2.4/guides/operate.md),
[Host on a server with root](https://docs.hermitbox.dev/v0.2.4/hosting/server.md) for the server preset without the image, and
[cloud-init runcmd](https://docs.cloud-init.io/en/latest/reference/modules.html#runcmd).
