# Installing and updating the control plane

> The one-line install of the control plane, its command line onprem-ai-ctl, what it leaves on the machine, how it updates itself, and how it is removed.

## Installing

The control plane needs no GPU and runs in Docker or Podman: on Linux with Docker Engine and its compose plugin (on Rocky Linux and RHEL 10, and on the EL10 cloud images, Docker 29 needs `kernel-modules-extra` for the running kernel: run `dnf install kernel-modules-extra-$(uname -r)`, then `modprobe xt_addrtype`; without it the Docker daemon does not start and its log says "failed to add jump rules to ipv4 NAT table"), on Linux with Podman, or on a Mac with Docker Desktop. On a Podman machine, install the docker command line and Docker's compose program first; they are only clients, run no Docker daemon, and drive Podman through its socket. As root, on Rocky Linux and RHEL:

```sh
dnf config-manager --add-repo https://download.docker.com/linux/rhel/docker-ce.repo
dnf install -y docker-ce-cli docker-compose-plugin
```

The install chooses Podman when Docker does not run and Podman is installed. It starts Podman's API socket itself and opens the control plane's ports in firewalld. Then, as your own user:

```sh
curl -fsSL https://get.onprem.ai/platform | sh                       # the control plane and an inference node
curl -fsSL https://get.onprem.ai/control-plane | sh              # the control plane only
curl -fsSL https://get.onprem.ai/node | sh                       # an inference node only
```

The installer runs as your user for the checks and the downloads. Before the steps that need root (installing the control plane, and the inference node with its service account and service definition), it prints what it installs as root and why, and asks for `sudo` once; type your password there. Run as root, it asks for nothing, so `| sudo sh` also works, for scripts that run as root (cloud-init, CI). With no terminal and no root, it stops and asks you to run it as root; with no `sudo` on the machine, it stops and says so.

The control plane runs on x86-64 and on ARM64 machines (an Apple silicon Mac included). The first install downloads about 450 MB and needs about 1 GB of disk, plus room for the database and metrics as they grow; an update downloads only what changed.

On a new machine, the installer installs the release the release server names for a new machine; `--release 5.7.1` installs one exact release instead. `--release` chooses the release of a new installation only. Without a word, the same machine gets the control plane and becomes an inference node connected to it.

### Through a proxy server (optional)

Where the machine reaches the internet only through a proxy server, name the proxy as the variable `HTTPS_PROXY`. `curl` needs the proxy too, because `curl` downloads the installer before the installer runs. A variable that you export in the shell reaches both, `curl` and the installer:

```sh
export HTTPS_PROXY=http://proxy.example.com:3128
curl -fsSL https://get.onprem.ai/control-plane | sh
```

A variable that you write before `sh` reaches only the installer. Then give the proxy to `curl` with its own option:

```sh
curl -x http://proxy.example.com:3128 -fsSL https://get.onprem.ai/control-plane | HTTPS_PROXY=http://proxy.example.com:3128 NO_PROXY=10.0.0.0/8 sh
```

`NO_PROXY` lists the destinations the machine reaches without the proxy.

The install writes the proxy into `/etc/onprem-ai/control-plane/config.env`, and every later run and update reads it there. To change it later, edit `HTTPS_PROXY` and `NO_PROXY` in that file and run `sudo onprem-ai-ctl apply`. Docker or Podman needs its own proxy setting for the image downloads, and a proxy that inspects TLS needs its certificate authority on the machine before the install. The guide [Outbound proxy](/en/platform/docs/guides/certificates-and-network/outbound-proxy/index.md) shows every step in order, who does what, the checks, and what to do when a connection fails.

### Settings at the install (optional)

A new install takes a setting of the control plane's config file as a variable of the same name, and writes it into `/etc/onprem-ai/control-plane/config.env`. Put the variable before `sh`:

```sh
curl -fsSL https://get.onprem.ai/control-plane | CONTROL_PLANE_PORT=8443 sh
```

