.. _cloud-environments:

=========================
Working with environments
=========================

To share an environment on Anaconda Cloud:

#. See the `conda user guide <https://conda.io/docs/user-guide/tasks/manage-environments.html#creating-an-environment-with-commands>`_
   to create and save a conda environment. Open the Terminal or an Anaconda Prompt and enter::

     conda env export -n my-environment -f my-environment.yml

   NOTE: Replace ``my-environment`` with the actual name of your
   environment.

#. Upload it to Cloud either using the web interface or the ``conda env upload``
   command.

   * Using the web interface:

     Go to ``https://anaconda.org/USERNAME/environments``.

     NOTE: Replace ``USERNAME`` with your username.

     In the top right corner use the Upload button to upload your environment.

   * Using the ``conda env upload`` command from the Terminal or an Anaconda Prompt::

       conda env upload -f my-environment.yml

     NOTE: Replace ``my-environment`` with the actual name of your
     environment.

#. You can see a list of your uploaded environments at::

       http://envs.anaconda.org/USERNAME

   NOTE: Replace ``USERNAME`` with your username.

#. Anyone can download and install your environment from Cloud.

   * Using the web interface:

     Go to ``https://anaconda.org/USERNAME/environments``.

     NOTE: Replace ``USERNAME`` with the username.

     Select the environment, go to Files tab and click the file to download under Names field.

   * Using the Terminal or an Anaconda Prompt::

      conda env create user/my-environment
      source activate my-environment

     NOTE: Replace ``my-environment`` with the actual name of
     your environment.
