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

# Mirrors

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>;
};

export const MirrorFolder = () => {
  return <span className="inline_icon">
      <svg class="inline" width="1.2em" height="1em" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 589 512">
        <path fill="currentColor" d="M517 73.9H314L261.7 21.6A74.1 74.1 0 0 0 209.5 0H74A73.9 73.9 0 0 0 .1 73.9V443A73.9 73.9 0 0 0 74 516.9H517a73.9 73.9 0 0 0 73.9-73.9V147.7A73.9 73.9 0 0 0 517 73.9zM109.9 192a18.6 18.6 0 0 1 18.2-12.8h61.1l-18.7 74.5H76.9zM337.6 412.2a27.9 27.9 0 0 1 -28 27.9H104.8A27.9 27.9 0 0 1 76.9 412.2V272.5H170v46.6a9.3 9.3 0 0 0 9.3 9.3h55.8a9.3 9.3 0 0 0 9.3-9.3V272.5h93.2zM244.5 254 225.9 179.2h61.1a18.6 18.6 0 0 1 17.7 12.8l33 61.8z"></path>
      </svg>
    </span>;
};

Mirroring is the process of copying data from a source and then storing it in a new location, often on a scheduled basis. When the mirror's source updates its contents, the mirror's contents update to match the next time it runs. It is possible to mirror just a subset of the source's contents as well, if the source contains more data than you need or can store. Mirroring ensures your channels are always up to date with the latest <Tooltip tip="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.">packages</Tooltip> from the source.

<Warning>
  Anaconda recommends that channels contain *only one mirror each* to prevent conflicts between package sources.
</Warning>

