Actions72
- Image Actions
- Config Actions
- Container Actions
- Edge Group Actions
- Edge Stack Actions
- Network Actions
- Node Actions
- Registry Actions
- Secret Actions
- Service Actions
- Stack Actions
- Team Actions
- Template Actions
- User Actions
- Volume Actions
- Webhook Actions
Overview
This node integrates with the Portainer API to manage Docker containers and other Docker-related resources. Specifically, the Container - Stop operation allows users to stop a running Docker container within a specified environment (endpoint) managed by Portainer.
Stopping a container is useful in scenarios such as:
- Gracefully shutting down a containerized application for maintenance or updates.
- Temporarily halting a service without deleting it.
- Managing resource usage by stopping unused containers.
For example, you might use this node to stop a web server container before deploying a new version or to halt a batch job container after completion.
Properties
| Name | Meaning |
|---|---|
| Environment ID | The ID of the Portainer environment/endpoint where the container runs. |
| Container ID | The unique identifier of the container to be stopped. |
| Timeout | Number of seconds to wait before forcefully stopping the container (default is 10 sec). |
Output
The node outputs JSON data representing the response from the Portainer API after attempting to stop the container. This typically includes status information about the stop request.
No binary data output is involved in this operation.
Dependencies
- Requires an active connection to a Portainer instance via its API.
- Needs an API key credential configured in n8n to authenticate requests to Portainer.
- The Portainer API base URL must be set correctly in the credentials.
Troubleshooting
Common issues:
- Invalid or missing Environment ID or Container ID will cause the API call to fail.
- Insufficient permissions or invalid API key may result in authorization errors.
- If the container is already stopped, the API might return a specific error or no action.
- Network connectivity issues between n8n and the Portainer server can cause timeouts.
Error messages:
- "Unauthorized" or "Forbidden": Check that the API key credential is valid and has sufficient permissions.
- "Not Found": Verify that the Environment ID and Container ID are correct and exist.
- Timeout errors: Increase the timeout property or check network stability.
Links and References
- Portainer API Documentation
- Docker Containers Management (Docker API reference for stopping containers)