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

# Registering your conda client

Anaconda requires a one-time registration when connecting from certain networks or IP addresses. If your conda client directed you to this page, it's because you're connecting from a network that requires registration. Registration is quick and painless, and gives you access to powerful cloud features like browser-hosted notebooks, environment backups, project syncing, and effortless notebook sharing. Once registered, your conda client is automatically authenticated going forward.

> [!NOTE]
>
> If you are an administrator, you can streamline registration for your organization. For more information, see [Registering conda for your organization](https://anaconda.com/docs/anaconda-platform/admin/conda-registration-admin.md).
>
> ***
>
> If you encounter any issues with the registration process, please contact [support@anaconda.com](mailto:support@anaconda.com) for help.

Follow the steps below to link your desktop conda client to your Anaconda account. If you use conda in Docker or CI/CD workflows, additional steps are provided below after you've registered your client.

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. If necessary, activate your base environment:

   ```sh theme={null}
   conda activate base
   ```

3. Install `anaconda-registration`:

   ```sh wrap theme={null}
   conda install --name base anaconda-registration --channel https://repo.anaconda.cloud/repo/anaconda-tools --override-channels
   ```

   > [!NOTE]
   >
   > The `--channel` and `--override-channels` command options allow installation to succeed, despite the registration block.
   >
   > ***
   >
   > If you encounter an error at this point, see [Troubleshooting](#troubleshooting) below.

4. Log in to Anaconda:

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

   A browser window opens to authenticate you to Anaconda. Sign in with your Anaconda account credentials, or create an account, to complete authentication in the browser. If you are already signed in to Anaconda, authentication completes automatically.

   > [!NOTE]
   >
   > If your organization has configured SSO, you are redirected to your company's SSO login page.

   Your conda client is now registered to your Anaconda account.

## Next steps for automated workflows

If your conda client runs as part of an automated process, such as a CI/CD pipeline, or if you are using conda within Docker builds on your desktop, configure them to use your local API key (generated when you logged in using `anaconda-auth`) to authenticate conda using one of the following methods:

> [tab] Using an environment variable
>
> 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.) or PowerShell (Terminal on macOS/Linux).
> 2. Set your API key as an environment variable:
>
>    ```sh Anaconda Prompt theme={null}
>    for /f "usebackq delims=" %i in (`anaconda auth api-key`) do set ANACONDA_AUTH_API_KEY=%i
>    ```
>
>    ```sh Anaconda PowerShell theme={null}
>    $env:ANACONDA_AUTH_API_KEY = (anaconda auth api-key)
>    ```
>
>    ```sh Terminal theme={null}
>    export ANACONDA_AUTH_API_KEY="$(anaconda auth api-key)"
>    ```

> [tab] Using the keyring
>
> 1. Verify `preferred_token_storage` is set to `"anaconda-keyring"`. See `anaconda-auth` [configuration parameters](https://anaconda.com/docs/cli-reference/anaconda-auth/getting-started.md#configuration).
> 2. 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).
> 3. Copy the `~/.anaconda/keyring` file to your automated workflow system:
>
>    ```sh theme={null}
>    scp ~/.anaconda/keyring user@<TARGET_SYSTEM>:~/.anaconda/keyring
>    ```

> [tab] Docker
>
> If you use conda in Docker builds, you can securely provide your Anaconda API key during build time using Docker secrets. This allows authenticated commands to run without exposing your API key in an image layer.
>
> 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.) or PowerShell (Terminal on macOS/Linux).
>
> 2. Set your API key as an environment variable:
>
>    ```sh Anaconda Prompt theme={null}
>    for /f "usebackq delims=" %i in (`anaconda auth api-key`) do set ANACONDA_AUTH_API_KEY=%i
>    ```
>
>    ```sh Anaconda PowerShell theme={null}
>    $env:ANACONDA_AUTH_API_KEY = (anaconda auth api-key)
>    ```
>
>    ```sh Terminal theme={null}
>    export ANACONDA_AUTH_API_KEY="$(anaconda auth api-key)"
>    ```
>
> 3. Each Dockerfile *must* also contain the `anaconda-registration` package:
>
>    ```dockerfile wrap theme={null}
>    RUN conda install --name base anaconda-registration --channel https://repo.anaconda.cloud/repo/anaconda-tools --override-channels
>    ```
>
> 4. For all other `conda` or `anaconda` commands that require authentication, provide the following:
>
>    ```sh theme={null}
>    RUN --mount=type=secret,id=ANACONDA_AUTH_API_KEY 
>    ```
>
>    ```sh Example command requiring auth theme={null}
>    RUN --mount=type=secret,id=ANACONDA_AUTH_API_KEY conda create -p /opt/env -y "python=3.13" "anaconda-client"
>    ```
>
> 5. When building your image, pass the key as a Docker secret:
>
>    ```bash theme={null}
>    docker build --secret id=ANACONDA_AUTH_API_KEY -t <IMAGE_NAME> .
>    ```
>
>    Comments
>
>    Replace \<IMAGE\_NAME> with the name for your Docker image.

## Troubleshooting

Troubleshoot

AnacondaAuthError: Token not found

***

<details>
  <summary>Cause</summary>

  This error occurs if you've previously installed a version of `anaconda-auth` that is not compatible with the registration process.
</details>

***

<details>
  <summary>Solution</summary>

  To resolve the error, run the command:

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

  Then repeat the command to install `anaconda-registration`.
</details>