The install names each setting it wrote. This works at a new install only: on a machine where the control plane is installed, or where `config.env` exists, a variable changes nothing, and the install says so. To change a setting later, edit the file and run `sudo onprem-ai-ctl apply`. `/etc/onprem-ai/control-plane/config-help.env` lists every setting with its explanation and an example.

The installer downloads the release's command line, `onprem-ai-ctl`, checks it against the release's published record, and hands over to it: `onprem-ai-ctl install` checks every file it downloads the same way, generates the secrets on the first install (see **Secrets**), starts the control plane, waits until every part of it reports healthy, and places itself on the machine, linked as `onprem-ai-ctl`. It ends with the address to open; the first visit creates the first administrator.

Running it again on an installed machine repairs the installation: it puts the installed release back and starts it, keeping every setting, secret and piece of data. On the machine, `sudo onprem-ai-ctl install` does the same. The same holds where an uninstall kept the data: the install puts back the release that wrote it. It refuses another release there: to move on, update the control plane (see **Updating from the Updates page**), one step at a time.

## The command line on the machine

The control plane's machine has its command line, `onprem-ai-ctl`, installed and updated with it. It starts, stops, checks, updates and removes the control plane, also when the pages cannot be reached. Every command is in [The command line (onprem-ai-ctl)](/en/platform/docs/guides/automation/command-line/index.md).

## How the control plane is kept running

The systemd unit `onprem-ai-control-plane.service` keeps the installed release running; `install` and `start` enable it. At every boot it starts the control plane, every part after the ones it needs. Every 30 seconds it checks each part:

- a part that stopped, or whose container was removed, is started again; when several parts are down (after the container engine restarted, for example), the whole control plane is started once, in order;
- a part that stays unhealthy for 3 minutes is restarted when it keeps no data (the web pages, the API, the API gateway, the edge proxy), but not while a part it needs is unhealthy;
- the database, the object storage, the metrics store and Redis are not restarted for their health, because a restart in the middle of a write can lose the newest data: they are reported, and they become healthy when the cause is fixed (free disk space, for example);
- a part that crashes again and again is reported.

The first failed start of a part writes an error report. The report keeps what every part said at that moment: the list of the parts and each part's last log lines, with passwords and keys removed. `sudo onprem-ai-ctl start` and the install write the same report when the control plane does not become healthy. The first 5 reports of a part that keeps failing hold the logs; the later ones repeat the message without them. Only the newest 5 error reports on the machine keep their log files: an older report keeps its message, and its `files-left-out.txt` names each file it no longer holds. After 3 starts in 15 minutes, the part is started again only after 15 minutes, then once every hour, until it stays healthy. An update that stopped half way (the machine lost power, for example) is closed as failed, and the release that ran before it is put back before anything starts.

It downloads nothing and changes no setting. It waits while an update, `install`, `start` or `stop` runs. After `sudo onprem-ai-ctl stop` it starts nothing until `sudo onprem-ai-ctl start`, also after a reboot. A part stopped by hand with `docker stop` is started again at the next check: stop the whole control plane with `onprem-ai-ctl stop` instead. At shutdown, the database gets its full shutdown time (60 seconds) to finish writing, on Docker and on Podman. On Docker a second unit, `onprem-ai-control-plane-shutdown.service`, also stops the parts in order, those that use the database first. On Podman, the system stops all parts at the same moment, each with its own shutdown time.

Each part's log is limited to 150 MB on Docker (three files of 50 MB) and 50 MB on Podman, so no part fills the disk; `docker compose logs` shows it, not the system journal.

`sudo onprem-ai-ctl status` shows the last automatic actions, `journalctl -u onprem-ai-control-plane` every one of them, and `sudo onprem-ai-ctl error-reports list` their error reports. A Mac has no systemd: run `sudo onprem-ai-ctl start` after each restart of the Mac or of Docker Desktop.

## What is on the machine

Your settings are in `/etc/onprem-ai/control-plane/config.env`: edit it, then run `sudo onprem-ai-ctl apply`. Every other folder the control plane uses, who writes it and what it promises across releases is in [Files and folders on the machine](/en/platform/docs/guides/machine-administration/files-and-folders/index.md), and what to back up is in [Backing up and restoring](/en/platform/docs/guides/machine-administration/backup-and-restore/index.md). The control plane's certificates name this machine's network addresses and follow them when they change, so a new address needs no reinstall.

