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:

  1. Visit the VS Code website.

  2. Download VS Code for Windows.

  3. Double-click the installer executable (.exe) file and follow the set up steps.

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:

  1. Open VS Code.

  2. Open the Extensions view in the left-hand menu.

  3. Search for the extension.

  4. 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:

  1. Go to Install Docker Desktop on Windows.

  2. Download the installer.

  3. Double-click Docker Desktop Installer.exe to run the installer. By default, Docker Desktop is installed at C:\Program Files\Docker\Docker.

  4. 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.

  5. Follow the instructions on the installation wizard to authorize the installer and proceed with the install.

  6. When the installation is complete, select Close.

  7. Start Docker Desktop.

  8. 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.

  9. Docker Desktop starts after you accept the terms.

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:

  1. Open a terminal window and run sudo apt-get install git-all.

  2. 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:

  1. Right-click and select Run as administrator to use PowerShell or Windows Command Prompt in administrator mode.

  2. Run wsl --install.

    Note

    This command will enable the features necessary to run WSL and install the Ubuntu distribution.

  3. When prompted, restart Windows.

  4. 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.