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 → Exec
AI-generatedOverview
This node operation allows executing a command inside a specified Docker container managed by Portainer. It is useful for running shell commands or scripts within a container environment without needing direct terminal access. For example, you can use it to inspect container internals, run maintenance scripts, or debug running containers.
Use Case Examples
- Execute '/bin/sh' to open a shell inside a container for interactive troubleshooting.
- Run a specific command like 'ls -la' inside a container to list directory contents.
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 in which the command will be executed. |
| Exec Command | The command string to execute inside the container, e.g., '/bin/sh' or 'ls -la'. |
| TTY | Boolean flag indicating whether to allocate a pseudo-TTY for the command execution, useful for interactive commands. |
Output
JSON
Id- The ID of the exec instance created in the container.
Dependencies
- Requires Portainer API access with an API key credential configured.
Troubleshooting
- Ensure the container ID and environment ID are correct and the container is running.
- If the command fails, verify the command syntax and availability inside the container.
- Check API key permissions to ensure exec operations are allowed.
Links
- Portainer API - Container Exec - Official Portainer API documentation for executing commands inside containers.