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 → Restart
AI-generatedOverview
This node operation allows users to restart a Docker container managed by Portainer. It is useful in scenarios where a container needs to be refreshed or reset without deleting it, such as applying configuration changes or recovering from an error state. For example, restarting a web server container to apply new environment variables or updates.
Use Case Examples
- Restart a container by specifying the environment ID and container ID, optionally setting a timeout for the restart operation.
- Use this operation to automate container restarts in response to monitoring alerts or deployment workflows.
Properties
| Name | Meaning |
|---|---|
| Environment ID | The ID of the environment/endpoint in Portainer where the container is running. This is required to target the correct Docker environment. |
| Container ID | The unique identifier of the container to restart. This is required to specify which container to restart. |
| Timeout | Number of seconds to wait before forcefully stopping the container during the restart process. Optional, defaults to 10 seconds. |
Output
JSON
body- The JSON response from the Portainer API after attempting to restart the container, typically indicating success or failure status.
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.
- Check that the API key credential has sufficient permissions to restart containers.
- Timeout value should be a positive number; invalid values may cause the request to fail.
- If SSL issues occur, consider enabling the option to ignore SSL certificate validation in the node settings.
Links
- Portainer API - Restart Container - Official Portainer API documentation for restarting Docker containers.