<Note>
  Mirroring is restricted to users whose [role](/psm-on-prem/6.8.0/admin/user_config/permissions#permission-levels) provides `write` or `manage` permissions for **Channel Mirrors** and/or **Subchannel Mirrors** categories.
</Note>

## Creating a mirror

When creating a mirror, the recommended workflow is:

1. Select a channel you want to contain your mirror.

2. Freeze your channel.

3. Open the <Icon icon="gear" iconType="light" /> **Manage** dropdown and select *Create Mirror*.

4. Complete the **Create mirror** form. Configuration options differ based on the type of mirror you are creating:

   <Tabs>
     <Tab title="Conda">
       <Frame>
         <img src="https://mintcdn.com/anaconda-29683c67/GAawxvWy-HUVSCqf/images/psm_create_conda_mirror_ui_6.8.0.png?fit=max&auto=format&n=GAawxvWy-HUVSCqf&q=85&s=7cd54147c2472eedbf4da2e10cbca4a6" alt="conda mirror configurations" width="1652" height="800" data-path="images/psm_create_conda_mirror_ui_6.8.0.png" />
       </Frame>

       <Steps>
         <Step title="Mirror Name">
           Enter a name for your mirror. Anaconda recommends you name your mirror something descriptive for your end users.
         </Step>

         <Step title="Mirroring Mode">
           Choose whether you want your mirror to be active or passive.

           **Active Mirroring**: Downloads packages from the source channel immediately to your local server.

           <Warning>
             Some repository channels require a large amount of storage (for example, Anaconda's public repository is 700GB, conda-forge is 3TB, and PyPI is 10TB), and as a rule, the larger the mirror, the longer the wait time for it to complete.
           </Warning>

           **Passive Mirroring**: Creates a metadata file listing all packages on the mirrored server. Packages are downloaded when users request them via `conda install <PKG_NAME>`.

           <Note>
             Anaconda recommends establishing your mirrors as passive. Active mirrors take longer to complete than passive mirrors, but regardless of which mirroring mode you choose, the available packages are the same.
           </Note>
         </Step>

         <Step title="External Source URL" id="conda-external-source-url">
           Enter the URL of the conda channel to mirror.

           <Tip>
             **Anaconda recommends creating mirrors for the following channels:**

             * `https://repo.anaconda.cloud/pkgs/main`
             * `https://repo.anaconda.cloud/pkgs/r` <Badge color="orange">Deprecated</Badge>
             * `https://repo.anaconda.cloud/pkgs/msys2`
             * `https://repo.anaconda.cloud/repo/main-x` <Badge color="green">Beta</Badge>
           </Tip>

           <Note>
             If your external source channel is another Package Security Manager channel, you *must* use the format `https://<URL>/api/repo/<CHANNEL_NAME>`.

             ***

             If your external source channel is another Package Security Manager channel *that contains CRAN R packages*, you *must* use the format `https://<URL>/api/repo/<CHANNEL_NAME>/cran`.

             ***

             If your external source channel is a *virtual* channel from Package Security Manager (Cloud), you *must* use the format `https://repo.anaconda.cloud/repo/t/<TOKEN>/<ORG_ID>/<CHANNEL_NAME>`.

             ***

             If your external source channel is one of the **Anaconda Channels** or **Community Package Channels** from Package Security Manager (Cloud), you *must* use the format `https://repo.anaconda.cloud/t/<TOKEN>/repo/<CHANNEL_NAME>`.

             ***

             When creating mirrors that use Package Security Manager (Cloud) channels as the external source, replace `<TOKEN>` with your [organization access token](/anaconda-platform/user/tokens), and `<ORG_ID>` with your [organization ID](/anaconda-platform/admin/organizations#creating-an-organization).
           </Note>
         </Step>

         <Step title="Mirror Type">
           Select **Conda** as the mirror type. This ensures that only conda packages (`.conda`, `.tar.bz2`) will be mirrored from the external source channel. Packages in the source channel that are not conda packages are not mirrored.
         </Step>

         <Step title="Mirroring Frequency">
           Set the frequency you want your mirror to run and update your packages. The default value instructs the mirror to update at midnight on the first day of every month.

           Custom frequencies use [cron expressions](https://crontab.cronhub.io/) to determine when they run.

           <Warning>
             Mirroring large repositories can take several hours. Anaconda recommends against setting a frequency greater than *Daily* to avoid collisions between currently running and updating mirrors.
           </Warning>
         </Step>

         <Step title="Run Now">
           Select this checkbox to start your mirror when you click **Save & Run**. If the **Run Now** checkbox is not selected, your changes are saved, and the mirror runs the next time its frequency configuration instructs it to do so.
         </Step>

         <Step title="Assign Mirror Policy">
           Toggle between using the policy that is applied to the channel or selecting a policy to apply to the mirror. For more information about policies, see [Policies](/psm-on-prem/6.8.0/admin/policies).

           <Note>
             You cannot apply a policy to a mirror if it is already applied to the channel.

             ***

             Mirror policies override channel policies.
           </Note>
         </Step>

         <Step title="View Applied Policy">
           View details of the policy applied to the mirror.
         </Step>

         <Step title="Cancel/Save & Run">
           Click **Cancel** at any time to quit your mirror form completion and discard any set parameters. Click **Save & Run** to start your mirror.
         </Step>
       </Steps>
     </Tab>

     <Tab title="Std Python">
       <Frame>
         <img src="https://mintcdn.com/anaconda-29683c67/GAawxvWy-HUVSCqf/images/psm_create_python_mirror_ui_6.8.0.png?fit=max&auto=format&n=GAawxvWy-HUVSCqf&q=85&s=7f151c3c1f44719f8888a50dd5457330" alt="standard python mirror configurations" width="1650" height="875" data-path="images/psm_create_python_mirror_ui_6.8.0.png" />
       </Frame>

       <Steps>
         <Step title="Mirror Name">
           Enter a name for your mirror. Anaconda recommends you name your mirror something descriptive for your end users.
         </Step>

         <Step title="Mirroring Mode">
           Choose whether you want your mirror to be active or passive.

           **Active Mirroring**: Downloads packages from the source channel immediately to your local server.

           <Warning>
             Some repository channels require a large amount of storage (for example, Anaconda's public repository is 700GB, conda-forge is 3TB, and PyPI is 10TB), and as a rule, the larger the mirror, the longer the wait time for it to complete.
           </Warning>

           **Passive Mirroring**: Creates a metadata file listing all packages on the mirrored server. Packages are downloaded when users request them via `conda install <PKG_NAME>`.

           <Note>
             Anaconda recommends establishing your mirrors as passive. Active mirrors take longer to complete than passive mirrors, but regardless of which mirroring mode you choose, the available packages are the same.
           </Note>
         </Step>

         <Step title="External Source URL">
           Enter the URL of the Python package <Tooltip tip="Any storage location from which software or software assets, like packages, can be retrieved and installed on a local computer.">repository</Tooltip> to mirror.
         </Step>

         <Step title="Mirror Type">
           Select **Std Python** as the mirror type. This ensures that only Python packages (`.py`, `.pyc`, `.pyd`, `.whl`, `.egg`, `.tar.gz`, for example) are mirrored from the source repository. Packages in the source channel that are not Python packages are not mirrored.
         </Step>

         <Step title="Mirroring Frequency">
           Set the frequency you want your mirror to run and update your packages. The default value instructs the mirror to update at midnight on the first day of every month.

           Custom frequencies use [cron expressions](https://crontab.cronhub.io/) to determine when they run.

           <Warning>
             Mirroring large repositories can take several hours. Anaconda recommends against setting a frequency greater than *Daily* to avoid collisions between currently running and updating mirrors.
           </Warning>

           <Danger>
             If you are mirroring the full PyPI repository, set your frequency to run once yearly. Once the PyPI mirror is complete, any attempts to re-run the mirror will cause issues. Consider using selective mirroring for specific packages instead of the full PyPI repository.
           </Danger>
         </Step>

         <Step title="Run Now">
           Select this checkbox to start your mirror when you click **Save & Run**. If the **Run Now** checkbox is not selected, your changes are saved, and the mirror runs the next time its frequency configuration instructs it to do so.
         </Step>

         <Step title="Mirroring Filters">
           Because policy filters only work for conda mirrors, Standard Python mirrors must use the **Mirroring Filters** section to specify which packages should be mirrored from the source channel.
         </Step>

         <Step title="Exclude">
           List packages to exclude from the mirror by name here. You can also exclude packages by using wildcards. For example, `p*` excludes all packages that start with the letter `p`.
         </Step>

         <Step title="Include">
           List exceptions to the exclusion list here. For example, if you want to include Python in your mirror, but you have used the exclusion filter `p*` to exclude all packages that start with the letter `p`, you can include Python by adding `python` here.
         </Step>

         <Step title="View Channel Filters">
           View details of the **Mirroring Filters** applied to the channel.
         </Step>

         <Step title="Cancel/Save & Run">
           Click **Cancel** at any time to quit your mirror form completion and discard any set parameters. Click **Save & Run** to start your mirror.
         </Step>
       </Steps>
     </Tab>

     <Tab title="Std R">
       <Frame>
         <img src="https://mintcdn.com/anaconda-29683c67/GAawxvWy-HUVSCqf/images/psm_create_r_mirror_ui_6.8.0.png?fit=max&auto=format&n=GAawxvWy-HUVSCqf&q=85&s=c39f56f1cb8412b55be8d92840006555" alt="standard r mirror configurations" width="1652" height="939" data-path="images/psm_create_r_mirror_ui_6.8.0.png" />
       </Frame>

       <Steps>
         <Step title="Mirror Name">
           Enter a name for your mirror. Anaconda recommends you name your mirror something descriptive for your end users.
         </Step>

         <Step title="Mirroring Mode">
           Choose whether you want your mirror to be active or passive.

           **Active Mirroring**: Downloads packages from the source channel immediately to your local server.

           <Warning>
             Some repository channels require a large amount of storage (for example, Anaconda's public repository is 700GB, conda-forge is 3TB, and PyPI is 10TB), and as a rule, the larger the mirror, the longer the wait time for it to complete.
           </Warning>

           **Passive Mirroring**: Creates a metadata file listing all packages on the mirrored server. Packages are downloaded when users request them via `conda install <PKG_NAME>`.

           <Note>
             Anaconda recommends establishing your mirrors as passive. Active mirrors take longer to complete than passive mirrors, but regardless of which mirroring mode you choose, the available packages are the same.
           </Note>
         </Step>

         <Step title="External Source URL">
           Enter the URL of the R package repository to mirror.
         </Step>

         <Step title="Mirror Type">
           Select "Std R" as the mirror type. This ensures that only R packages (`.R`, `.RData`, `.rda`, `.RDS`, `.Rd`, `.Rproj`, for example) are mirrored from the source repository. Packages in the source channel that are not R packages are not mirrored.
         </Step>

         <Step title="Mirroring Frequency">
           Set the frequency you want your mirror to run and update your packages. The default value instructs the mirror to update at midnight on the first day of every month.

           Custom frequencies use [cron expressions](https://crontab.cronhub.io/) to determine when mirrors run.

           <Warning>
             Mirroring large repositories can take several hours. Anaconda recommends against setting a frequency greater than *Daily* to avoid collisions between currently running and updating mirrors.
           </Warning>
         </Step>

         <Step title="Run Now">
           Select this checkbox to start your mirror when you click **Save & Run**. If the **Run Now** checkbox is not selected, your changes are saved, and the mirror runs the next time its frequency configuration instructs it to do so.
         </Step>

         <Step title="Mirroring Filters">
           Because policy filters only work for conda mirrors, Standard R mirrors must use the **Mirroring Filters** to specify which packages should be mirrored from the source channel.
         </Step>

         <Step title="Exclude">
           List packages to exclude from the mirror by name here. You can also exclude packages by using wildcards. For example, `p*` excludes all packages that start with the characters `p`.

           <Note>
             R packages can also be excluded by License type.
           </Note>
         </Step>

         <Step title="Include">
           List exceptions to the exclusion list here. For example, if you want to include the `plumber` package in your mirror, but you have used the exclusion filter `p*` to exclude all packages that start with the characters `p`, you can include plumber by adding `plumber` here.
         </Step>

         <Step title="View Channel Filters">
           View details of the **Mirroring Filters** applied to the channel.
         </Step>

         <Step title="Cancel/Save & Run">
           Click **Cancel** at any time to quit your mirror form completion and discard any set parameters. Click **Save & Run** to start your mirror.
         </Step>
       </Steps>
     </Tab>
   </Tabs>

5. Allow the mirror time to complete.

   <Accordion title="How do I know when my mirror is complete?">
     You can view the status of in-progress mirrors from the from the channel's **Mirrors** tab. In-progress mirrors display which step is currently being performed with a brief description of the operation. When a mirror completes, the status updates to **Completed** and the date and time of completion is displayed.

     <Frame>
       <img src="https://mintcdn.com/anaconda-29683c67/Ga5sJw6rk2Z2M8IW/images/ap_mirror_status.png?fit=max&auto=format&n=Ga5sJw6rk2Z2M8IW&q=85&s=fdae324e3a5aeeffbe294419cd99d2d7" alt="The channel's Mirror tab spotlighting the status of an in-progress mirror" width="1922" height="634" data-path="images/ap_mirror_status.png" />
     </Frame>
   </Accordion>

   <Note>
     Administrators can view the status of all mirrors from the <Icon icon="reflect-horizontal" iconType="light" /> **Mirrors** page.
   </Note>

6. Unfreeze your channel.

   <Note>
     For more information on freezing and unfreezing a channel, see [Freezing/Unfreezing Channels](/psm-on-prem/6.8.0/user/channel#freezing-and-unfreezing-channels).
   </Note>

## Managing mirrors

Select <MirrorFolder /> **All Mirrors** from the left-hand navigation to view mirrors globally for all users.

<Note>
  This view is only available to users whose role provides `Manage` permissions for the **mirror** attribute. This value must be assigned in Keycloak.
</Note>

<Frame>
  <img src="https://mintcdn.com/anaconda-29683c67/YGtija9HXl-k020Y/images/as_all_repository_mirrors_3.png?fit=max&auto=format&n=YGtija9HXl-k020Y&q=85&s=d7d0cf6e3bcf2728e4970ec8548a7dee" alt="" width="1922" height="858" data-path="images/as_all_repository_mirrors_3.png" />
</Frame>

<Tip>
  Use the search box to locate a mirror by name. Click a column header to sort mirrors by **Type**, **Mode**, **Mirroring Status**, or **Last Updated**.
</Tip>

### Mirror actions

Use the icons in the **Actions** column to manage your mirrors:

<Frame>
  <img src="https://mintcdn.com/anaconda-29683c67/FWjHZXWDjYmx0_bG/images/mirror_actions.png?fit=max&auto=format&n=FWjHZXWDjYmx0_bG&q=85&s=9767387a950bd9b43c801294e4e74419" alt="" width="1922" height="982" data-path="images/mirror_actions.png" />
</Frame>

<Tip>
  Mirror actions can also be performed from a channel’s **Mirrors** tab.
</Tip>

<Steps>
  <Step title="Edit mirror" icon={<Icon icon="pencil" iconType="light" />}>
    Edit a mirror's configurations.

    <Note>
      You cannot edit the mode of an established mirror.
    </Note>
  </Step>

  <Step title="Stop running mirror" icon={<Icon icon="hand" iconType="regular" />}>
    Stop an in-progress mirror.

    <Note>
      It can take up to 10 minutes for a mirror to fully stop. A mirror in the process of stopping will display **Stopping** as its mirroring status. Once it is complete, it will display **Stopped** as its status. Stopping a mirror does not discard the progress the mirror has made, and some packages may appear in your channel’s **Packages** tab.
    </Note>
  </Step>

  <Step title="Restart Mirror" icon={<Icon icon="arrow-rotate-right" iconType="light" />}>
    Restart a stopped mirror.

    <Note>
      Restarted mirrors run from the beginning of the mirroring process, not from where you stopped the run.
    </Note>
  </Step>

  <Step title="See details" icon={<Icon icon="eye" iconType="light" />}>
    View information about how many packages were filtered from the source, reasons for their exclusion, and whether packages were mirrored passively or actively.
  </Step>

  <Step title="Delete mirror" icon={<Icon icon="trash" iconType="light" />}>
    Delete a mirror.
  </Step>

  <Step title="Download Dependency Report" icon={<Icon icon="download" iconType="light" />}>
    Download a dependency report (if available).

    A dependency report is a detailed list of all the software packages required for your specified packages to function correctly. It includes both direct dependencies (packages your specified packages require to run) and indirect dependencies (packages the dependencies require to run). A package dependency report can help you identify exactly which packages are necessary for your channel to be able to create a working environment using conda.

    <Warning>
      Dependency reports are only available for mirrors that have policies with specific configurations applied:

      * You must set package rules to allow packages by their names using [MatchSpec protocol](https://docs.conda.io/projects/conda/en/stable/dev-guide/api/conda/models/match_spec/index.html)—a syntax for specifying package names and versions in conda
      * You must select the **Include dependencies** checkbox.
    </Warning>
  </Step>
</Steps>