A machine that was installed before `config.env` existed has no such file, and its settings are in the generated files. From the moment `config.env` exists, it is the only source of the settings: a setting that it does not name gets its default. So when you create the file on such a machine, write into it every setting in effect that you want to keep. `sudo onprem-ai-ctl doctor` names the files that hold them.

## What is reachable from the network

Two ports, and nothing else, both HTTPS (TLS 1.2 and 1.3 by default; see **Minimum TLS version** below):

| Port | What answers |
|---|---|
| 443 (the inference port) | The models' OpenAI- and Anthropic-compatible API at `https://<this machine>/v1/...`, and every inference node connection: joining, the connection to the control plane, model traffic and metrics |
| 3443 (the control plane port) | The user interface, the control plane's API and MCP, at `https://<this machine>:3443` |

Inference nodes need to reach port 443 only. The control plane port can be limited to the networks your administrators use. To use other port numbers, for example when another program uses 443 or 3443, name them in `/etc/onprem-ai/control-plane/config.env` with `INFERENCE_PORT` and `CONTROL_PLANE_PORT` (for example `INFERENCE_PORT=8443` and `CONTROL_PLANE_PORT=9443`), then run `sudo onprem-ai-ctl apply`. At a new install, write the same two settings as variables before `sh` (see **Settings at the install**). Inference nodes and API clients use this machine's own network address unless you name another one (see **The address inference nodes and API clients use**). This machine listens on these ports, so a router in front of it must forward each port unchanged.

Both ports present certificates from the control plane's own root certificate, naming every IP address of this machine and this machine's address for inference nodes from the Configuration page, so everything works with plain IP addresses. Inference nodes check that the certificate names the address in their install command: when you install them with a DNS name or an address the machine does not have itself, add it under Configuration → Security → Certificates, **Edit names** first. Your browser warns about the certificate until you install the root certificate (Configuration → Security → Certificates, Download Root CA; see the guide **Trusting the control plane in your browser**). The database, the object storage and the metrics store are not reachable from outside the machine.

The user interface and the inference API can present your own certificate instead, from your company's or a public certificate authority: upload it under Configuration → Security → Certificates, or hand it to the installer as files (next section). Inference nodes connect to the inference port too, so the certificate there must name the address in every inference node's install command, and come from a certificate authority the inference node's machine trusts.

### Minimum TLS version

Each port accepts TLS 1.2 and TLS 1.3 by default. Every client that can speak TLS 1.3 (browsers, curl, current SDKs) uses it; TLS 1.2 is there for reverse proxies, older SDKs and corporate middleboxes that cannot, and it is limited to modern encryption (no older cipher suites). Inference nodes always use TLS 1.3, whatever this says.

To refuse TLS 1.2 on a port, choose **TLS 1.3 only** under Configuration → Security → Certificates, **Minimum TLS version**, separately for the inference port and the control plane port. It takes effect within 30 seconds, without a restart. A reverse proxy in front of this control plane that answers its clients with `502 Bad Gateway` while the control plane runs is often one that cannot speak TLS 1.3 to it: keep that port at TLS 1.2.

To fix the value from the deployment instead, set `MINIMUM_TLS_VERSION_INFERENCE_PORT` or `MINIMUM_TLS_VERSION_CONTROL_PLANE_PORT` to `1.2` or `1.3` in `/etc/onprem-ai/control-plane/config.env` and run `sudo onprem-ai-ctl apply`. The page then shows that port's value read-only, with the variable that sets it. Any other value stops the control plane from starting, and its log names the variable and the value.

### Behind a shared router

Several control planes can share one public address behind a router that forwards each connection, still encrypted, by the name it was dialled with: each control plane has its own DNS name (add it under **Edit names**), and the router sends that name's connections to that control plane's ports. The control plane works behind such a router as it is. To see each client's and inference node's own address instead of the router's (in the audit log and on the **Servers** page), set the router to send the PROXY protocol header and name its addresses in `/etc/onprem-ai/control-plane/config.env`, one setting per port:

