Actions88
- Container Actions
- Container List
- Container Create
- Container Inspect
- Container Top
- Container Logs
- Container Changes
- Container Export
- Container Stats
- Container Resize
- Container Start
- Container Stop
- Container Restart
- Container Kill
- Container Update
- Container Rename
- Container Pause
- Container Unpause
- Container Attach
- Container Attach Websocket
- Container Wait
- Container Delete
- Container Archive Info
- Container Archive
- Put Container Archive
- Container Prune
- Image Actions
- Network Actions
- Volume Actions
- Swarm Actions
- Node Actions
- Secret Actions
- System Actions
- Exec Actions
- Service Actions
- Task Actions
Overview
This node allows you to execute commands inside a Docker container by interacting with the Portainer API. It is useful for scenarios where you need to run shell commands or scripts within a running container without directly accessing the host machine or using Docker CLI. For example, you might use this node to inspect container internals, trigger maintenance scripts, or gather runtime information dynamically.
Properties
| Name | Meaning |
|---|---|
| EndpointID Name or ID | The Portainer endpoint to connect to. Choose from a list of available endpoints or specify an ID via expression. This determines which Docker environment the command will be executed in. |
| Id | The ID or name of the target Docker container where the command will be executed. |
| Exec Config | The execution configuration as a JSON string. This defines the command and options for the exec operation inside the container. |
Output
The node outputs JSON data representing the result of the exec command run inside the specified container. This typically includes the command output, status, and any relevant metadata returned by the Portainer API. There is no indication that binary data is returned.
Dependencies
- Requires access to a Portainer API instance.
- Needs an API key or token credential configured in n8n to authenticate requests to the Portainer API.
- The node uses the Portainer API endpoint
/api/endpoints/{endpointId}/dockerto perform Docker operations remotely.
Troubleshooting
Common issues:
- Invalid or missing
endpointId: Ensure the endpoint exists and is accessible. - Incorrect container
id: Verify the container ID or name is correct and the container is running. - Malformed
execConfig: The exec configuration must be valid JSON describing the command and parameters; otherwise, the API call will fail. - Authentication errors: Confirm the API credentials are valid and have sufficient permissions.
- Invalid or missing
Error messages:
- "Unauthorized" or "Authentication failed": Check API credentials.
- "Container not found": Verify the container ID/name.
- "Bad request" or "Invalid exec config": Validate the JSON structure of the exec configuration.