Actions15
Overview
This node allows you to interact with Docker, specifically enabling operations such as running containers, and getting or listing Docker resources like containers, images, volumes, and networks. The "Run" operation for the "Container" resource lets you start a new container from a specified image and run a command inside it.
Common scenarios include:
- Automating containerized application deployment by running containers directly from n8n workflows.
- Running specific commands inside containers for tasks like data processing, testing, or environment setup.
- Integrating Docker container management into broader automation pipelines.
For example, you can use this node to run a container from an Ubuntu image and execute a shell command inside it, capturing the output for further workflow steps.
Properties
| Name | Meaning |
|---|---|
| Image | The Docker image name to use for running the container (e.g., ubuntu:latest). |
| Command | An array representing the command and its arguments to run inside the container (e.g., ["echo", "hello world"]). Must be a JSON array. |
Output
The node outputs JSON data containing the results of the Docker operation. For the "Run" operation on a container, the output includes:
stdout: A string capturing the standard output stream from the container's command execution.stderr: A string capturing the standard error stream from the container's command execution.
This allows you to access both successful output and error messages generated by the container process.
No binary data output is produced by this node.
Dependencies
- Requires a valid Docker API connection configured via credentials that provide access to a Docker daemon.
- The node uses the Dockerode library internally to communicate with Docker.
- The Docker daemon must be accessible from where n8n is running.
Troubleshooting
Error: "No credentials got returned!"
This indicates missing or misconfigured Docker API credentials. Ensure that the Docker connection credentials are properly set up in n8n.Error: "Command must be an array!"
The "Command" property must be a valid JSON array. Check that the input is correctly formatted, e.g.,["ls", "-la"].Docker pull failures or timeouts
If pulling the specified image fails, verify network connectivity and that the image name is correct and available on Docker Hub or your private registry.Permission errors connecting to Docker daemon
Make sure the user running n8n has permission to access the Docker socket or API endpoint.
Links and References
- Dockerode GitHub Repository – Node.js Docker client used internally.
- Docker CLI Reference – For understanding Docker images and commands.
- Docker Official Images – To find valid image names for the "Image" property.