===========================
Installing with silent mode
===========================

.. _silent:

When installing in silent mode, you can supply additional arguments to the install command through your command line interface (CLI) or via script. Silent mode installation can be useful when deploying Anaconda Distribution to many clients, as the installation can be completed automatically without the user needing to manually select options in an installer wizard GUI or within the CLI itself.

.. _install-win-silent:

.. _install-macos-silent:

.. tab-set::

    .. tab-item:: Windows

        Download Anaconda Distribution manually from one of the links above or use ``curl -O`` to download via your CLI.

        .. raw:: html

            <div class="highlight-none notranslate">
            <div class="highlight">

        .. parsed-literal::

           curl -O \https://repo.anaconda.com/archive/Anaconda3-|distro-latest-installer-version|-Windows-x86_64.exe

        .. raw:: html

           </div>
           </div>

        To run the Windows installer for Anaconda in silent mode, use the ``/S`` argument. The following optional arguments are supported:

            * ``/InstallationType=[JustMe|AllUsers]``---Default is ``JustMe``.
            * ``/AddToPath=[0|1]``---Default is ``0``.
            * ``/RegisterPython=[0|1]``---Make this the system's default Python. Default is ``0``.
            * ``/S``---Install in silent mode.
            * ``/D=<installation path>``---Destination installation path. Must be the last argument. Do not wrap in quotation marks. Required if installing in silent mode.

        All arguments are case-sensitive.

        For example, the following batch file command installs Anaconda Distribution for the current user without registering Python as the system's default:

        .. raw:: html

            <div class="highlight-none notranslate">
            <div class="highlight">

        .. parsed-literal::

           start /wait "" Anaconda3-|distro-latest-installer-version|-Windows-x86_64.exe /InstallationType=JustMe /RegisterPython=0 /S /D=%UserProfile%\Anaconda3

        .. raw:: html

           </div>
           </div>

        .. note::

           As of ``Anaconda Distribution 2022.05``, the option to add Anaconda to the PATH environment variable during an **All Users** installation has been disabled. This was done to address `a security exploit <https://nvd.nist.gov/vuln/detail/CVE-2022-26526>`_. You can still add Anaconda to the PATH environment variable during a **Just Me** installation.

    .. tab-item:: macOS/Linux

        Download Anaconda Distribution manually from one of the links above or use ``curl -o`` to download via your CLI.

        To run the silent installation of Miniconda for macOS or Linux, specify the -b and -p arguments of the bash installer. The following arguments are supported:

            * ``-b``---Batch mode with no PATH modifications to ``~/.bashrc``. Assumes that you agree to the license agreement. Does not edit the ``.bashrc`` or ``.bash_profile`` files.
            * ``-p``---Installation prefix/path.
            * ``-f``---Force installation even if the installation prefix/path already exists.

        For example, the following batch file command installs Anaconda Distribution for the current user without registering Python as the system's default:

        .. raw:: html

            <div class="highlight-none notranslate">
            <div class="highlight">

        .. parsed-literal::

           bash ~/Anaconda3-|distro-latest-installer-version|-MacOSX-x86_64.sh -b -p $HOME/anaconda3

        .. raw:: html

           </div>
           </div>

        The installer will not prompt you for anything, including setup of your shell to activate conda. To add this activation in your current shell session:

        .. code-block:: none
        
           source ~/anaconda3/bin/activate

        With this activated shell, install conda's shell functions for easier access in the future:

        .. code-block:: none

           conda init --all

        If you'd prefer that conda's base environment not be activated on startup, set the ``auto_activate_base`` parameter to false:

        .. code-block:: none

           conda config --set auto_activate_base false