Docker icon

Docker

Interact with Docker via Portainer API

Actions107

Overview

This node allows you to interact with Docker containers through the Portainer API, specifically enabling you to pause a running container. Pausing a container temporarily suspends its processes without stopping or removing it, which can be useful for resource management, debugging, or maintenance tasks where you want to freeze container activity without losing state.

Common scenarios include:

  • Temporarily halting a container's workload during system maintenance.
  • Freezing a container to inspect its current state or logs.
  • Managing container lifecycle in automated workflows that require pausing and resuming containers.

For example, you might use this node in an automation workflow to pause a container before deploying updates or performing backups.

Properties

Name Meaning
EndpointID Name or ID The Portainer endpoint identifier used to access Docker. You can select from available endpoints or specify one via expression.
Id The ID or name of the Docker container you want to pause.

Output

The node outputs JSON data representing the response from the Portainer API after attempting to pause the specified container. This typically includes status information about the operation. The output does not include binary data.

Dependencies

  • Requires access to a Portainer instance with API enabled.
  • Needs an API authentication token configured as credentials in n8n to authorize requests.
  • The node uses the Portainer API endpoint /api/endpoints/{endpointId}/docker to perform Docker operations.

Troubleshooting

  • Invalid EndpointID or Container ID: If the provided endpoint or container ID is incorrect or does not exist, the API will return an error. Verify the IDs are correct and accessible.
  • Authentication Errors: Ensure the API key or token credential is valid and has sufficient permissions to manage containers on the Portainer instance.
  • Network Issues: Connectivity problems between n8n and the Portainer server can cause request failures. Check network settings and firewall rules.
  • Container State Errors: Attempting to pause a container that is already paused or stopped may result in errors. Confirm the container is running before pausing.

Links and References

Discussion