```sh
TRUSTED_PROXY_ADDRESSES_INFERENCE_PORT=192.0.2.5,198.51.100.0/24
TRUSTED_PROXY_ADDRESSES_CONTROL_PLANE_PORT=192.0.2.5,198.51.100.0/24
```

Set only the ports the router sends the header to. A router may front one port and not the other: for example the inference API public through the router, and the user interface reached directly from your administrators' network. A port cannot take both: once its setting is set, every connection to it must come through the router.

IP addresses or ranges, separated by commas or spaces; empty by default. To trust any address, write `0.0.0.0/0,::/0`: then any machine that can reach that port directly can claim any client address, so use it only when nothing but the router can reach that port (a firewall that lets only the router in). Then run `sudo onprem-ai-ctl apply`. Once set, that port accepts connections only through the router (each must start with the PROXY protocol header), and the address in that header is believed only from the addresses you named. A value that is not an IP address or a range keeps the `edge` service from starting, and its log names the setting and the value (`docker compose --project-name onprem-ai-control-plane logs edge`). The port numbers stay the same.

## Your own certificate from files on the machine

A machine set up by a provisioner (Ansible, cloud-init, Terraform, a Vault agent, cert-manager on the host) often has its certificate as files already. Name them when you install:

```sh
curl -fsSL https://get.onprem.ai/control-plane | TLS_CERTIFICATE_FILE=/etc/pki/onprem-ai/fullchain.pem TLS_PRIVATE_KEY_FILE=/etc/pki/onprem-ai/privkey.pem sh
```

On a machine where the control plane is installed, set `TLS_CERTIFICATE_FILE` and `TLS_PRIVATE_KEY_FILE` in `/etc/onprem-ai/control-plane/config.env`, then run `sudo onprem-ai-ctl install`. The guide **Certificates from files on the machine** says what the files must hold, how the control plane follows renewals, and how to take over from the Configuration page.

## Your own certificate authorities

The control plane trusts the public certificate authorities and the machine's own trust store: when your company's certificate authority is in the machine's trust store, which is usual, it needs no step. For a certificate authority that only the platform should trust, or on a Mac, the machine's folder `/etc/onprem-ai/trusted-certificate-authorities/` (on a Mac: `/Users/Shared/onprem-ai/trusted-certificate-authorities/`) adds to them. The control plane reads both at each start: after a change, run `sudo onprem-ai-ctl restart`.

The guide [Trusting your own certificate authority](/en/platform/docs/guides/certificates-and-network/trusting-your-own-certificate-authority/index.md) shows how to check the trust store, how to add a certificate authority to it or to the folder, the rules for the folder's files, the checks, and every other place a certificate authority goes: each inference node machine, the image downloads and the browsers.

## The address inference nodes and API clients use

Without a choice, the control plane detects this machine's own network address and gives it to inference nodes and API clients, on port 443. A machine reached through a router or a DNS name names that address when it installs, with two settings as variables before `sh`:

```sh
curl -fsSL https://get.onprem.ai/control-plane | API_GATEWAY_PUBLIC_BASE_URL=https://platform.example.com CONTROL_PLANE_ADDRESS=platform.example.com sh
```

`CONTROL_PLANE_ADDRESS` is a hostname or an IP address. `API_GATEWAY_PUBLIC_BASE_URL` is `https://` and that address, with `:<port>` when the inference port is not 443; set `INFERENCE_PORT` to that port then. Inference nodes connect to this machine at this address, and the control plane shows `https://` and this address to API clients as the API gateway's public address. API clients write an IPv6 address in brackets: `https://[fd00::10]/v1`. The control plane takes the address when it first starts on this machine. After that the two change on their own: the address inference nodes use for each control-plane machine under **Configuration → Network → Inference node endpoints** (one section per machine), and the API clients' address under **Configuration → Network → API Gateway endpoints**. Changing the API clients' address moves no inference node.

