> ## Documentation Index
> Fetch the complete documentation index at: https://anaconda.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Standard installation

export const Danger = ({children}) => {
  return <div class="callout my-4 px-5 py-4 overflow-hidden rounded-2xl flex gap-3 border danger-admonition dark:danger-admonition" data-callout-type="danger">
      <div class="mt-0.5 w-4">
        <svg width="14" height="14" viewBox="0 0 14 14" fill="rgb(239, 68, 68)" xmlns="http://www.w3.org/2000/svg" class="w-4 h-4 text-sky-500" aria-label="Danger">
          <path fill-rule="evenodd" clip-rule="evenodd" d="M7 1.3C10.14 1.3 12.7 3.86 12.7 7C12.7 10.14 10.14 12.7 7 12.7C5.48908 12.6974 4.0408 12.096 2.97241 11.0276C1.90403 9.9592 1.30264 8.51092 1.3 7C1.3 3.86 3.86 1.3 7 1.3ZM7 0C3.14 0 0 3.14 0 7C0 10.86 3.14 14 7 14C10.86 14 14 10.86 14 7C14 3.14 10.86 0 7 0ZM8 3H6V8H8V3ZM8 9H6V11H8V9Z"></path>
        </svg>
      </div>
      <div class="text-sm prose min-w-0 w-full">
        {children}
      </div>
    </div>;
};

This topic provides guidance on installing Package Security Manager (On-prem) and verifying your installation.

<Note>
  To successfully install Package Security Manager, you must have already prepared your environment according to the [Standard environment preparation](/docs/psm-on-prem/6.6.3/prep/standard-prep) topic.
</Note>

## Installing Package Security Manager (On-prem)

1. Download your installer by running the following command:

   ```sh theme={null}
   # Replace <INSTALLER_LOCATION> with the provided installer URL
   curl -O <INSTALLER_LOCATION>
   ```

   <Warning>
     If you do not have root access, you must add yourself to the docker group by running the following command before you install:

     ```sh theme={null}
     # Replace <USERNAME> with your Anaconda username
     usermod -a -G docker <USERNAME>
     ```
   </Warning>

2. Run one of the following installation commands. Choose the command that corresponds with your setup.

   <Tabs>
     <Tab title="HTTP">
       ```sh theme={null}
       # Replace <INSTALLER> with the installer you just downloaded
       # Replace <FQDN> with the fully qualified domain name of your Package Security Manager instance
       sudo bash <INSTALLER> --keep -- --domain <FQDN> --default-user anaconda
       ```

       <Note>
         To include Grafana monitoring dashboards in your installation of Package Security Manager, add the following argument to your installation command:

         ```sh theme={null}
         --grafana-monitor-stack
         ```
       </Note>
     </Tab>

     <Tab title="HTTPS">
       If you are using TLS/SSL certificates, run this command to install Package Security Manager:

       ```sh theme={null}
       # Replace <INSTALLER> with the installer you just downloaded
       # Replace <FQDN> with the fully qualified domain name of your Package Security Manager instance
       # Replace <PATH_TO_CERT> with the path to your TLS/SSL cert
       # Replace <PATH_TO_KEY> with the path to your TLS/SSL key
       sudo bash <INSTALLER> --keep -- --domain <FQDN> --tls-cert <PATH_TO_CERT> --tls-key <PATH_TO_KEY> --default-user anaconda
       ```

       <Note>
         To include Grafana monitoring dashboards in your installation of Package Security Manager, add the following argument to your installation command:

         ```sh theme={null}
         --grafana-monitor-stack
         ```
       </Note>
     </Tab>

     <Tab title="External Postgres and Redis">
       <Warning>
         You must be using Postgres version 9.6 or later and Redis version 6.0 or later.
       </Warning>

       ```sh theme={null}
         # Replace <INSTALLER> with the installer file you just downloaded
         # Replace <FQDN> with the fully qualified domain name of your Package Security Manager instance
         # Replace <PATH_TO_CERT> with the path to your TLS/SSL cert
         # Replace <PATH_TO_KEY> with the path to your TLS/SSL key
         # Replace <EXTERNAL_PG/RD_INSTANCE_IP4> with your external instance IP4 address (in both locations)
         # Replace <ASSIGNED_PORT> with the port used for communication
         # Replace <POSTGRES_USERID> with your postgres user ID
         # Replace <POSTGRES_PASSWORD> with your postgres password
         chmod +x <INSTALLER>
         bash <INSTALLER> --keep -- --domain <FQDN> --tls-cert <PATH_TO_CERT> --tls-key <PATH_TO_KEY> -e redis://<EXTERNAL_PS/RD_INSTANCE_IP4> -h <EXTERNAL_PS/RD_INSTANCE_IP4> -p <ASSIGNED_PORT> -u <POSTGRES_USERID> -pw <POSTGRES_PASSWORD> --default-user anaconda -y
       ```

       <Note>
         To include Grafana monitoring dashboards in your installation of Package Security Manager, add the following argument to your installation command:

         ```sh theme={null}
         --grafana-monitor-stack
         ```
       </Note>
     </Tab>
   </Tabs>

   The installation process creates three distinct user profiles: one for administrating Package Security Manager, one for administrating Keycloak, and one for accessing Prometheus. Login credentials for these profiles are shown during the installer output. Use these credentials for your initial logins, and update them as soon as possible.

   <Accordion title="Example output">
     ```sh theme={null}
     KeyCloak admin user: 'admin'
     KeyCloak admin password: 'B1EpU33Wasdfh0Z64LL767cD'

     Updating Keycloak settings ...
     Default user: 'anaconda' password: '8aZ6302Ssd34ge415Ld97I'

     Prometheus admin user:
     username=admin
     Generated password for prometheus
     password=34ab35y63CUJak6asdf2Am7z40z7lhG8
     ```

     <Note>
       The Prometheus password cannot currently be updated. Save your password somewhere secure!
     </Note>
   </Accordion>

   <Note>
     The installer directory contains both the installation script (`install.sh`) and the `docker-compose.yml` file, which defines how Package Security Manager services are run.

     By default, `/opt/anaconda/repo` is the file path for the installation folder. You can either create the folder manually by assigning write access to the current user, or use the `-b` (`--base-install-dir`) parameter to specify the folder for your installation.
   </Note>

   <Danger>
     Never delete the directory containing the `docker-compose.yml` and `.env` files.
   </Danger>

