Miniforge Documentation

repository·main·Indexed 27 days ago

https://github.com/conda-forge/miniforge

Minimal installers for Conda and Mamba, pre-configured to use the conda-forge channel as the default. Supports x86_64, aarch64 (Apple Silicon), and ppc64le architectures across Windows, macOS, and Linux. Includes guides for installation, shell initialization, CI pipeline integration, and building custom installers using Docker or native hosts.

Tokens
1.7K
Snippets
8
Records
15
Agent score
45%

What's inside Miniforge

  1. Initialize conda for your shell

    main

    If conda or mamba are not recognized in your standard terminal, you need to initialize your shell.

    On Windows, run this from the Miniforge Prompt. On Unix, if you used a non-interactive install, call the command using its full path (e.g., ~/miniforge3/bin/conda init).

    conda init
    # Or for Unix non-interactive installs:
    ~/miniforge3/bin/conda init
  2. Build a Miniforge installer on Windows without Docker

    main

    To build a Miniforge installer on Windows, you must have Git Bash or another MINGW64 shell installed. Set the TARGET_PLATFORM to win-64 and run the build and test scripts.

    export TARGET_PLATFORM=win-64
    
    bash scripts/build.sh
    bash scripts/test.sh
  3. Install Miniforge in a CI pipeline

    main

    For automated environments, download the installer and run it in batch mode using the -b flag. You must then manually source the profile scripts to enable conda and mamba commands in the current shell session.

    # Linux example
    wget -O Miniforge3.sh "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"
    bash Miniforge3.sh -b -p "${HOME}/conda"
    
    # Activate conda and mamba
    source "${HOME}/conda/etc/profile.d/conda.sh"
    source "${HOME}/conda/etc/profile.d/mamba.sh"
    
    # Activate base
    conda activate
  4. Install Miniforge on Windows

    main

    Download and execute the Windows installer (Miniforge3-Windows-x86_64.exe). The recommended way to use the installed software is via the "Miniforge Prompt" available in the Start menu.

    Important Notes:

    • Avoid installing in directories containing special characters or spaces to prevent issues.
    • To use conda and mamba in other terminals, you must run conda init from the Miniforge Prompt, or manually add C:\Users\myusername\miniforge3\condabin\ to your PATH environment variable.
  5. Install Miniforge on Unix-like platforms (macOS, Linux, & WSL)

    main

    Download the appropriate shell script for your architecture using curl or wget and execute it with bash.

    Interactive Install: The script will prompt you to initialize conda for your shell, which is the recommended workflow.

    Non-interactive Install: Use the -b flag for automated environments (like CI). Note that in non-interactive mode, conda initialization is not performed automatically.

    # Download and run for Linux/macOS
    curl -L -O "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"
    bash Miniforge3-$(uname)-$(uname -m).sh
  6. Build a Miniforge installer on Linux without Docker

    main

    To build and test a Miniforge installer directly on a Linux host, set the TARGET_PLATFORM environment variable. After running the test script, ensure you delete the installation directory to avoid errors in subsequent test runs.

    # Configuration
    export TARGET_PLATFORM=linux-64
    
    bash scripts/build.sh
    bash scripts/test.sh
  7. Build a Miniforge installer with Docker

    main

    To construct a custom Miniforge installer using Docker, set the ARCH and DOCKERIMAGE environment variables before running the build script. This is useful for creating installers for specific architectures like aarch64.

    # Configuration
    export ARCH=aarch64
    export DOCKERIMAGE=condaforge/linux-anvil-aarch64
    
    bash build_miniforge.sh
  8. Install Miniforge on macOS via PKG

    main
    Download and execute the signed/notarized PKG installer for either Apple Silicon (Miniforge3-MacOSX-arm64.pkg) or Intel (Miniforge3-MacOSX-x86_64.pkg). During installation, you can use the "Change Install Location" button to select a custom path and choose whether the installer performs conda initialization for your shell.
  9. Download Miniforge for older operating systems

    main

    If you are using legacy hardware or operating systems, specific older versions of Miniforge are required for compatibility:

    • macOS 10.13-10.15: Use version 26.1.1-3.
    • macOS 10.9-10.12: Use version 24.3.0-0.
    • glibc 2.12-2.16: Use version 24.3.0-0.
  10. Migrate from Mambaforge to Miniforge3

    main
    Mambaforge is deprecated and will be retired in January 2025. Since version 23.3.1, Miniforge and Mambaforge are functionally identical (sharing the same packages and configuration), differing only in installer name and default installation path. Users are strongly recommended to switch to Miniforge3 immediately to avoid installer 'brownouts' (scheduled refusals to proceed) that began in late 2024.
  11. Configure automatic activation of the base environment

    main

    By default, Miniforge activates the base environment upon shell startup. To prevent this and keep your shell clean, you can disable automatic activation.

    conda config --set auto_activate_base false
  12. Uninstall Miniforge from Unix-like platforms

    main

    To completely remove Miniforge on macOS or Linux, follow these three steps:

    1. Reverse shell modifications: Use conda init --reverse to clean up your shell configuration files.
    2. Remove the installation directory: Delete the folder where the base environment was installed.
    3. Remove configuration files: Delete any remaining .condarc or .conda directories in your home folder.
    # 1. Reverse shell changes
    conda init --reverse --dry-run
    conda init --reverse
    
    # 2. Remove base environment folder
    CONDA_BASE_ENVIRONMENT="$(conda info --base)"
    rm -rf "${CONDA_BASE_ENVIRONMENT}"
    
    # 3. Remove config files
    rm -f "${HOME}/.condarc"
    rm -fr "${HOME}/.conda"