# Outbound proxy

> What you set up and what the platform does when the machines reach the internet only through a forward proxy, including a proxy that inspects TLS - every outbound connection, its proxy setting and its trust (the machine's own trust store), the steps in order, the checks, and what to do when a connection fails.

## When you need it

You need this guide when a machine of the platform reaches the internet only through a proxy server: an outbound proxy. It covers a proxy that only passes connections on, and a proxy that decrypts and inspects TLS (common in banks, government and large companies). For a proxy that stands in front of the control plane and that clients come in through, a different setup applies. When the machines reach the internet directly, you need neither.

## Every outbound connection

| Connection | Its proxy setting | What it trusts |
|---|---|---|
| The one-line installer | For the control plane, the variable `HTTPS_PROXY` of the install command; for an inference node, `--outbound-proxy-url` of the install command | The public certificate authorities, the machine's trust store, and the folder `/etc/onprem-ai/trusted-certificate-authorities/` |
| `onprem-ai-ctl` on the control plane's machine (install, update, start, restart) | `HTTPS_PROXY` and `NO_PROXY` in `/etc/onprem-ai/control-plane/config.env` | The machine's trust store and the folder |
| The control plane: release check and updates, license check, model storage, git catalogs, single sign-on | `HTTPS_PROXY` and `NO_PROXY` in `/etc/onprem-ai/control-plane/config.env` | The public certificate authorities, the machine's trust store and the folder |
| The inference node: its connection to the control plane, model downloads, software updates, metrics | `/etc/onprem-ai/inference-node/config.env`, written by `--outbound-proxy-url` of its install command | Its own machine's trust store and folder |
| Image downloads, on every machine | The container engine's own proxy setting (Docker or Podman) | The machine's trust store, and the folder through the files the platform writes into the engine's `certs.d` for each registry (on Docker, not for Docker Hub) |

All connections except the image downloads take the proxy from the platform's config file: on the control plane's machine `/etc/onprem-ai/control-plane/config.env`, on an inference node `/etc/onprem-ai/inference-node/config.env`. A first install writes it: the control plane's from the variables `HTTPS_PROXY` and `NO_PROXY` of its install command, the inference node's from the options `--outbound-proxy-url` and `--outbound-proxy-exceptions` of its install command. The image downloads take it from Docker or Podman, which you set up yourself. When you install Docker or other packages through the machine's package manager, it needs the proxy too (Step 2).

The config files accept `HTTPS_PROXY`, `HTTP_PROXY`, `NO_PROXY` and `ALL_PROXY`, each in upper or lower case. Paste your usual proxy block.

Every connection trusts the machine's own trust store. When your company's certificate authority is there, which is usual, the platform needs no certificate step of yours.

## Who does what

| You | The platform |
|---|---|
| Allow the destinations on the proxy and the firewall (see **Before you start**) | Writes the proxy and its exceptions into the config file at a first install, and keeps them for every later run and update |
| Have the proxy's certificate authority in each machine's trust store, before the install (usually the machine's template or configuration management puts it there) | Trusts the machine's trust store on every connection it opens, and the folder `/etc/onprem-ai/trusted-certificate-authorities/` for a certificate authority only the platform should trust. It never changes the machine's trust store |
| Set the proxy in Docker or Podman on each machine, and keep it the same as the platform's | Writes the folder's certificates into the engine's `certs.d` for each registry, before each image download. It never changes the engine's proxy setting |
| Restart Docker after a change to the machine's trust store | Names the cause and the fix when a download fails, with both proxy settings, and writes an error report |
| Name the proxy in the install command of the control plane and of each inference node | Tests a new proxy with one request before it saves it, and keeps the traffic between its own services on a machine away from the proxy |
| Change the proxy when it changes: edit the config file, then `sudo onprem-ai-ctl apply` on the control plane's machine | Shows the saved proxy and checks the connections through it: **Configuration → Network → Outbound proxy**, `sudo onprem-ai-ctl doctor`, `sudo onprem-ai-node doctor` |

The platform changes nothing on the machine outside its own folders and its own `certs.d` files. The engine's proxy and the machine's trust store stay yours: your configuration management can own them.

## Before you start

Ask your network team for:

- The proxy's address, `http://<host>:<port>`, and a user name and password when the proxy asks for them.
- When the proxy inspects TLS: its root certificate authority, in PEM format. A PEM file starts with `-----BEGIN CERTIFICATE-----`.
- Outbound HTTPS (port 443) through the proxy to:
  - `get.onprem.ai`: the installer, the software releases, the address check of the inference nodes
  - `platform.registry.onprem.ai`: the platform's images
  - `entitlement.api.onprem.ai`: the license check
  - `license.api.onprem.ai`: model storage
  - `docker.io` and `*.docker.com`: images from Docker Hub
  - the registries and model sources of the models you deploy, for example `ghcr.io`, `nvcr.io` and `huggingface.co`

The inference nodes connect to the control plane on its inference port. When that connection goes through the proxy too, allow it there. Otherwise list the control plane's address in `--outbound-proxy-exceptions` of the inference node's install command.

## Step 1: the proxy's certificate authority

Only when the proxy inspects TLS. On each machine, before the install, check that the machine trusts the proxy:

```sh
export HTTPS_PROXY=http://proxy.example.com:3128
curl -sS -o /dev/null -w '%{http_code}\n' https://get.onprem.ai/platform
```

A status of `200` or `3xx` means it works: the proxy's certificate authority is in the machine's trust store, and nothing more is needed. Do not test the root path `https://get.onprem.ai/`: it answers `404`, even without a proxy. `SSL certificate problem` means it is not: add it to the trust store, as the guide [Trusting your own certificate authority](/en/platform/docs/guides/certificates-and-network/trusting-your-own-certificate-authority/index.md) shows, then restart Docker. That guide also shows the platform's own folder, for a certificate authority only the platform should trust.

## Step 2: the proxy for the package manager, Docker and Podman

On each machine.

**The package manager.** When you install Docker or other packages through the machine's package manager, it needs the proxy too. On Debian and Ubuntu, as root, write `/etc/apt/apt.conf.d/95proxy`:

```text
Acquire::http::Proxy "http://proxy.example.com:3128";
Acquire::https::Proxy "http://proxy.example.com:3128";
```

On Rocky Linux, RHEL and Fedora, add this line to `/etc/dnf/dnf.conf`:

```text
proxy=http://proxy.example.com:3128
```

**Docker and Podman.** They download the images themselves, with their own proxy setting.

Docker: as root, write `/etc/systemd/system/docker.service.d/http-proxy.conf`:

```ini
[Service]
Environment="HTTPS_PROXY=http://proxy.example.com:3128"
Environment="NO_PROXY=localhost,127.0.0.1"
```

Then:

```sh
sudo systemctl daemon-reload
sudo systemctl restart docker
```

Restarting Docker restarts the containers on that machine. `docker info` now shows the proxy under `HTTPS Proxy`. To check it: `docker pull hello-world`.

Podman: set the same two variables in the `[engine]` section's `env` list in `/etc/containers/containers.conf`.

On Rocky Linux and RHEL 10, and on the EL10 cloud images, Docker 29 needs the package `kernel-modules-extra` for the running kernel. Without it the Docker daemon does not start, and its log says "failed to add jump rules to ipv4 NAT table". Install it before you start Docker:

```sh
sudo dnf install kernel-modules-extra-$(uname -r)
sudo modprobe xt_addrtype
```

Docker and Podman trust the machine's trust store, so Step 1 covers the image downloads too, Docker Hub included. A certificate authority that is only in the platform's folder does not cover Docker Hub on Docker: see the guide [Trusting your own certificate authority](/en/platform/docs/guides/certificates-and-network/trusting-your-own-certificate-authority/index.md), section Docker Hub on Docker.

## Step 3: the install commands

A first install writes the proxy into the config file. Later, you change it in the file (see **Changing the proxy**).

`curl` downloads the installer before the installer runs, so `curl` needs the proxy too. Export it in the shell first:

```sh
export HTTPS_PROXY=http://proxy.example.com:3128
```

A variable that you write before `sh` reaches only the installer, not `curl`. Without the `export`, give the proxy to `curl` with its own option: `curl -x http://proxy.example.com:3128 -fsSL ...`.

`curl` trusts the machine's trust store, so after Step 1 it needs nothing more. When the proxy's certificate authority is only in the platform's folder, add `--cacert /etc/onprem-ai/trusted-certificate-authorities/corp-root-ca.pem` to the `curl` command; the installer itself trusts the folder.

The control plane takes the proxy as two variables before `sh`, named as its settings are:

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

A new install writes both into `/etc/onprem-ai/control-plane/config.env`. On a machine where the control plane is installed, the variables change nothing: see **Changing the proxy**.

Each inference node takes the proxy as two options:

```sh
curl -fsSL https://get.onprem.ai/node | sh -s -- \
  --control-plane-gateway-address 192.168.0.250 \
  --control-plane-root-certificate-sha256 <fingerprint> --join-token <token> \
  --outbound-proxy-url http://proxy.example.com:3128 --outbound-proxy-exceptions 192.168.0.0/16
```

The one-line install of both on one machine (`https://get.onprem.ai/platform`) takes the inference node's two options, and gives the proxy to both.

- `HTTPS_PROXY` (for an inference node `--outbound-proxy-url`) is the proxy's address, `http://<host>:<port>`. When the proxy asks for a user name and password, they go before the host: `http://user:password@proxy.example.com:3128`. The password is never printed: the installs, the Configuration page, both `doctor` commands, the inference node's log and audit log, and every error report show `[REDACTED]` in its place.
- `NO_PROXY` (for an inference node `--outbound-proxy-exceptions`) lists the destinations the machine reaches directly, separated by commas: host names, domains (`.example.com` covers every name under it), IP addresses and address ranges (`192.168.0.0/16`). Leave it out when every connection goes through the proxy. The platform's own services on a machine never use the proxy, and need no entry.

The control plane's install tests a new proxy with one request to the software release server before it saves it. A proxy that fails the request stops the install, names the reason and the next step, and saves nothing.

## How the connection to the control plane passes the proxy

The proxy only passes the inference node's connection along. The inference node and the control plane check each other's certificates end to end, as without a proxy. A proxy that inspects TLS carries the connection too, with nothing to exempt, as long as the machine trusts the proxy's certificate authority: the connection carries a second encrypted connection inside it, which the proxy passes on but cannot read.

Only a proxy that answers inside that connection with its own certificate, or that blocks the WebSocket connections the inference node opens, cannot carry it. The inference node then says so. Exempt the control plane's address from TLS inspection on the proxy, or add it to `--outbound-proxy-exceptions` of the inference node's install command when the machine can reach it directly.

## Changing the proxy

- The control plane: edit `HTTPS_PROXY` and `NO_PROXY` in `/etc/onprem-ai/control-plane/config.env` (the spellings above all work), then run `sudo onprem-ai-ctl apply`. Remove the lines to remove the proxy. A reboot and `onprem-ai-ctl start` do not read the file; `apply` and `onprem-ai-ctl restart` do. `sudo onprem-ai-ctl update` and the updates on the Configuration page take the proxy of the file.
- An inference node: run its install command again with the new values, or edit `HTTPS_PROXY` and `NO_PROXY` in `/etc/onprem-ai/inference-node/config.env` (the old path `/etc/onprem-ai/inference-node.env` is still read) and run `sudo systemctl restart onprem-ai-inference-node`. Leaving the options out of the install command keeps what the file says.
- Docker or Podman: change their setting as in Step 2. The platform does not change it.

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.

## Check the result

- **Configuration → Network → Outbound proxy** shows the saved proxy and the exceptions. **Check connections** tests the connections through it: the software release server, the license server and model storage.
- `sudo onprem-ai-ctl doctor` on the control plane's machine: the proxy in effect, the edits that wait for `apply`, one request through it, Docker's proxy compared with the platform's, the trusted certificate authorities, and the image download certificates.
- `sudo onprem-ai-node doctor` on each inference node machine: the proxy, whether the control plane can be reached through it, and the trusted certificate authorities.
- `docker info` on each machine: the engine's own proxy, under `HTTPS Proxy`.

## When it does not work

| Symptom | Cause | Fix |
|---|---|---|
| `curl` stops before the installer starts, with `SSL certificate problem` | The machine's trust store does not hold the proxy's certificate authority | Step 1 |
| The installer stops with "the server's certificate is not trusted (curl exit 60)" | Neither the machine's trust store nor the folder holds the proxy's certificate authority | Step 1, then run the install again |
| The installer names a file "Not trusting for the downloads" | The file breaks a rule of the folder | The fix the line names, then run the install again |
| The install stops at "Downloading the images" with `connection reset by peer` or a timeout | Docker or Podman has no proxy, or not the right one | Step 2, then run the install again |
| The install stops at "Downloading the images" with a certificate error | Docker does not trust the proxy's certificate authority: it is not in the machine's trust store, or Docker did not restart after it was added | Step 1, `sudo systemctl restart docker`, then run the install again |
| The install stops at "Testing the forward proxy" | The proxy cannot be reached, refuses the connection, asks for a password, or presents a certificate the machine does not trust | The cause and the fix the install names |
| An update from the Updates page fails at the image download | Docker or Podman lost its proxy setting, or it differs from the saved one | Step 2 on the control plane's machine, then update again |
| An inference node cannot connect, the control plane can | The node's configuration file has no proxy, or its machine does not trust the proxy's certificate authority | `sudo onprem-ai-node doctor` names which. Step 1 or Step 3 on that machine |