## Verifying your installation

Services are one-to-one to containers. Therefore, verifying that all major containers are up and not restarting or failing is a good first step.

1. Return to your terminal and run the following command:

   ```sh theme={null}
   docker ps
   ```

   You should see output similar to the following:

   <Frame>
     <img src="https://mintcdn.com/anaconda-29683c67/GAawxvWy-HUVSCqf/images/output_2.png?fit=max&auto=format&n=GAawxvWy-HUVSCqf&q=85&s=a3921d75a977968ca72bbcfdb4c7e67d" alt="" width="1792" height="338" data-path="images/output_2.png" />
   </Frame>

2. Verify that the following containers appear with a `STATUS` of `Up` (not stuck in a restart loop) in the output:

   ```sh theme={null}
   repo_api
   repo_worker
   repo_dispatcher
   proxy
   nginx_proxy
   keycloak
   redis
   postgres
   ```

   These containers should always be running. However, you might see additional containers, depending on the phase of installation or your initial configuration choices:

   <Accordion title="Additional containers">
     ```sh theme={null}
     loki
     grafana
     promtail
     prometheus
     node_exporter
     redis-exporter
     postgres-exporter
     ```
   </Accordion>

3. Open a browser and navigate to the domain that you supplied when executing the installer. If you are able to successfully authenticate and are asked for a license, Package Security Manager has installed successfully.

## Advanced options

Further installation options can be seen by running the following command:

```sh theme={null}
# Replace <INSTALLER> with your installer file
./<INSTALLER>/install.sh --help
```

This will present you with the following list of possible arguments:

| **Arguments (shorthand)** | **Arguments (longhand)** | **Description**                                                        |
| :------------------------ | :----------------------- | :--------------------------------------------------------------------- |
| `-r`                      | `--registry`             | Docker registry, `url:port` (default uses the system Docker daemon)    |
| `-h`                      | `--pg-host`              | Postgresql host (default is on internal Postgres instance)             |
| `-p`                      | `--pg-port`              | Postgresql port                                                        |
| `-u`                      | `--pg-user`              | Postgresql user                                                        |
| `-pw`                     | `--pg-password`          | Postgresql password (will set the internal Postgres instance password) |
| `-e`                      | `--redis`                | Redis URL (default is an internal Redis instance)                      |
| `-d`                      | `--domain`               | External domain (or IP) of host system                                 |
| `-c`                      | `--tls-cert`             | Path to TLS certification file for optionally configuring HTTPS        |
| `-k`                      | `--tls-key`              | Path to TLS key file for optionally configuring HTTPS                  |
|                           | `--default-user`         | Default user name                                                      |
|                           | `--custom-ca-cert`       | Path to custom CA certification, which should be respected             |
|                           | `--custom-cve-source`    | For Airgapped environments provide a custom source for CVE data        |
|                           | `--upgrade-from`         | Previous install folder                                                |
| `-l`                      | `--no-image-load`        | Don’t load Docker images                                               |
| `-y`                      | `--no-prompt`            | Answer yes to all prompts                                              |
|                           | `-- help`                | Print help text                                                        |
