Environment setup
Setting up a Nextflow development environment is a prerequisite for creating, testing, and optimizing data analysis pipelines. The steps below outline recommended tools for setting up an optimal Nextflow development environment.
Nextflow must be installed separately. See Installation for Nextflow installation instructions.
Note
If you are using a Windows computer, first install and configure the Windows Subsystem for Linux (WSL). See Windows Subsystem for Linux for installation instructions.
VS Code
An Integrated Development Environment (IDE) provides a user-friendly interface for writing, editing, and managing code. Installing one is an essential step for setting up your environment.
Visual Studio Code (VS Code) is a popular lightweight IDE known for its versatility and extensibility. It offers features like syntax highlighting, intelligent code completion, and integrated debugging tools for various programming languages. VS Code supports Windows, macOS, and Linux, and is a good choice for both new and experienced Nextflow developers.
To install VS Code on Windows:
Visit the VS Code website.
Download VS Code for Windows.
Double-click the installer executable (
.exe
) file and follow the set up steps.
To install VS Code on macOS:
Visit the VS Code website.
Download VS Code for macOS.
Drag the
Visual Studio Code.app
application to the Applications folder to add it to the macOS Launchpad.
To install VS Code on Linux Debian/Ubuntu distributions:
Visit the VS Code website.
Download the VS Code Linux Debian/Ubuntu (
.deb
) distribution.Open a new terminal window.
Navigate to the folder where you downloaded VS Code.
Run
sudo apt install ./<file>.deb
, replacing<file>
with the full file name.Note
If you’re using an older Linux distribution, run
sudo dpkg -i <file>.deb
to install VS Code andsudo apt-get install -f
to install dependencies.
See Linux installation for information about installing VS Code on other distributions.
Extensions
Extensions are a key feature of IDEs and allow you to customize your development environment by adding support for various programming languages, tools, and features. The VS Code Marketplace offers thousands of extensions that can enhance your productivity and tailor the editor to your specific needs. Popular VS Code extensions for Nextflow developers are listed below:
Nextflow
The VS Code Nextflow extension adds Nextflow language support to the editor. The Nextflow extension enhances development with:
Diagnostics
Hover hints
Code navigation
Code completion
Formatting
Renaming
Parameter schemas
DAG previews
See VS Code integration for more information about the Nextflow extension features and how it enforces the Nextflow syntax.
nf-core
The nf-core extension pack adds a selection of tools that help develop with nf-core, a community effort to collect a curated set of analysis pipelines built using Nextflow.
The nf-core extension pack includes several useful extensions. For example, Code Spell Checker, Prettier, Todo Tree, and Markdown Extended. See nf-core extension pack for more information about the tools included in the nf-core extension pack.
Remote development
The Remote Development extension pack enables you to run WSL, SSH, or a development container for editing and debugging with the full set of VS Code features.
The pack includes the Remote - SSH, Remote - Tunnels, Dev Containers, and WSL extensions. See Remote Development for more information about the tools included in the remote development extension pack.
Note
The Remote Development extension pack is required if you are developing using remote servers, Windows Subsystem for Linux, or Development Containers.
Installing VS Code extensions requires just a few clicks in the Extensions Marketplace.
To install a VS Code extension on Windows:
Open VS Code.
Open the Extensions view in the left-hand menu.
Search for the extension.
Select Install.
To install a VS Code extension on macOS:
Open VS Code.
Open the Extensions view in the left-hand menu.
Search for the extension.
Select Install.
To install a VS Code extension on Linux Debian/Ubuntu distributions:
Open VS Code.
Open the Extensions view in the left-hand menu.
Search for the extension.
Select Install.
Docker
Docker is an open-source platform that simplifies application development, deployment, and execution by packaging applications and their dependencies into containers. Containerization enables the creation of self-contained and fully reproducible computational pipelines by bundling a script’s binary dependencies into a standardized and portable format. Containers can be executed on any platform that supports a container runtime and ensures consistency across different environments.
Docker Desktop provides a Graphical User Interface (GUI) for managing Docker containers. Installing Docker Desktop is a straightforward process that allows you to create, deploy, and manage applications within containers.
To install Docker Desktop on Windows:
Download the installer.
Double-click Docker Desktop
Installer.exe
to run the installer. By default, Docker Desktop is installed atC:\Program Files\Docker\Docker
.Depending on your choice of backend, select the Use WSL 2 instead of Hyper-V option on the Configuration page.
Note
You won’t be able to select which backend to use if your system only supports one of the two options.
Follow the instructions on the installation wizard to authorize the installer and proceed with the install.
When the installation is complete, select Close.
Start Docker Desktop.
Review the Docker Subscription Service Agreement and select Accept to continue.
Note
Docker Desktop won’t run if you do not agree to the terms. You can choose to accept the terms at a later date by opening Docker Desktop.
Docker Desktop starts after you accept the terms.
To install Docker Desktop on macOS:
Download the installer for your chip type.
Double-click
Docker.dmg
to open the installer.Drag the Docker icon to the Applications folder to add it to the macOS Launchpad.
Double-click Docker.app in the Applications folder to start Docker.
Review the Docker Subscription Service Agreement and select Accept to continue.
Note
Docker Desktop won’t run if you do not agree to the terms. You can choose to accept the terms at a later date by opening Docker Desktop.
From the installation window, select Use recommended settings (Requires password).
Note
The recommended settings allow Docker Desktop to automatically set the necessary configuration settings. Advanced settings allow you to set the location of the Docker CLI tools either in the system or user directory, enable the default Docker socket, and enable privileged port mapping. See Settings, for more information and how to set the location of the Docker CLI tools.
Select Finish. If you have applied any of the previous configurations that require a password, enter your password to confirm your choice.
To install Docker Desktop on Linux Debian/Ubuntu distributions:
Set up Docker’s package repository. See step one of Install using the
apt
repository.Download the latest Debian/Ubuntu (
.deb
) distribution.In your terminal, run
sudo apt-get install ./docker-desktop-amd64.deb
Note
By default, Docker Desktop is installed at
/opt/docker-desktop
.Double-click Docker Desktop in your Applications menu to start Docker.
Review the Docker Subscription Service Agreement and select Accept to continue.
From the installation window, select Use recommended settings (Requires password). Docker Desktop starts after you accept the terms.
Note
Docker Desktop won’t run if you do not agree to the terms. You can choose to accept the terms at a later date by opening Docker Desktop.
Nextflow supports multiple container technologies (e.g., Singularity and Podman) so you can choose the one that best fits your needs. See Containers for more information about other supported container engines.
Git
Git provides powerful version control that helps track code changes. Git operates locally, meaning you don’t need an internet connection to track changes, but it can also be used with remote platforms like GitHub, GitLab, or Bitbucket for collaborative development.
Nextflow seamlessly integrates with Git for source code management providers for managing pipelines as version-controlled Git repositories.
Git is already installed on most WSL distributions. You can check if it is already installed by running git version
.
To install the latest stable Git version on Linux Debian/Ubuntu distributions:
Open a terminal window and run
sudo apt-get install git-all
.Once complete, run
git version
to verify Git was installed.
See git-scm documentation for more information about installing Git on other Linux distributions.
To install Git on macOS with Homebrew:
Open a terminal window and run
brew install git
.Note
You must have Homebrew installed. See Homebrew installation for instructions.
Once complete, run
git version
to verify Git was installed.
To install Git on macOS with Xcode:
Open the App Store on your Mac.
Search for Xcode.
Select Install.
Once complete, open a new terminal window and run
git version
to verify Git was installed.
Git is already installed on most Linux Debian/Ubuntu distributions.
To install the latest stable Git version on Linux Debian/Ubuntu distributions:
Open a terminal window and run
sudo apt-get install git-all
.Once complete, run
git version
to verify Git was installed.
See git-scm documentation for more information about installing Git on other Linux distributions.
Windows Subsystem for Linux
Developers can access the power of both Windows and Linux on a Windows machine. The Windows Subsystem for Linux (WSL) lets developers install a Linux distribution and use Linux applications, utilities, and Bash command-line tools directly on Windows without the overhead of a virtual machine or dual-boot setup.
WSL is an optional feature on Windows 10 version 2004 and higher (Build 19041 and higher) or Windows 11. You can enable it through PowerShell or Windows Command Prompt. The steps below outline the recommended setup.
To enable WSL on Windows using Powershell or Windows Command Prompt:
Right-click and select Run as administrator to use PowerShell or Windows Command Prompt in administrator mode.
Run
wsl --install
.Note
This command will enable the features necessary to run WSL and install the Ubuntu distribution.
When prompted, restart Windows.
After restarting Windows, open the Ubuntu distribution and create a new Linux User Name and Password when prompted.
Note
The User Name and Password is specific to each Linux distribution that you install and has no bearing on your Windows user name.
See Set up a WSL development environment for more about installing WSL.