Docker icon

Docker

Interact with Docker via Portainer API

Overview

This node enables interaction with Docker through the Portainer API. It is designed to perform various Docker-related operations by targeting a specific Portainer endpoint. A common use case is managing Docker containers, images, networks, or volumes remotely via Portainer's API, which simplifies Docker orchestration and monitoring in automated workflows.

For example, you might use this node to retrieve system information about a Docker environment managed by Portainer, automate container lifecycle management, or gather metrics for reporting purposes.

Properties

Name Meaning
EndpointID Name or ID The identifier of the Portainer endpoint to access. You can select from a list of available endpoints or specify an ID using an expression. This determines which Docker environment the node will interact with.

Output

The node outputs JSON data corresponding to the response from the Portainer API for the requested Docker operation. For the "System Info" operation, this typically includes detailed information about the Docker system such as version, number of containers, images, and other system-wide metadata.

If binary data were involved (not indicated here), it would represent files or media related to Docker resources, but this node primarily deals with JSON responses.

Dependencies

  • Requires a valid Portainer API authentication token configured in the node credentials.
  • Needs network access to the specified Portainer server URL.
  • Uses the Portainer API endpoint /api/endpoints/{endpointId}/docker as the base URL for requests.
  • The node dynamically loads available endpoints from Portainer to populate the "EndpointID" property.

Troubleshooting

  • Common issues:

    • Incorrect or missing Portainer API credentials will cause authentication failures.
    • Specifying an invalid or unreachable endpoint ID will result in connection errors.
    • Network connectivity problems between n8n and the Portainer server can prevent successful API calls.
  • Error messages:

    • Authentication errors typically indicate invalid API tokens or insufficient permissions; verify credentials.
    • "Endpoint not found" or similar errors suggest the selected endpoint ID does not exist or is inaccessible; check the endpoint list.
    • Timeout or network errors require checking firewall rules and network availability.

Links and References

Discussion