# Install using the helper script

## Overview

The `go.pcd.run/onprem` helper script automates the on-premises deployment of self-hosted Private Cloud Director. It handles environment preparation tasks that the [self-hosted-install](https://docs.platform9.com/private-cloud-director/getting-started/self-hosted/self-hosted-install "mention") requires you to complete separately, including OpenSSL installation, swap configuration, kernel settings, and package dependencies, so you can deploy with fewer steps.

Use this method if you want a faster path to a running management plane on a network-connected environment. For air-gapped deployments, see [self-hosted-airgap-install](https://docs.platform9.com/private-cloud-director/getting-started/self-hosted/self-hosted-airgap-install "mention").

### Prerequisites

Before running the script, ensure your environment meets the following requirements. Most prerequisites from the [self-hosted-pre-requisites](https://docs.platform9.com/private-cloud-director/getting-started/self-hosted/self-hosted-pre-requisites "mention") are handled automatically by the script. Only the following are required upfront:

* **Passwordless sudo**: The user running the script must have passwordless sudo configured.
* **SSH keys**: SSH key-based access must be set up so that the host running the script can connect to all master and worker nodes without a password prompt.

You also need a Platform9 user agent key. Your Platform9 sales engineer provides this key before installation.

#### Step 1: Set environment variables

The script requires a set of environment variables to run. Export the required variables and any optional ones that apply to your environment.

Replace all values in `<>` with your environment-specific values.

```bash
# Required
export USER_AGENT_KEY="<YOUR_USER_AGENT_KEY>"

# Optional — defaults shown
export SSH_KEY_PATH="<SSH_KEY_PATH>"           # Default: "${HOME}/.ssh/id_rsa"
export SSH_USER="<SSH_USER>"                   # Default: current user
export PCD_VERSION="<PCD_VERSION>"             # Default: "latest"

# Optional — proxy settings
export HTTPS_PROXY=""
export HTTP_PROXY=""
export NO_PROXY=""

# Optional — custom storage and options overrides
export AIRCTL_CUSTOM_CSI_FILES_PATH="<PATH_TO_DIR>"             # Required for custom storage class
export AIRCTL_OPTIONS_OVERRIDES_FILE_PATH="<PATH_TO_JSON_FILE>" # Required for options.json overrides
```

#### Step 2: Deploy <code class="expression">space.vars.product\_acronym</code>

Choose one of the following methods. Both methods require the environment variables from Step 1 to be exported first.

**Method 1: Environment variable-based installation**

Export your deployment parameters as environment variables, then run the script. Replace all values in `<>` with your environment-specific values.

```bash
export AIRCTL_MASTER_IPS="<MASTER_IP_1>,<MASTER_IP_2>,<MASTER_IP_3>" && \
export AIRCTL_MASTER_VIP4=<MASTER_VIP_IPV4> && \
export AIRCTL_REGIONS="<REGION_NAME>" && \
export AIRCTL_DU_FQDN=<DU_FQDN> && \
export AIRCTL_EXTERNAL_IP4=<EXTERNAL_IPV4> && \
export AIRCTL_STORAGE_PROVIDER="hostpath-provisioner" && \
export AIRCTL_NFS_IP=<NFS_SERVER_IP> && \
export AIRCTL_NFS_SHARE="<NFS_SHARE_PATH>" && \
export AIRCTL_IPV4_ENABLED=true && \
export AIRCTL_MASTER_VIP_INTERFACE=<INTERFACE_NAME>
```

To derive the full list of available environment variables, refer to the `airctl configure` flag list in the [airctl](https://docs.platform9.com/private-cloud-director/getting-started/self-hosted/airctl "mention"). Each long flag maps to an environment variable by prepending `AIRCTL_`, converting to uppercase, and replacing hyphens with underscores. For example, `--du-fqdn` becomes `AIRCTL_DU_FQDN`.

After exporting your variables, run the script:

```bash
curl -sS https://go.pcd.run/onprem | bash
```

**Method 2: Flag-based installation**

Pass deployment parameters directly to the script as flags. Replace all values in `<>` with your environment-specific values.

```bash
curl -sS https://go.pcd.run/onprem | bash -s -- \
  --du-fqdn <DU_FQDN> \
  --external-ip4 <EXTERNAL_IPV4> \
  --ipv4-enabled \
  --master-ips <MASTER_IP_1>,<MASTER_IP_2>,<MASTER_IP_3> \
  --master-vip-interface <INTERFACE_NAME> \
  --master-vip4 <MASTER_VIP_IPV4> \
  --nfs-ip <NFS_SERVER_IP> \
  --nfs-share <NFS_SHARE_PATH> \
  --storage-provider hostpath-provisioner \
  --regions "<REGION_NAME>"
```

For the full list of supported flags, see [#configuration-commands](https://docs.platform9.com/private-cloud-director/getting-started/airctl#configuration-commands "mention") in the Airctl Reference.

{% hint style="info" %}
**NOTE**

The basic environment variables from Step 1, including `USER_AGENT_KEY`  are required regardless of which method you use
{% endhint %}

### Proxy configuration (optional)

If your environment routes traffic through a network proxy, export the proxy variables before running the script. Replace all values in `<>` with your environment-specific values.

The `NO_PROXY` list must include all master node IPs, worker node IPs, `EXTERNAL_IP4`, and `MASTER_VIP4`, along with any other addresses that should bypass the proxy.

```bash
export HTTPS_PROXY="http://<PROXY_HOST>:<PROXY_PORT>"
export HTTP_PROXY="http://<PROXY_HOST>:<PROXY_PORT>"
export NO_PROXY="<MASTER_IP_1>,<MASTER_IP_2>,<MASTER_IP_3>,<EXTERNAL_IPV4>,<MASTER_VIP_IPV4>,127.0.0.1,10.20.0.0/22,localhost,::1,.svc,.svc.cluster.local,10.21.0.0/16,10.20.0.0/16,.cluster.local,.default.svc"
```

### Custom CSI storage backend (optional)

By default, the script uses `hostpath-provisioner` as the storage provider. To use a custom CSI storage backend instead, complete the following steps before running the script.

1. Create a directory and place your custom `StorageClass` YAML files in it.
2. Export the path to that directory:

```bash
export AIRCTL_CUSTOM_CSI_FILES_PATH="<PATH_TO_DIR>"
```

3. Set the storage provider to `custom` using the appropriate variable or flag for your chosen method:
   * Environment variable: `AIRCTL_STORAGE_PROVIDER="custom"`
   * Flag: `--storage-provider custom`

{% hint style="warning" %}
**NOTE**

Your custom YAML files must include at least one storage class named `pcd-sc`, along with all storage classes referenced in `options.json` if you are using an overrides file.
{% endhint %}

### Overriding default options.json (optional)

To customize storage classes per component or adjust management plane deployment settings, you can override fields in the default `options.json`.

1. Create a JSON file containing only the fields you want to add or override.
2. Export the path to that file before running the script:

```bash
export AIRCTL_OPTIONS_OVERRIDES_FILE_PATH="<PATH_TO_JSON_FILE>"
```

{% hint style="info" %}
**NOTE**

This variable cannot be passed as a flag to the script. It must be exported as an environment variable.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.platform9.com/private-cloud-director/getting-started/self-hosted/install-using-the-helper-script.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
