Skip main navigation

Installing Nextflow

how to install Nextflow

Before we run our first Nextflow pipeline, we need to install Nextflow and Docker or Singularity so we can make use of the built-in support for software packaging that Nextflow offers

All nf-core pipelines support Docker and Singularity (most support Conda too but it’s recommended to use Docker or Singularity instead). We’re going to use Singularity as, unlike Docker, it doesn’t require root (admin) access to install.

Install

Note: Nextflow is licensed under the Apache License 2.0

There are a few different ways to install Nextflow so pick the best way for your setup:

1. Through the command line and bash:

First you will need to ensure that you have at least version 8 of java installed. You can check which version you have by typing the following on your command line:

java -version

If you don’t have java installed or else need to update the version, installation instructions can be found here: https://www.java.com/en/download/help/linux_x64_install.html.

If you have the correct version of java installed, you can use the following command to download and install Nextflow on your computer:

curl -fsSL get.nextflow.io | bash

Now that you have installed Nextflow, it’s good practice to add it to your PATH so you can call it from anywhere on your system:

mv nextflow ~/bin/

2. Through conda:

If you haven’t already, set up your conda channels:

conda config --add channels defaults
conda config --add channels bioconda
conda config --add channels conda-forge

Now create an environment called nextflow and install Nextflow in it:

conda create --name nextflow nextflow

Before you can use Nextflow, you will need to activate the nextflow environment:

conda activate nextflow

To check it’s working, run the following command:

nextflow help

You should see something like this:

Install Singularity

Note: Singularity is licensed under the following License

Like Nextflow, there are a number of different ways to install Singularity depending on which system you’re running. We’d recommend using the following commands to install Singularity on a Linux system (Ubuntu version 22.04 in this case):

sudo apt install -y runc cryptsetup-bin
wget -O singularity.deb https://github.com/sylabs/singularity/releases/download/v3.11.4/singularity-ce_3.11.4-jammy_amd64.deb
sudo dpkg -i singularity.deb
rm singularity.deb

Now that you have installed Nextflow and Singularity, we can move on to running the nf-core pipeline, viralrecon.

© Wellcome Connecting Science
This article is from the free online

Bioinformatics for Biologists: Analysing and Interpreting Genomics Datasets

Created by
FutureLearn - Learning For Life

Reach your personal and professional goals

Unlock access to hundreds of expert online courses and degrees from top universities and educators to gain accredited qualifications and professional CV-building certificates.

Join over 18 million learners to launch, switch or build upon your career, all at your own pace, across a wide range of topic areas.

Start Learning now