Actions86
- Config Actions
- Container Actions
- Edge Group Actions
- Edge Stack Actions
- Environment Actions
- Image Actions
- Network Actions
- Node Actions
- Registry Actions
- Secret Actions
- Service Actions
- Setting Actions
- Stack Actions
- System Actions
- Team Actions
- Template Actions
- User Actions
- Volume Actions
- Webhook Actions
Container → Stop
AI-generatedOverview
This node operation stops a running Docker container managed through Portainer. It sends a request to the Portainer API to stop the specified container within a given environment, optionally waiting for a specified timeout period before forcefully stopping it. This is useful for automating container lifecycle management, such as stopping containers during maintenance or scaling down services.
Use Case Examples
- Stopping a container by specifying its Container ID and Environment ID to gracefully shut down a service.
- Automating container stop operations in a CI/CD pipeline to manage resource usage.
Properties
| Name | Meaning |
|---|---|
| Environment ID | The ID of the environment/endpoint in Portainer where the container is running. |
| Container ID | The unique identifier of the container to stop. |
| Timeout | Number of seconds to wait before forcefully stopping the container. |
Output
JSON
body- The response body from the Portainer API after attempting to stop the container, typically indicating success or failure.
Dependencies
- Portainer API with an API key credential for authentication
Troubleshooting
- Ensure the Environment ID and Container ID are correct and correspond to existing resources in Portainer.
- Timeout value should be a positive number; otherwise, the stop operation might fail or behave unexpectedly.
- Check API key permissions to ensure the user has rights to stop containers.
- Common errors include 404 Not Found if the container or environment does not exist, and 403 Forbidden if the API key lacks permissions.
Links
- Portainer API - Stop a Container - Official Portainer API documentation for stopping a Docker container.