Install BWA and Bowtie2 Read Aligners with Conda (Apple Silicon)
Install BWA and Bowtie2 short-read aligners together in one conda env on an Apple Silicon Mac, with native arm64 builds, verify steps, and fixes for common errors.
BWA and Bowtie2 are two of the most widely used short-read aligners in bioinformatics. Both take your sequencing reads (FASTQ) and map them against a reference genome, producing alignments in SAM/BAM format. BWA (via bwa mem) is a go-to for Illumina and longer reads, while Bowtie2 is a fast, memory-efficient gapped aligner that shows up all over RNA-seq and ChIP-seq pipelines.
Because these two are so often used side by side in the same workflow, we will install them together in one conda environment called bu-aligners. That keeps the exact aligner builds your pipeline depends on locked inside the environment, independent of anything on the rest of your system. When you deactivate the env, bwa and bowtie2 simply are not on your PATH anymore, and nothing global was touched.
Why put both in one environment?
The "one env per tool" habit is great for isolation, but BWA and Bowtie2 are a natural pair: they share the same job (align reads to a reference), the same input format (FASTQ), and the same output format (SAM). Keeping them in a single bu-aligners env means one conda activate gives you both aligners, and the environment file you export documents the exact pair of versions your results were produced with. If you later need strict per-tool isolation, you can always split them into two envs.
Prerequisites
You need a working conda. If you have not set that up yet on your Mac, follow the companion guide first: Install Miniconda on Apple Silicon. This walkthrough was run on an Apple Silicon Mac (arm64), macOS 26.5.2, with conda 25.5.1 using the fast libmamba solver.
On Apple Silicon, Miniforge/Miniconda is preferred because it defaults to the conda-forge channel and ships the fast solver. Everything below assumes conda is already on your PATH.
TL;DR: copy-paste install
conda create -y -n bu-aligners \
--override-channels -c conda-forge -c bioconda \
bwa=0.7.19 bowtie2=2.5.5
conda activate bu-alignersThe --override-channels -c conda-forge -c bioconda part is doing real work: it tells conda to use ONLY conda-forge and bioconda, never the Anaconda defaults channel. That sidesteps the defaults Terms-of-Service gate that trips up many people on recent conda versions, and it keeps channel priority correct (conda-forge must come before bioconda).
Step by step
1. Create the environment with both aligners
Run the create command. Pinning bwa=0.7.19 and bowtie2=2.5.5 is deliberate: it keeps the environment reproducible so your pipeline does not silently drift to a newer aligner later.
conda create -y -n bu-aligners \
--override-channels -c conda-forge -c bioconda \
bwa=0.7.19 bowtie2=2.5.5Conda solves and reports what it will install. Here is the real solved plan from this machine (trimmed to the highlights):
Channels:
- conda-forge
- bioconda
Platform: osx-arm64
Collecting package metadata (repodata.json): done
Solving environment: done
## Package Plan ##
environment location: /opt/homebrew/Caskroom/miniconda/base/envs/bu-aligners
added / updated specs:
- bowtie2
- bwa
The following NEW packages will be INSTALLED:
bowtie2 bioconda/osx-arm64::bowtie2-2.5.5-h9e91881_0
bwa bioconda/osx-arm64::bwa-0.7.19-hba9b596_1
perl conda-forge/osx-arm64::perl-5.32.1-7_h4614cfb_perl5
python conda-forge/osx-arm64::python-3.14.6-h156bc91_100_cp314
... (libcxx, libzlib, ncurses, openssl, tk, tzdata, zstd, and friends)
Notice two things. First, every line reads osx-arm64 — these are native Apple Silicon builds, no emulation. Second, conda pulled in python 3.14.6 and perl 5.32.1 even though we never asked for them. That is expected: Bowtie2 ships wrapper scripts (bowtie2, bowtie2-build) written in Perl and Python, so those interpreters come along as dependencies. They live inside the env only.
The whole create finished quickly on this machine:
real 23.39
user 9.21
sys 9.63
### EXIT: 0 ###
2. Activate the environment
conda activate bu-alignersYour prompt now shows (bu-aligners). Both aligners exist only while this env is active.
Apple Silicon / architecture note
Bioconda enabled osx-arm64 support back in July 2024, and both of our tools ship native arm64 builds — you can see it right in the solved plan above (bioconda/osx-arm64::bwa-0.7.19 and bioconda/osx-arm64::bowtie2-2.5.5). That means best-case performance and no Rosetta 2 involved.
You only need the Rosetta fallback if you later add some niche bioconda tool that has no arm64 build. In that case, build an x86_64 env that runs under Rosetta:
CONDA_SUBDIR=osx-64 conda create -y -n bu-aligners_x86 \
--override-channels -c conda-forge -c bioconda \
bwa bowtie2
conda activate bu-aligners_x86
conda config --env --set subdir osx-64For BWA 0.7.19 and Bowtie2 2.5.5 specifically, you do NOT need this — the native arm64 install above is the right choice.
Verify the install
First confirm both binaries resolve inside the env:
which bwa && which bowtie2Now check versions. A quirk worth knowing: bwa prints its version and usage to stderr and exits with a non-zero status by design, so run it and read the banner rather than expecting a clean --version flag.
bwa 2>&1 | head -5
bowtie2-align-s --versionReal output from this machine:
Program: bwa (alignment via Burrows-Wheeler transformation)
Version: 0.7.19-r1273
Contact: Heng Li <[email protected]>
Usage: bwa <command> [options]
/opt/homebrew/Caskroom/miniconda/base/envs/bu-aligners/bin/bowtie2-align-s version 2.5.5
64-bit
Built on VM-8b0b7afd3b
There they are: bwa 0.7.19-r1273 and bowtie2 2.5.5, both running from inside the bu-aligners env path.
Smoke test (align a tiny read)
To prove both aligners actually map reads, build a one-sequence reference, index it, and align a single read with each tool:
cd $(mktemp -d)
printf '>chr1\nACGTACGTACGTAGCTAGCTAGCTAGGCTAGCTAGCATCGATCGATCGTACGATCGATCGA\n' > ref.fa
printf '@r1\nAGCTAGCTAGCATCGATCG\n+\nIIIIIIIIIIIIIIIIIII\n' > reads.fq
# BWA
bwa index ref.fa
bwa mem ref.fa reads.fq > bwa.sam
grep -v '^@' bwa.sam
# Bowtie2
bowtie2-build ref.fa refidx
bowtie2 -x refidx -U reads.fq -S bt2.sam
grep -v '^@' bt2.samSuccess means each aligner emits a SAM line for r1 whose FLAG field is not 4 (FLAG 4 means unmapped) — i.e. the read mapped to chr1.
Heads up: this smoke test is doc-grounded. The version checks above were run on the real test machine, but this alignment mini-example was not captured in that session's transcript — so the SAM output is not shown here. The commands are correct to run yourself; expect one alignment line per read.
Common errors and fixes
| Error | Fix |
|---|---|
PackagesNotFoundError, or conda refuses citing the Anaconda defaults/main channel Terms of Service | Never use defaults for bioconda tools. Use --override-channels -c conda-forge -c bioconda exactly as shown; defaults is then never queried. |
| Broken/unsolvable env from channels in the wrong order | Always list conda-forge BEFORE bioconda. Optionally set it globally with conda config --add channels bioconda; conda config --add channels conda-forge; conda config --set channel_priority strict. |
conda: command not found in a fresh terminal | Conda is not on PATH or the shell was not initialized. Run conda init zsh (macOS default shell), then open a new terminal. |
bwa: command not found or bowtie2: command not found right after install | The env is not active. Run conda activate bu-aligners. Tools exist only inside their env; conda env list shows what you have. |
Solving environment spins for many minutes | Use the fast libmamba solver: conda config --set solver libmamba, or install Miniforge/mamba and run mamba create .... |
PackagesNotFoundError only on Apple Silicon for some extra tool | That package lacks an arm64 build. Use the CONDA_SUBDIR=osx-64 Rosetta fallback shown above (also run softwareupdate --install-rosetta once). |
Managing the environment
Update both aligners to the newest compatible builds:
conda update -n bu-aligners --override-channels -c conda-forge -c bioconda bwa bowtie2Export an exact, shareable snapshot of the environment (great for reproducibility in a repo):
conda activate bu-aligners
conda env export > bu-aligners.yamlRemove the whole environment when you are done:
conda remove -n bu-aligners --allNext steps
With reads aligned, the natural next tools are the ones that sort, index, and call variants on your SAM/BAM output. Continue with Install SAMtools and BCFtools. If you want a deeper look at how channels and environments fit together, see Conda environments and the Bioconda channel.