> ## 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.

# Getting started with Package Security Manager (Cloud)

## Before you begin

Using Package Security Manager (Cloud) requires membership to an [organization](https://anaconda.com/docs/anaconda-platform/admin/organizations) with a current [subscription](https://anaconda.com/docs/anaconda-platform/subscriptions.md). If you're working with an Anaconda representative, they will create and subscribe your organization for you.

To get started:

1. Install conda on your computer.
2. Authenticate with `anaconda login`.
3. Configure access to your organization's channels (A location (URL or file path) in a repository where conda looks for packages.).

Once conda is configured, you can start building environments (A self-contained, isolated space for installing and running software packages.) for your projects using secure, approved packages (Software files and information about the software, such as its name, version, and description, bundled into a file that can be installed and managed by a package manager.).

## Installing conda

You can obtain conda by installing either Anaconda Distribution or Miniconda.

> [!NOTE]
>
> If you already have conda installed, skip ahead to [Authenticating to Package Security Manager (Cloud)](#authenticating-to-package-security-manager-cloud).

If you do not have conda installed, [install it now](https://anaconda.com/docs/getting-started/installation.md) and return to this page when you're done.

## Authenticating to Package Security Manager (Cloud)

> [!WARNING]
>
> You must be [assigned a seat](https://anaconda.com/docs/anaconda-platform/admin/members.md#assigning-organization-seats) within your organization before you can authenticate. If you have not been assigned a seat, contact your organization administrator.
>
> ***
>
> Package Security Manager (Cloud) requires the latest version of `anaconda-auth`. If you already have `anaconda-auth` installed, update it to the latest version before authenticating.

1. Open Anaconda Prompt (A command-line application included with Windows installations of Anaconda Distribution and Miniconda. Find it by searching 'Anaconda Prompt' in the Windows Start menu.) (Terminal on macOS/Linux).

2. Verify that `anaconda-auth` is installed:

   ```sh theme={null}
   conda list --name base anaconda-auth
   ```

   If the output does not display package information, install it:

   ```sh theme={null}
   conda install --name base anaconda-auth
   ```

3. Log in to Anaconda:

   ```sh theme={null}
   anaconda login
   ```

   A browser window opens to complete the authentication process. If your organization has configured SSO, you are redirected to your company's SSO login page.

   > [!NOTE]
   >
   > If you belong to more than one organization, use the arrow keys to select the organization you want to authenticate to.

### API key storage

After authentication completes, an API key is generated and stored in your keyring:

> [tab] Windows
>
> `C:\Users\<USERNAME>\.anaconda\keyring`

> [tab] macOS/Linux
>
> `~/.anaconda/keyring`

### Environment logging setup

If your organization has [environment logging enabled](https://anaconda.com/docs/anaconda-platform/admin/environments.md#enabling-environment-logging), `anaconda login` prompts you to install the necessary plugins for environment logging and scanning. After setup, conda automatically logs any environment you create or update to your registered organization.

```text wrap theme={null}
(base) ➜  ~ anaconda login
Anaconda Environment Manager is required by your organization. It is recommended to install. Proceed? [y/n] (y): y
Installing anaconda-env-manager...
✔︎ anaconda-env-manager installed successfully.
Only one organization found, automatically selecting: my-organization
Linking this machine to organization my-organization...
✔ This machine is now registered with my-organization. Conda environments will be logged to this organization.
```

> [!NOTE]
>
> If you belong to multiple organizations, you are prompted to select one organization from the list before registration completes.

For more information, see [Environment logging and scanning](https://anaconda.com/docs/anaconda-platform/user/environments.md).

### Issuing and setting your token

Your organization access token grants conda access to your organization's channels and packages. To issue and set your token, run the following command:

> [!NOTE]
>
> If you belong to more than one organization, you are prompted to select which organization to issue a token for.

```sh theme={null}
anaconda token install
```

> [!NOTE]
>
> If your organization is using a [site token](https://anaconda.com/docs/anaconda-platform/admin/site-token.md), your organization administrator will provide the token to you directly. Set it by running the following command:
>
> ```sh theme={null}
> anaconda token install <TOKEN>
> ```
>
> Comments
>
> Replace \<TOKEN> with the site token provided by your organization administrator.

## Configuring conda to use organization channels

To access packages from your organization's channels, add them to your `.condarc` file:

1. Log in to [anaconda.com/app](https://anaconda.com/app).

2. Select  **Channels** from the left-hand navigation.

3. Click  **Copy channel path**.

   ![Copy channel path button](https://mintcdn.com/anaconda-29683c67/XTSpR8a-Sn-FW1SQ/images/anaconda-platform/ap_copy_channel_path.png?fit=max\&auto=format\&n=XTSpR8a-Sn-FW1SQ\&q=85\&s=d26a6e0aa983c4d9722548552b1e3881)

4. Open Anaconda Prompt (A command-line application included with Windows installations of Anaconda Distribution and Miniconda. Find it by searching 'Anaconda Prompt' in the Windows Start menu.) (Terminal on macOS/Linux) and run the following command:

   ```sh theme={null}
   conda config --prepend channels <CHANNEL_PATH>
   ```

   Comments

   Replace \<CHANNEL\_PATH> with the copied channel path.

   This adds the specified channel to the top of your `channels:` list, giving it top priority when conda searches for packages.

   ```yaml Example .condarc file highlight={5} theme={null}
   channel_settings:
     - channel: https://repo.anaconda.cloud/*
       auth: anaconda-auth
   channels:
     - https://repo.anaconda.cloud/repo/<ORG_ID>/<CHANNEL_NAME>
     - defaults
   add_anaconda_token: true
   default_channels:
     - https://repo.anaconda.cloud/repo/main
   ```

   > [!NOTE]
   >
   > If you want to use your organization's channels exclusively, ensure they are the only channels in your `.condarc`'s `channels:` list.

For more information about managing channels, see [Channels](https://anaconda.com/docs/anaconda-platform/user/channels.md).

## Using Anaconda behind a firewall or proxy (Optional)

Some companies have security policies that prevent communications on their network with external servers like Anaconda. Under these circumstances, you'll need to connect to your company's firewall/proxy server in order to download packages successfully.

To connect to a firewall/proxy server, you'll need to include a `proxy_servers:` section in the `.condarc` file that contains the URL to the proxy server. This entry must also contain a username and password for logging in to the proxy server. Speak with your IT Administrator if you do not have this information.

There are no commands to include this portion of the `.condarc` file, so you need to manually include the following lines:

> [!WARNING]
>
> If your password contains special characters, you'll need to [escape them using percent encoding as described here](https://en.wikipedia.org/wiki/Percent-encoding#Percent-encoding_reserved_characters).

```sh theme={null}
proxy_servers:
  http: http://<USERNAME>:<PASSWORD>@<URL>:8080
  https: https://<USERNAME>:<PASSWORD>@<URL>:8443
```

Comments

Replace \<USERNAME> with the username for your proxy server.\\

Replace \<PASSWORD> with the password for your proxy server.\\

Replace \<URL> with the URL to your proxy server.

You'll also need to work with your IT team to allowlist connections to the main package repositories once you've configured your connection to the firewall/proxy server. The main package repositories are:

```sh theme={null}
https://conda.anaconda.org
https://repo.anaconda.com
https://repo.anaconda.cloud
```

In some situations, it is necessary to export the `HTTP_PROXY` and `HTTPS_PROXY` environment variables to utilize the proxy server. To export your environment variables, open a terminal and run the following commands:

```sh theme={null}
export HTTP_PROXY=http://<USERNAME>:<PASSWORD>@<URL>:8080
export HTTPS_PROXY=https://<USERNAME>:<PASSWORD>@<URL>:8443
```

Comments

Replace \<USERNAME> with the username for your proxy server.\\

Replace \<PASSWORD> with the password for your proxy server.\\

Replace \<URL> with the URL to your proxy server.

For more information about using conda behind a proxy server, see [Configure conda for use behind a proxy server](https://docs.conda.io/projects/conda/en/latest/user-guide/configuration/settings.html#proxy-servers-configure-conda-for-use-behind-a-proxy-server).

## Verifying your configuration

Test your configuration by creating an environment and installing a package:

1. Create a test environment:

   ```sh theme={null}
   conda create --name <ENV_NAME>
   ```

   Comments

   Replace \<ENV\_NAME> with a name for your environment.

2. Verify the environment was created:

   ```sh theme={null}
   conda env list
   ```

3. Activate the environment:

   ```sh theme={null}
   conda activate <ENV_NAME>
   ```

   Comments

   Replace \<ENV\_NAME> with the name of your environment.

4. Install a package:

   ```sh theme={null}
   conda install <PKG_NAME>
   ```

   Comments

   Replace \<PKG\_NAME> with the name of the package you want to download from your channel.

5. If necessary, delete the environment to clean up:

   ```sh theme={null}
   conda env remove --name <ENV_NAME>
   ```

   Comments

   Replace \<ENV\_NAME> with the name of your environment.
