Docker icon

Docker

Interact with Docker via Portainer API

Actions107

Overview

This node allows users to create a Docker configuration by interacting with the Portainer API. It is designed to send custom JSON payloads to a specified Docker endpoint managed by Portainer, enabling advanced Docker management and automation scenarios within n8n workflows.

Common use cases include:

  • Automating Docker container or service configurations via Portainer.
  • Integrating Docker management into broader automation pipelines.
  • Sending custom Docker API requests to specific endpoints for tailored operations.

For example, a user might specify an endpoint and provide a JSON body describing a new container configuration to be created on that Docker host.

Properties

Name Meaning
EndpointID Name or ID The Docker endpoint managed by Portainer where the request will be sent. Users can select from available endpoints or specify an ID via expression.
Body A JSON string representing the request body to be sent to the Docker API at the selected endpoint. This should contain the configuration details.

Output

The node outputs the JSON response returned by the Portainer Docker API after processing the create configuration request. This typically includes details about the created resource or any error messages if the operation failed.

No binary data output is produced by this node.

Dependencies

  • Requires access to a Portainer instance with its API enabled.
  • Needs an API authentication token or key configured in n8n credentials to authorize requests to the Portainer API.
  • The node dynamically loads available Docker endpoints from Portainer to populate the "EndpointID" property.

Troubleshooting

  • Invalid EndpointID: If the selected endpoint does not exist or is unreachable, the node will fail. Verify the endpoint list and connectivity to Portainer.
  • Malformed JSON Body: Providing invalid JSON in the "Body" property will cause request errors. Ensure the JSON syntax is correct.
  • Authentication Errors: Missing or incorrect API credentials will result in authorization failures. Confirm that the API key/token is valid and properly configured.
  • API Limitations: The Portainer API may reject certain configurations depending on Docker version or Portainer settings. Review Portainer API documentation for supported operations.

Links and References

Discussion