---
title: Docker
description: Run Nextflow pipeline tasks in Docker containers.
---

# Docker

[Docker](https://www.docker.com) is the most widely used container runtime.

## Prerequisites

Docker must be installed in your execution environment.

On macOS, mount your local `/Users` directory into the Docker virtual machine.

## How it works

Enable Docker in the Nextflow configuration file:

```groovy
docker.enabled = true
process.container = 'nextflow/examples:latest'
```

Whenever your pipeline launches a task, Nextflow runs it inside a Docker container created from the specified image using the `docker run` command.

You can also enable Docker on the command line:

```bash
nextflow run main.nf -with-docker
```

## Advanced settings

See the [`docker`][config-docker] configuration scope for advanced Docker settings.

[config-docker]: ../reference/config/docker
