==========================================================
Configuring conda to use your local on-site AEN repository
==========================================================

You can configure AEN to use a local on-site Anaconda repository server instead
of Anaconda.org.

To configure AEN to use a local on-site repository, you must:

#. :ref:`Edit condarc on the compute node <edit-condarc-cn-432>`.

#. :ref:`Configure the Anaconda client <config-anaconda-client-432>`.


.. _edit-condarc-cn-432:

Editing condarc on the compute node
===================================

**NOTE:** If there are channels that you haven't mirrored, you must
remove them from the configuration.

Edit the file ``.condarc`` to match the following::

    #/opt/wakari/anaconda/.condarc
    channels:
        - defaults

    create_default_packages:
        - anaconda-client
        - ipykernel

    # Default channels is needed for when users override the system .condarc
    # with ~/.condarc.  This ensures that "defaults" maps to your Anaconda Repository and not
    # repo.anaconda.com
    default_channels:
        - http://<your Anaconda Repository name>:8080/conda/anaconda
        - http://<your Anaconda Repository name>:8080/conda/wakari
        - http://<your Anaconda Repository name>:8080/conda/r-channel

    # Note:  You must add the "conda" subdirectory to the end
    channel_alias: http://<your Anaconda Repository name:8080/conda

**NOTE:** Replace ``<your Anaconda Repository name>`` with the actual name or IP
address of your local Anaconda Repository installation.

.. _config-anaconda-client-432:

Configuring the Anaconda client
===============================

Anaconda client lets users work with the repository from the
command-line---including searching for packages, logging in, uploading packages,
and more.

To set the default configuration of anaconda-client for all users on your
compute node, run the following command, replacing ``<your Anaconda Repository>`` with the actual name or IP
address of your local Anaconda Repository installation:

.. code-block:: bash

    sudo /opt/wakari/anaconda/bin/anaconda config --set url http://<your Anaconda Repository>:8080/api -s

**NOTE:** Sudo access is required because the configuration file is written to the root
file system: ``/etc/xdg/binstar/config.yaml``.

What's next
===========

Review the :doc:`optional configuration <config/index>` tasks to see if any apply to your system.