The user interface, the control plane's API and MCP answer on the control plane port of the same machine, 3443. The setting `CONTROL_PLANE_PORT` names another port.

## Updating from the Updates page

The **Control plane software** section of the Updates page shows the version running and the release offered. The release server names it: the control plane's next step, stable or, when you chose release candidates on the Configuration page, a candidate. A control plane never skips a minor release, so reaching the newest release can take several updates: after each one, the page offers the next step. When an inference node is too far behind for the next step (more than 3 minor releases behind the control plane after it), no release is offered, and the reason names the inference nodes to update first. The page asks the release server each time it opens; when the release server cannot be reached, no update is offered and the page says why.

**Update to** starts the update. The control plane:

1. downloads the new release while it keeps serving;
2. saves the database into `state/database-dumps/` on the machine (the newest three saves are kept), then updates the database, still serving;
3. switches over: the page and the API are unavailable for about a minute, while inference nodes and the models they serve keep running;
4. checks the new version reports healthy.

The page follows the update and shows the new version when it is done. If the new version does not become healthy, the control plane **goes back to the previous version on its own**, with the database put back to how it was before the update, and says so in **Recent updates**: the previous version cannot run on a database the new version updated. The whole database is put back, so a later update that brings the same database change again starts from a clean state. An update that failed in a way you cannot fix carries an error report; send its id to support. Before the control plane goes back, it keeps what every part of the new version said, in `state/updates/<update id>/failed-start/` on the machine: `services.txt` lists the parts and names the ones that were not healthy, and `service-<name>.log` holds one part's last log lines, with passwords and keys removed. The update's log names the folder. The newest 5 of these folders are kept, and the update's log names each one it removes.

An update that stops before it saves the database (a download the network broke, for example) changes nothing: start it again.

An update that does not finish at all, because the machine restarted or the update was ended, is closed the next time the control plane starts on the machine, or when you start the next update. The previous version is put back when the update had switched, and the database is put back from the update's save when its database update had started. **Recent updates** says what happened; start the update again.

If the database cannot be put back (the save is missing or the database refuses it), the control plane stays stopped rather than start the previous version on a database it cannot use, and the message names the save. Restore it as **Backing up and restoring** says, then run `sudo onprem-ai-ctl start`.

On the machine, `sudo onprem-ai-ctl update` runs the same update, for when the page cannot be reached: it asks the release server and takes the one step it names. Run it again for the next step. No command updates the control plane to a release you choose. Every update replaces `onprem-ai-ctl` with the release's, and a rollback puts the previous one back.

### When the page says it cannot update itself

A control plane that was not installed with the one-line installer (a development machine, or one you run with your own compose file) cannot update itself from the page, and the section says so. Update it the way it was installed.

### When the control plane does not come back

If neither the new nor the previous version comes back, run `sudo onprem-ai-ctl doctor` on the machine to see which part does not, then `sudo onprem-ai-ctl start` to start the installed release, `sudo onprem-ai-ctl install` to put it back and start it, or `sudo onprem-ai-ctl update` to take the step the release server names. All three keep the settings and the data.

## Removing the control plane

```sh
sudo onprem-ai-ctl uninstall
```

It shows what it is going to remove and asks you to type the machine's name. It stops the control plane and removes its containers and its release files. It keeps the data: the database, the object storage and the metrics, the secrets, the settings, the certificate files, the container images, the record of the installed release (`state/installed-release/release.json`) and `onprem-ai-ctl` itself. `sudo onprem-ai-ctl install` later comes back as the same control plane, at the release that wrote the data, with its accounts, inference nodes and history.

`--remove-data` removes all of it as well, `onprem-ai-ctl` included. It cannot be undone: an install afterwards is a new control plane with a new root certificate, so the inference nodes that joined this control plane can no longer connect, and each one must be connected to another control plane (`sudo onprem-ai-node connect`, see **Installing an inference node**) or removed. `--dry-run` shows what would be removed and changes nothing; `--yes` does not ask, for scripts. An inference node on the same machine is removed with its own command, `sudo onprem-ai-node uninstall`.
