# Install and configure Nilo Appliance

Choose the package that matches the device from the [Appliance downloads](https://downloads.nilo-assistant.com/nilo-appliance/). The [latest release manifest](https://downloads.nilo-assistant.com/nilo-appliance/latest.json) lists each package and the installation README with its SHA-256 checksum. Resolve each `path` relative to the manifest URL and verify the checksum before installing.
The installed copy is at `/Library/Application Support/Nilo Appliance/README.md` on
macOS and `/usr/share/doc/nilo-appliance/README.md` on Linux.

| Device | Package |
| --- | --- |
| Apple silicon Mac | `nilo-appliance-macos-arm64.pkg` |
| Ubuntu 24.04, amd64 | `nilo-appliance-linux-amd64.deb` |
| Ubuntu 24.04, arm64 | `nilo-appliance-linux-arm64.deb` |
| Rocky Linux 9, x86_64 | `nilo-appliance-linux-x86_64.rpm` |
| Rocky Linux 9, aarch64 | `nilo-appliance-linux-aarch64.rpm` |

The packages include a Java runtime and register a background service. Installing a newer package preserves the device identity and local state.

At startup, the Appliance checks the host's configured time zone and logs a warning
when it is not a fixed UTC zone. The warning includes the observed zone. An unavailable
check also produces a warning. The check never changes the host's time zone and does
not prevent startup.
On Linux, inspect `/var/lib/nilo-appliance/appliance.log`; on macOS, inspect
`/var/db/nilo-appliance/appliance.log`.

Install from a private terminal to see the claim details when installation completes. On macOS:

```sh
sudo installer -pkg ./nilo-appliance-macos-arm64.pkg -target / &&
    sudo '/Library/Application Support/Nilo Appliance/claim-details'
```

On Ubuntu:

```sh
sudo apt install "./nilo-appliance-linux-$(dpkg --print-architecture).deb" &&
    sudo /usr/lib/nilo-appliance/claim-details
```

On Rocky Linux:

```sh
sudo dnf install "./nilo-appliance-linux-$(uname -m).rpm" &&
    sudo /usr/lib/nilo-appliance/claim-details
```

## Website and download port

A fresh Appliance registers with Cloud with its HTTP listener off. To activate it, enable **Local information page** in **Nilo Admin → Appliances**. The LAN page, downloads and MCP use one HTTP port on all IPv4 interfaces.

Only Cloud grants activate this listener; host-local settings cannot enable it. The tenant supplies the name and logo. The page lists the Cloud-configured platform installers when LAN clients is enabled. It can serve this installer list even when the Local information page switch is off.

Tenant administrators edit **Service directory** in **System → Appliance**. The local
information page shows the saved service cards in order. Each card links to its configured
HTTP or HTTPS address and uses an uploaded PNG or JPEG or its own built-in symbol. Anyone
who can reach the page can see these links. The last fully received directory, including
uploaded symbols, remains available after a restart without Cloud.

The activated listener uses TCP port **80** by default. Set a different free TCP port from 1 to 65535 with this optional property.

```properties
nilo.appliance.website.port=8080
```

| Platform | Configuration file | Restart |
| --- | --- | --- |
| macOS | `/Library/Application Support/Nilo Appliance/config/nilo-appliance.properties` | `sudo launchctl kickstart -k system/net.caimito.nilo.appliance.macos` |
| Linux | `/etc/nilo-appliance/nilo-appliance.properties` | `sudo systemctl restart nilo-appliance.service` |

Create the file if needed and preserve any existing settings in it. After restarting, open `http://APPLIANCE_LAN_ADDRESS:8080/` from another device on the LAN. To restore port 80, remove the port property and restart. For a foreground launch, pass `--nilo.appliance.website.port=8080` after the optional `--state-directory PATH` argument. Foreground options take precedence over the properties file. To stop serving HTTP, turn off the Cloud website, LAN clients, and MCP gateway grants.

## Cloud registration and optional services

The Appliance announces itself as soon as the service starts and retries if Cloud is unreachable.
The terminal shows the installation reference, current one-time claim code and Cloud claim page.
If Cloud could not confirm registration or the code has rotated, run the same `claim-details` command again.

A tenant administrator enters the code in [**System → Appliance**](https://app.nilo-assistant.com/appliance/link) in Nilo Cloud.
A Nilo operator can match the installation reference under **Appliances**, select **Assign to tenant**,
and choose the destination tenant.

On startup and about every 15 minutes, the Appliance reads local DNS settings and checks configured
DNS domains for Active Directory locator, LDAP and Kerberos SRV records through eligible local
resolvers. It does not query public resolvers directly, scan the subnet or connect to the advertised
services. This does not verify domain membership or service health. Once admitted, the Appliance
includes the results in its private host report under **Nilo Admin → Appliances → Local DNS**.

- **Client access** opens one pinned HTTPS endpoint on TCP **8443** for native sign-in and management, application HTTP requests and WebSockets. Port 8444 is not used. Update the Appliance and Client together; existing account data, keys and certificate pins remain valid.
- The optional macOS **LAN mail** pilot uses IMAPS on TCP **993**. Its local address is set by `nilo.appliance.dovecot.address` when the host has been provisioned with Dovecot, TLS files and mailbox accounts.

## MCP gateway

Use the [existing sidecar socket](#report-events-from-a-local-process) and its
OS-account mapping. Each sidecar announces its own loopback Streamable HTTP
endpoint over that socket. See [MCP registration](../marketing/resources/appliance-sidecars/protocol.md#mcp-registration)
for the frame and acknowledgement.

In **Nilo Admin → Appliances → Services**, enable **MCP gateway** for the
admitted installation. It serves `/mcp` on the existing LAN HTTP port, bound
to `0.0.0.0`. Workstations use `http://APPLIANCE_ADDRESS:PORT/mcp`, with the
same host and port used to reach the information page. The default port is 80.
The built-in `hello` tool identifies the gateway and its installation before
any sidecars register. The gateway exposes tools from authenticated local
sidecar registrations.

The Claude extension defaults its **MCP URL** setting to the Appliance's LAN IPv4
address and shared HTTP port. Users can replace this URL in the extension
settings before connecting. The bridge uses the selected URL. A download through
a LAN address uses that address as the default. Downloads through another
network use the first active interface with a private IPv4 address, in interface
index order.

Enabling **Claude extension** also enables **Local information page** and
**MCP gateway**. Each switch can be turned off independently. Turning off the
MCP gateway makes the extension download unavailable. Turning off the page
removes its link. The direct download remains available while the extension
and MCP gateway are on. Claude displays the tenant's name and logo when
one is configured. Users download the `.mcpb` file from the Appliance information
page. The sidecar owns its tools and their access rules. Callers reaching the
private gateway share the MCP catalog enabled for that installation unless a
local authority is explicitly installed; that mode discovers each caller's own
catalog after authorization.

Connected clients receive `notifications/tools/list_changed` after the gateway
discovers a change to the locally registered tools. The LAN HTTP endpoint
streams these notifications on `GET /mcp` with `Accept: text/event-stream` under the
[2025-11-25 transport](https://modelcontextprotocol.io/specification/2025-11-25/basic/transports#listening-for-messages-from-the-server).
The desktop bridge forwards them over stdio to handshake-based clients and to
[2026-07-28 subscribers](https://modelcontextprotocol.io/specification/2026-07-28/basic/patterns/subscriptions).
Clients read `tools/list` again to retrieve the current catalog.

The Appliance Maven build uses Node.js 22 or newer and npm to generate and bundle
the bridge. The Linux and macOS package builders require it in the Appliance JAR.

In **Nilo Admin → Appliances**, select the installation and open **MCP diagnostics**.
Choose **INFO**, **DEBUG**, or **TRACE** for the gateway. Cloud signals connected
Appliances on the shared device control WebSocket, and the Appliance applies
the setting from its existing announcement exchange. The Appliance reconnects
after a disconnect and reconciles the saved settings. **Capture next 20 calls** records tool
calls, prompt retrievals, and resource reads. It stops automatically at 20
and sends the completed report on the next check-in. **Stop capture** discards
a partial batch. Cloud keeps the most recent completed report for the
installation. Reports contain operation, sidecar, tool or prompt name,
timestamp, duration and outcome. Arguments, results, resource URLs and
credentials stay out of the report.

An explicitly approved local authority can protect the combined MCP URL while
keeping customer sign-in and permissions in the sidecar deployment. See the
[combined MCP authorization contract](mcp-authorization.md). This requires an
OAuth-capable MCP client. The bundled Claude stdio bridge currently has no OAuth
sign-in provider.

## Report events from a local process

On packaged Linux, install a compatible sidecar package. The Appliance package
provisions `/var/lib/nilo-appliance-events/events.sock`, its directory and systemd
permissions. The sidecar package enrolls its Unix service account in a root-owned
declaration and grants its own service socket access. No Appliance restart or
manual sender setting is required. See the [Linux sidecar package contract](../appliance-linux/README.md#sidecar-packages)
for declarations, discovery and service setup.

Existing `nilo.appliance.process-events.senders=account:process-id` mappings remain
valid alongside package declarations. An explicitly configured
`nilo.appliance.process-events.socket` remains available for existing senders;
Linux also keeps the standard package socket available. Existing settings and
systemd drop-ins are preserved on upgrade.

For manually provisioned hosts, run each process under its own OS service account.
Use a short socket path in a dedicated `0750` directory, owned by the Appliance
account and a group shared with the reporting services. Keep it outside private
Appliance state. Set `nilo.appliance.process-events.socket` and
`nilo.appliance.process-events.senders` in the host configuration and restart the
Appliance. Custom Linux directories need `ReadWritePaths` and the matching
`SupplementaryGroups` in a systemd drop-in.

On macOS, use a short directory such as `/var/db/nilo-events` and grant the
Appliance account membership in the directory's group. Restart sender services
after changing their group membership. The Appliance verifies the Unix peer
account and its configured process ID on every connection.

Open an AF_UNIX stream connection, send one UTF-8 JSON object followed by LF,
and read one JSON reply. The Appliance closes the connection after the reply.

```json
{"version":1,"eventId":"f2869e4a-b3d5-48e3-ad61-52b38af80a48","processId":"inventory-import","occurredAt":"2026-11-13T01:15:24Z","type":"import.completed","severity":"info","message":"Inventory import completed","state":"healthy","payload":{"recordsImported":1274}}
```

Only `state` and `payload` are optional. IDs and types use up to 64 lowercase
letters, digits, dots, underscores or hyphens, starting with a letter. Generate
a canonical UUID for each event. Use an ISO 8601 instant for `occurredAt`, a
plain-text message up to 1 KiB, and severity `info`, `warning` or `error`.
The optional state is `healthy`, `degraded` or `failed`. The optional payload
is a JSON object. Keep the whole UTF-8 frame within 16 KiB before LF. Only send
operational data approved for Cloud storage.

```json
{"status":"accepted","eventId":"f2869e4a-b3d5-48e3-ad61-52b38af80a48"}
```

`accepted` confirms durable local receipt. Retry an uncertain receipt or
`busy` with backoff and the original event. `denied`, `invalid`, `conflict` and
`rejected` require fixing the sender setup or event. The Appliance retries Cloud
delivery across restarts and keeps permanent Cloud rejections as `.rejected`
files under the private `process-events` state directory for local inspection.
The queue holds up to 1,024 entries including rejected files. An operator can
remove resolved rejected files to free capacity.

For a one-off socket check, run this as the configured sender account.

```sh
python3 - /var/lib/nilo-appliance-events/events.sock inventory-import <<'PYTHON'
import datetime
import json
import socket
import sys
import uuid

event = {
    "version": 1,
    "eventId": str(uuid.uuid4()),
    "processId": sys.argv[2],
    "occurredAt": datetime.datetime.now(datetime.timezone.utc).isoformat(),
    "type": "reporting.test",
    "severity": "info",
    "message": "Process reporting test",
    "payload": {"test": True},
}
with socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) as client:
    client.settimeout(5)
    client.connect(sys.argv[1])
    client.sendall(json.dumps(event).encode("utf-8") + b"\n")
    print(client.makefile(encoding="utf-8").readline().rstrip())
PYTHON
```

The admitted Appliance relays reports to Cloud. Open **System → Appliance**
or the selected installation in **Nilo Admin → Appliances** to see the last
reported state and open recent events. Event history expires 30 days after
Cloud first accepts it. The latest process summary stays available separately.

## Software updates

An operator selects **Check & Update** in **Nilo Admin → Appliances and Runners** for a
registered installation with the trusted packaged updater. The Appliance
checks the distribution manifest and selects a newer signed package for its
platform. It verifies the signature and package digest, installs, and restarts.
Cloud confirms completion when the Appliance reports the selected build. If
there is no newer signed release, the Appliance reports that result without
installing. Services may be briefly unavailable during restart.

Cloud shows its daily catalog result for information. Older packaged updaters
receive a version-pinned request selected from a fresh manifest read on click.

If an installation stays offline, an undelivered request expires after one hour.
Select **Check & Update** again to retry. A request already sent to the Appliance
keeps an unconfirmed outcome until the Appliance reports its status.
Linux updates resolve dependencies through the system's configured package repositories.

An installation without the packaged updater needs a manual package upgrade
before it can update itself.
