---
title: Using plugins
description: Configure and use core and third-party Nextflow plugins in your pipelines.
---

# Using plugins

Nextflow core plugins require no additional configuration. When a pipeline uses a core plugin, Nextflow automatically downloads and uses the latest compatible plugin version. In contrast, third-party plugins must be explicitly declared. When a pipeline uses one or more third-party plugins, Nextflow must be configured to download and use the plugin.

## Identifiers

A plugin identifier consists of the plugin name and version, separated by an `@` symbol:

```
nf-hello@0.5.0
```

The plugin version is optional. If it is not specified, Nextflow will download the latest version of the plugin that meets the minimum Nextflow version requirements specified by the plugin.

:::note
Plugin versions are required for [offline usage](#offline-usage).
:::

<AddedInVersion version="25.04" />

The plugin version can be prefixed with `~` to pin the major and minor versions and allow the latest patch release to be used. For example, `nf-amazon@~2.9.0` will resolve to the latest version matching `2.9.x`. When working offline, Nextflow will resolve version ranges against the local plugin cache defined by `NXF_PLUGINS_DIR`.

:::tip
It is recommended to pin the major and minor version of each plugin to minimize the risk of breaking changes while allowing patch updates to be used automatically.
:::

## Configuration

Plugins can be configured via Nextflow configuration files or at runtime.

To configure a plugin via configuration files, use the `plugins` block. For example:

```nextflow
plugins {
    id 'nf-hello@0.5.0'
    id 'nf-amazon@2.9.0'
}
```

To configure plugins at runtime, use the `-plugins` option. For example:

```bash
nextflow run main.nf -plugins nf-hello@0.5.0,nf-amazon@2.9.0
```

:::note
Plugin declarations in Nextflow configuration files are ignored when specifying plugins via the `-plugins` option.
:::

## Caching

When Nextflow downloads plugins, it caches them in the directory specified by `NXF_PLUGINS_DIR` (`$HOME/.nextflow/plugins` by default).

## Offline usage

When running Nextflow in an offline environment, any required plugins must be downloaded and moved into the offline environment prior to any runs.

To use Nextflow plugins in an offline environment:

1. Install a self-contained version of Nextflow in an environment with an internet connection. See [Standalone distribution][install-standalone] for more information.

2. Run `nextflow plugin install <plugin-name>@<version>` for each required plugin to download it. Alternatively, run the pipeline once, which will automatically download all plugins required by the pipeline.

3. Copy the `nextflow` binary and `$HOME/.nextflow` directory to the offline environment.

4. Specify each plugin and its version in Nextflow configuration files or at runtime. See [Configuration][using-plugins-config] for more information.

    :::warning
    Nextflow will attempt to download newer versions of plugins if their versions are not set. See [Identifiers][using-plugins-identifiers] for more information.
    :::

[install-standalone]: ../install#standalone-distribution
[using-plugins-config]: ./using-plugins#configuration
[using-plugins-identifiers]: ./using-plugins#identifiers

