Portainer
App · 14 actions
Look after the containers Portainer manages from workflows: read a container's status and recent logs, start, stop, restart and recreate it, redeploy and update stacks, and clear unused images. Start a workflow when a container stops, turns unhealthy or comes back up.
Actions
| Action | What it does |
|---|---|
| Get container | Look up a container's status: whether it's running, its health and last health check, exit code, when it started and stopped, restarts, image and ports. |
| Get container logs | Read a container's recent logs: its last lines, or those since a time, output and errors or one of them, such as to post to a channel when it fails. |
| List containers | List the containers in an environment, running and stopped, by state, name or stack, with their status, health and image. |
| List environments | List the Docker and Kubernetes environments Portainer manages, with whether each is up and how many containers are running, stopped and unhealthy. |
| List stacks | List the stacks Portainer deploys, in every environment or one, with whether each is running, its Git repository and commit, and when it last changed. |
| Recreate container | Replace a container with a new one from the same settings, pulling the newest image of its tag first, to update it. |
| Redeploy stack | Redeploy a stack: one from Git with its newest commit, one made in Portainer as it is, optionally pulling newer images and setting environment variables. |
| Remove unused images | Free disk space by removing images no container uses: untagged ones, or every unused one, optionally only those older than some hours. |
| Restart container | Restart a container, such as when it stops answering, from an alert or a chat command. |
| Start container | Start a stopped container. |
| Start stack | Start a stopped stack's containers. |
| Stop container | Stop a running container, letting it shut down first. |
| Stop stack | Stop a stack's containers, keeping the stack to start again later. |
| Update stack | Change a stack's compose file, or set or remove its environment variables, and redeploy it. |
Get container
Look up a container's status: whether it's running, its health and last health check, exit code, when it started and stopped, restarts, image and ports.
Inputs
- Environment
environmenttextRequired - The Docker environment the container is in, as Portainer names it, or its ID.
- Container
containertextRequired - The container: its name, such as shop-web-1, or its ID (from a trigger or an earlier step).
Outputs
createdtext- When it was created (UTC)
environmenttext- The environment's name
environment_idnumber- The environment's ID
errortext- Docker's error, if it couldn't start
exit_codenumber- The exit code it last stopped with
failing_streaknumber- How many health checks in a row have failed
finished_attext- When it last stopped (UTC); blank if never
healthtext- healthy, unhealthy, starting, or none without a health check
idtext- The container's full ID
imagetext- Its image, such as nginx:alpine
last_health_checktext- What its last health check printed
linktext- A link to it in Portainer
nametext- Its name
networkslist- The networks it's on
oom_killedtrue/false- Whether it was stopped for running out of memory
portslist- Its published ports, such as 8080->80/tcp
restart_countnumber- How many times Docker has restarted it
restart_policytext- Its restart policy: no, always, unless-stopped or on-failure
runningtrue/false- Whether it is running
servicetext- Its service in that stack, if any
short_idtext- Its short ID, the first 12 characters
stacktext- The stack (Compose project) it belongs to, if any
started_attext- When it last started (UTC)
statetext- running, exited, restarting, paused, created or dead
ttytrue/false- Whether it has a terminal (TTY)
Example output
{
"created": "2026-11-06T21:40:54.987654321Z",
"environment": "production",
"environment_id": 1,
"error": "",
"exit_code": 0,
"failing_streak": 0,
"finished_at": "",
"health": "healthy",
"id": "8e2014789068049ac9367041896c9de6cb4c11c24ae84946b7414111e4954539",
"image": "nginx:alpine",
"last_health_check": "",
"link": "https://portainer.example.com/#!/1/docker/containers/8e2014789068049ac9367041896c9de6cb4c11c24ae84946b7414111e4954539",
"name": "shop-web-1",
"networks": [
"shop_default"
],
"oom_killed": false,
"ports": [
"8080->80/tcp"
],
"restart_count": 0,
"restart_policy": "unless-stopped",
"running": true,
"service": "web",
"short_id": "8e2014789068",
"stack": "shop",
"started_at": "2026-11-06T21:40:55.123456789Z",
"state": "running",
"tty": false
}Get container logs
Read a container's recent logs: its last lines, or those since a time, output and errors or one of them, such as to post to a channel when it fails.
Inputs
- Environment
environmenttextRequired - The Docker environment the container is in, as Portainer names it, or its ID.
- Container
containertextRequired - The container: its name, such as shop-web-1, or its ID (from a trigger or an earlier step).
- Lines
linesnumber - How many of the newest lines. Defaults to 100.From 1 to 5000.
- Since
sincetext - Only lines written since then: how far back, such as 30m, 2h or 1d, or a date and time such as 2026-11-06 09:00 (UTC).
- Which lines
streamtext - Output, errors, or both. Defaults to both.One of:
both(Output and errors),stdout(Output only (stdout)),stderr(Errors only (stderr)). Default:both. - Show times
timestampstrue/false - Start each line with when it was written (UTC).Default:
false.
Outputs
containertext- The container's name
container_idtext- Its full ID
environmenttext- The environment's name
line_countnumber- How many lines there are
lineslist- The lines, oldest first
logstext- The lines, oldest first, as one text
statetext- Its state now, such as running or exited
truncatedtrue/false- Whether the text was cut, keeping the newest lines
Example output
{
"container": "shop-web-1",
"container_id": "8e2014789068049ac9367041896c9de6cb4c11c24ae84946b7414111e4954539",
"environment": "production",
"line_count": 2,
"lines": [
{
"stream": "stdout",
"text": "GET /health 200",
"time": "2026-11-06T23:50:33.624849099Z"
},
{
"stream": "stderr",
"text": "upstream timed out (110: Connection timed out)",
"time": "2026-11-06T23:50:35.625963482Z"
}
],
"logs": "GET /health 200\nupstream timed out (110: Connection timed out)",
"state": "running",
"truncated": false
}List containers
List the containers in an environment, running and stopped, by state, name or stack, with their status, health and image.
Inputs
- Environment
environmenttextRequired - The Docker environment, as Portainer names it, or its ID.
- State
statetext - Only containers in this state. Leave blank for every one.One of:
running,exited(Stopped (exited)),restarting,paused,created(Created, never started),dead. - Name or image
searchtext - Only containers whose name or image has these words, such as web.
- Stack
stacktext - Only containers of this stack (Compose project), by name.
- How many
limitnumber - The most to list. Defaults to 50.From 1 to 500.
Outputs
containerslist- The containers, by name
countnumber- How many are listed
environmenttext- The environment's name
environment_idnumber- The environment's ID
totalnumber- How many match in all
Example output
{
"containers": [
{
"created": "2026-11-06T21:40:54Z",
"environment": "production",
"environment_id": 1,
"exit_code": 0,
"health": "none",
"id": "8e2014789068049ac9367041896c9de6cb4c11c24ae84946b7414111e4954539",
"image": "nginx:alpine",
"link": "https://portainer.example.com/#!/1/docker/containers/8e2014789068049ac9367041896c9de6cb4c11c24ae84946b7414111e4954539",
"name": "shop-web-1",
"ports": [
"8080->80/tcp"
],
"service": "web",
"short_id": "8e2014789068",
"stack": "shop",
"state": "running",
"status": "Up 2 hours"
}
],
"count": 1,
"environment": "production",
"environment_id": 1,
"total": 1
}List environments
List the Docker and Kubernetes environments Portainer manages, with whether each is up and how many containers are running, stopped and unhealthy.
Inputs
- Search
searchtext - Words in the name or address.
- How many
limitnumber - The most to list. Defaults to 50.From 1 to 500.
Outputs
countnumber- How many are listed
environmentslist- The environments, by name
totalnumber- How many match in all
Example output
{
"count": 1,
"environments": [
{
"checked_at": "2026-11-06T23:47:12Z",
"containers": 12,
"docker_version": "29.9.3",
"healthy": 4,
"id": 1,
"images": 18,
"link": "https://portainer.example.com/#!/1/docker/dashboard",
"name": "production",
"platform": "docker",
"public_url": "",
"running": 11,
"stacks": 3,
"status": "up",
"stopped": 1,
"type": "Docker",
"unhealthy": 0,
"url": "unix:///var/run/docker.sock"
}
],
"total": 1
}List stacks
List the stacks Portainer deploys, in every environment or one, with whether each is running, its Git repository and commit, and when it last changed.
Inputs
- Environment
environmenttext - Only stacks in this environment. Leave blank for every one.
- Search
searchtext - Words in the stack's name.
- How many
limitnumber - The most to list. Defaults to 50.From 1 to 500.
Outputs
countnumber- How many are listed
stackslist- The stacks, by name
totalnumber- How many match in all
Example output
{
"count": 1,
"stacks": [
{
"auto_update": false,
"compose_file": "docker-compose.yml",
"created": "2026-11-06T23:52:52Z",
"created_by": "admin",
"env_names": [
"APP_VERSION"
],
"environment": "production",
"environment_id": 1,
"from_git": true,
"git_commit": "2ce3eefe292f029fb23c07a82c8308c429dd70b3",
"git_reference": "refs/heads/main",
"git_url": "https://github.com/example/shop",
"id": 2,
"link": "https://portainer.example.com/#!/1/docker/stacks/shop?id=2&type=2®ular=true&orphaned=false&orphanedRunning=false",
"message": "",
"name": "shop",
"status": "active",
"type": "compose",
"updated": "2026-11-06T23:53:12Z",
"updated_by": "admin"
}
],
"total": 1
}Recreate container
Replace a container with a new one from the same settings, pulling the newest image of its tag first, to update it. It gets a new ID.
Inputs
- Environment
environmenttextRequired - The Docker environment the container is in, as Portainer names it, or its ID.
- Container
containertextRequired - The container: its name, such as shop-web-1, or its ID (from a trigger or an earlier step).
- Pull the newest image
pull_imagetrue/false - Pull the newest version of its image's tag first. Off recreates it from the image already on the server.Default:
true.
Outputs
createdtext- When it was created (UTC)
environmenttext- The environment's name
environment_idnumber- The environment's ID
errortext- Docker's error, if it couldn't start
exit_codenumber- The exit code it last stopped with
failing_streaknumber- How many health checks in a row have failed
finished_attext- When it last stopped (UTC); blank if never
healthtext- healthy, unhealthy, starting, or none without a health check
idtext- The container's full ID
imagetext- Its image, such as nginx:alpine
image_changedtrue/false- Whether the new container runs a newer image
image_idtext- The image the new container runs
last_health_checktext- What its last health check printed
linktext- A link to it in Portainer
nametext- Its name
networkslist- The networks it's on
oom_killedtrue/false- Whether it was stopped for running out of memory
portslist- Its published ports, such as 8080->80/tcp
previous_idtext- The old container's ID; the new one has a new ID
previous_image_idtext- The image the old container ran
pulledtrue/false- Whether the image was pulled first
restart_countnumber- How many times Docker has restarted it
restart_policytext- Its restart policy: no, always, unless-stopped or on-failure
runningtrue/false- Whether it is running
servicetext- Its service in that stack, if any
short_idtext- Its short ID, the first 12 characters
stacktext- The stack (Compose project) it belongs to, if any
started_attext- When it last started (UTC)
statetext- running, exited, restarting, paused, created or dead
ttytrue/false- Whether it has a terminal (TTY)
Example output
{
"created": "2026-11-06T21:40:54.987654321Z",
"environment": "production",
"environment_id": 1,
"error": "",
"exit_code": 0,
"failing_streak": 0,
"finished_at": "",
"health": "healthy",
"id": "11517112ac62230b49c7ae1836aea4c8db2119c749a74f7c976f33b1d93dd716",
"image": "nginx:alpine",
"image_changed": true,
"image_id": "sha256:9a1b3c5d7e9f2b4d6f8a0c2e4a6c8e0b2d4f6a8c0e2b4d6f8a0c2e4b6d8f0a2c",
"last_health_check": "",
"link": "https://portainer.example.com/#!/1/docker/containers/11517112ac62230b49c7ae1836aea4c8db2119c749a74f7c976f33b1d93dd716",
"name": "shop-web-1",
"networks": [
"shop_default"
],
"oom_killed": false,
"ports": [
"8080->80/tcp"
],
"previous_id": "8e2014789068049ac9367041896c9de6cb4c11c24ae84946b7414111e4954539",
"previous_image_id": "sha256:713fc2ebfd92e8217db451477182ee91944b123d2b1ee9fd5a8c6e91ca6c3a11",
"pulled": true,
"restart_count": 0,
"restart_policy": "unless-stopped",
"running": true,
"service": "web",
"short_id": "11517112ac62",
"stack": "shop",
"started_at": "2026-11-06T21:40:55.123456789Z",
"state": "running",
"tty": false
}Redeploy stack
Redeploy a stack: one from Git with its newest commit, one made in Portainer as it is, optionally pulling newer images and setting environment variables.
Inputs
- Stack
stacktextRequired - The stack: its name, such as shop, or its ID.
- Environment
environmenttext - The environment the stack is in. Only needed when two environments have a stack of that name.
- Pull newer images
pull_imagestrue/false - Pull the newest version of each image's tag before deploying. Off uses the images already on the server.Default:
false. - Environment variables
environment_variablestext - Variables to set, one per line, such as APP_VERSION=1.4.2. Each replaces the stack's variable of that name or is added; the rest stay as they are.
- Remove old services
prunetrue/false - Remove services that are no longer in the compose file. Leave blank to keep the stack's own setting.
Outputs
auto_updatetrue/false- Whether Portainer redeploys it by itself (GitOps updates)
changed_variableslist- The environment variables set
compose_filetext- The compose file's path, such as docker-compose.yml
createdtext- When it was made (UTC)
created_bytext- Who made it
env_nameslist- The names of its environment variables
environmenttext- The environment's name
environment_idnumber- The environment's ID
from_gittrue/false- Whether it is deployed from a Git repository
git_committext- The commit it is deployed from, if from Git
git_referencetext- The branch or tag it follows, such as refs/heads/main
git_urltext- The Git repository, if from Git
idnumber- The stack's ID, for other Portainer steps
linktext- A link to it in Portainer
messagetext- Why its last deployment failed, if it did
nametext- Its name
previous_git_committext- The commit it was deployed from before
pulled_imagestrue/false- Whether newer images were pulled first
statustext- active, inactive, deploying or failed
typetext- compose, swarm or kubernetes
updatedtext- When it was last changed (UTC); blank if never
updated_bytext- Who last changed it
Example output
{
"auto_update": false,
"changed_variables": [
"APP_VERSION"
],
"compose_file": "docker-compose.yml",
"created": "2026-11-06T23:52:52Z",
"created_by": "admin",
"env_names": [
"APP_VERSION"
],
"environment": "production",
"environment_id": 1,
"from_git": true,
"git_commit": "2ce3eefe292f029fb23c07a82c8308c429dd70b3",
"git_reference": "refs/heads/main",
"git_url": "https://github.com/example/shop",
"id": 2,
"link": "https://portainer.example.com/#!/1/docker/stacks/shop?id=2&type=2®ular=true&orphaned=false&orphanedRunning=false",
"message": "",
"name": "shop",
"previous_git_commit": "62fce2b5efcc5072e83e60e0830cae98b0aaf32d",
"pulled_images": false,
"status": "active",
"type": "compose",
"updated": "2026-11-06T23:53:12Z",
"updated_by": "admin"
}Remove unused images
Free disk space by removing images no container uses: untagged ones, or every unused one, optionally only those older than some hours.
Inputs
- Environment
environmenttextRequired - The Docker environment, as Portainer names it, or its ID.
- Only untagged images
only_untaggedtrue/false - Remove only images without a tag (old versions left behind by updates). Off removes every image no container uses.Default:
true. - Older than (hours)
older_than_hoursnumber - Only images made more than this many hours ago, such as 168 for a week.At least 1.
Outputs
deletedlist- The removed images' IDs
environmenttext- The environment's name
images_deletednumber- How many images were removed
only_untaggedtrue/false- Whether only untagged images were removed
space_reclaimedtext- How much disk space was freed, such as 1.2 GB
space_reclaimed_bytesnumber- How much disk space was freed, in bytes
untaggedlist- The tags taken off, such as nginx:1.27
Example output
{
"deleted": [
"sha256:5b0f8c2a7e1d4c3b9a8f7e6d5c4b3a2f1e0d9c8b7a6f5e4d3c2b1a0f9e8d7c6b"
],
"environment": "production",
"images_deleted": 1,
"only_untagged": true,
"space_reclaimed": "50.0 MB",
"space_reclaimed_bytes": 52428800,
"untagged": []
}Restart container
Restart a container, such as when it stops answering, from an alert or a chat command. A stopped one is started.
Inputs
- Environment
environmenttextRequired - The Docker environment the container is in, as Portainer names it, or its ID.
- Container
containertextRequired - The container: its name, such as shop-web-1, or its ID (from a trigger or an earlier step).
- Seconds to wait
wait_secondsnumber - How long to let it shut down before it's forced to. Defaults to 10.From 0 to 600.
Outputs
changedtrue/false- False when it already was so, and nothing was done
createdtext- When it was created (UTC)
environmenttext- The environment's name
environment_idnumber- The environment's ID
errortext- Docker's error, if it couldn't start
exit_codenumber- The exit code it last stopped with
failing_streaknumber- How many health checks in a row have failed
finished_attext- When it last stopped (UTC); blank if never
healthtext- healthy, unhealthy, starting, or none without a health check
idtext- The container's full ID
imagetext- Its image, such as nginx:alpine
last_health_checktext- What its last health check printed
linktext- A link to it in Portainer
nametext- Its name
networkslist- The networks it's on
oom_killedtrue/false- Whether it was stopped for running out of memory
portslist- Its published ports, such as 8080->80/tcp
restart_countnumber- How many times Docker has restarted it
restart_policytext- Its restart policy: no, always, unless-stopped or on-failure
runningtrue/false- Whether it is running
servicetext- Its service in that stack, if any
short_idtext- Its short ID, the first 12 characters
stacktext- The stack (Compose project) it belongs to, if any
started_attext- When it last started (UTC)
statetext- running, exited, restarting, paused, created or dead
ttytrue/false- Whether it has a terminal (TTY)
Example output
{
"changed": true,
"created": "2026-11-06T21:40:54.987654321Z",
"environment": "production",
"environment_id": 1,
"error": "",
"exit_code": 0,
"failing_streak": 0,
"finished_at": "",
"health": "healthy",
"id": "8e2014789068049ac9367041896c9de6cb4c11c24ae84946b7414111e4954539",
"image": "nginx:alpine",
"last_health_check": "",
"link": "https://portainer.example.com/#!/1/docker/containers/8e2014789068049ac9367041896c9de6cb4c11c24ae84946b7414111e4954539",
"name": "shop-web-1",
"networks": [
"shop_default"
],
"oom_killed": false,
"ports": [
"8080->80/tcp"
],
"restart_count": 0,
"restart_policy": "unless-stopped",
"running": true,
"service": "web",
"short_id": "8e2014789068",
"stack": "shop",
"started_at": "2026-11-06T21:40:55.123456789Z",
"state": "running",
"tty": false
}Start container
Start a stopped container. One already running is left as it is.
Inputs
- Environment
environmenttextRequired - The Docker environment the container is in, as Portainer names it, or its ID.
- Container
containertextRequired - The container: its name, such as shop-web-1, or its ID (from a trigger or an earlier step).
Outputs
changedtrue/false- False when it already was so, and nothing was done
createdtext- When it was created (UTC)
environmenttext- The environment's name
environment_idnumber- The environment's ID
errortext- Docker's error, if it couldn't start
exit_codenumber- The exit code it last stopped with
failing_streaknumber- How many health checks in a row have failed
finished_attext- When it last stopped (UTC); blank if never
healthtext- healthy, unhealthy, starting, or none without a health check
idtext- The container's full ID
imagetext- Its image, such as nginx:alpine
last_health_checktext- What its last health check printed
linktext- A link to it in Portainer
nametext- Its name
networkslist- The networks it's on
oom_killedtrue/false- Whether it was stopped for running out of memory
portslist- Its published ports, such as 8080->80/tcp
restart_countnumber- How many times Docker has restarted it
restart_policytext- Its restart policy: no, always, unless-stopped or on-failure
runningtrue/false- Whether it is running
servicetext- Its service in that stack, if any
short_idtext- Its short ID, the first 12 characters
stacktext- The stack (Compose project) it belongs to, if any
started_attext- When it last started (UTC)
statetext- running, exited, restarting, paused, created or dead
ttytrue/false- Whether it has a terminal (TTY)
Example output
{
"changed": true,
"created": "2026-11-06T21:40:54.987654321Z",
"environment": "production",
"environment_id": 1,
"error": "",
"exit_code": 0,
"failing_streak": 0,
"finished_at": "",
"health": "healthy",
"id": "8e2014789068049ac9367041896c9de6cb4c11c24ae84946b7414111e4954539",
"image": "nginx:alpine",
"last_health_check": "",
"link": "https://portainer.example.com/#!/1/docker/containers/8e2014789068049ac9367041896c9de6cb4c11c24ae84946b7414111e4954539",
"name": "shop-web-1",
"networks": [
"shop_default"
],
"oom_killed": false,
"ports": [
"8080->80/tcp"
],
"restart_count": 0,
"restart_policy": "unless-stopped",
"running": true,
"service": "web",
"short_id": "8e2014789068",
"stack": "shop",
"started_at": "2026-11-06T21:40:55.123456789Z",
"state": "running",
"tty": false
}Start stack
Start a stopped stack's containers. One already running is left as it is.
Inputs
- Stack
stacktextRequired - The stack: its name, such as shop, or its ID.
- Environment
environmenttext - The environment the stack is in. Only needed when two environments have a stack of that name.
Outputs
auto_updatetrue/false- Whether Portainer redeploys it by itself (GitOps updates)
changedtrue/false- False when it already was so, and nothing was done
compose_filetext- The compose file's path, such as docker-compose.yml
createdtext- When it was made (UTC)
created_bytext- Who made it
env_nameslist- The names of its environment variables
environmenttext- The environment's name
environment_idnumber- The environment's ID
from_gittrue/false- Whether it is deployed from a Git repository
git_committext- The commit it is deployed from, if from Git
git_referencetext- The branch or tag it follows, such as refs/heads/main
git_urltext- The Git repository, if from Git
idnumber- The stack's ID, for other Portainer steps
linktext- A link to it in Portainer
messagetext- Why its last deployment failed, if it did
nametext- Its name
previous_git_committext- The commit it was deployed from before
statustext- active, inactive, deploying or failed
typetext- compose, swarm or kubernetes
updatedtext- When it was last changed (UTC); blank if never
updated_bytext- Who last changed it
Example output
{
"auto_update": false,
"changed": true,
"compose_file": "docker-compose.yml",
"created": "2026-11-06T23:52:52Z",
"created_by": "admin",
"env_names": [
"APP_VERSION"
],
"environment": "production",
"environment_id": 1,
"from_git": true,
"git_commit": "2ce3eefe292f029fb23c07a82c8308c429dd70b3",
"git_reference": "refs/heads/main",
"git_url": "https://github.com/example/shop",
"id": 2,
"link": "https://portainer.example.com/#!/1/docker/stacks/shop?id=2&type=2®ular=true&orphaned=false&orphanedRunning=false",
"message": "",
"name": "shop",
"previous_git_commit": "2ce3eefe292f029fb23c07a82c8308c429dd70b3",
"status": "active",
"type": "compose",
"updated": "2026-11-06T23:53:12Z",
"updated_by": "admin"
}Stop container
Stop a running container, letting it shut down first. One already stopped is left as it is.
Inputs
- Environment
environmenttextRequired - The Docker environment the container is in, as Portainer names it, or its ID.
- Container
containertextRequired - The container: its name, such as shop-web-1, or its ID (from a trigger or an earlier step).
- Seconds to wait
wait_secondsnumber - How long to let it shut down before it's forced to. Defaults to 10.From 0 to 600.
Outputs
changedtrue/false- False when it already was so, and nothing was done
createdtext- When it was created (UTC)
environmenttext- The environment's name
environment_idnumber- The environment's ID
errortext- Docker's error, if it couldn't start
exit_codenumber- The exit code it last stopped with
failing_streaknumber- How many health checks in a row have failed
finished_attext- When it last stopped (UTC); blank if never
healthtext- healthy, unhealthy, starting, or none without a health check
idtext- The container's full ID
imagetext- Its image, such as nginx:alpine
last_health_checktext- What its last health check printed
linktext- A link to it in Portainer
nametext- Its name
networkslist- The networks it's on
oom_killedtrue/false- Whether it was stopped for running out of memory
portslist- Its published ports, such as 8080->80/tcp
restart_countnumber- How many times Docker has restarted it
restart_policytext- Its restart policy: no, always, unless-stopped or on-failure
runningtrue/false- Whether it is running
servicetext- Its service in that stack, if any
short_idtext- Its short ID, the first 12 characters
stacktext- The stack (Compose project) it belongs to, if any
started_attext- When it last started (UTC)
statetext- running, exited, restarting, paused, created or dead
ttytrue/false- Whether it has a terminal (TTY)
Example output
{
"changed": true,
"created": "2026-11-06T21:40:54.987654321Z",
"environment": "production",
"environment_id": 1,
"error": "",
"exit_code": 0,
"failing_streak": 0,
"finished_at": "",
"health": "healthy",
"id": "8e2014789068049ac9367041896c9de6cb4c11c24ae84946b7414111e4954539",
"image": "nginx:alpine",
"last_health_check": "",
"link": "https://portainer.example.com/#!/1/docker/containers/8e2014789068049ac9367041896c9de6cb4c11c24ae84946b7414111e4954539",
"name": "shop-web-1",
"networks": [
"shop_default"
],
"oom_killed": false,
"ports": [
"8080->80/tcp"
],
"restart_count": 0,
"restart_policy": "unless-stopped",
"running": true,
"service": "web",
"short_id": "8e2014789068",
"stack": "shop",
"started_at": "2026-11-06T21:40:55.123456789Z",
"state": "running",
"tty": false
}Stop stack
Stop a stack's containers, keeping the stack to start again later. One already stopped is left as it is.
Inputs
- Stack
stacktextRequired - The stack: its name, such as shop, or its ID.
- Environment
environmenttext - The environment the stack is in. Only needed when two environments have a stack of that name.
Outputs
auto_updatetrue/false- Whether Portainer redeploys it by itself (GitOps updates)
changedtrue/false- False when it already was so, and nothing was done
compose_filetext- The compose file's path, such as docker-compose.yml
createdtext- When it was made (UTC)
created_bytext- Who made it
env_nameslist- The names of its environment variables
environmenttext- The environment's name
environment_idnumber- The environment's ID
from_gittrue/false- Whether it is deployed from a Git repository
git_committext- The commit it is deployed from, if from Git
git_referencetext- The branch or tag it follows, such as refs/heads/main
git_urltext- The Git repository, if from Git
idnumber- The stack's ID, for other Portainer steps
linktext- A link to it in Portainer
messagetext- Why its last deployment failed, if it did
nametext- Its name
previous_git_committext- The commit it was deployed from before
statustext- active, inactive, deploying or failed
typetext- compose, swarm or kubernetes
updatedtext- When it was last changed (UTC); blank if never
updated_bytext- Who last changed it
Example output
{
"auto_update": false,
"changed": true,
"compose_file": "docker-compose.yml",
"created": "2026-11-06T23:52:52Z",
"created_by": "admin",
"env_names": [
"APP_VERSION"
],
"environment": "production",
"environment_id": 1,
"from_git": true,
"git_commit": "2ce3eefe292f029fb23c07a82c8308c429dd70b3",
"git_reference": "refs/heads/main",
"git_url": "https://github.com/example/shop",
"id": 2,
"link": "https://portainer.example.com/#!/1/docker/stacks/shop?id=2&type=2®ular=true&orphaned=false&orphanedRunning=false",
"message": "",
"name": "shop",
"previous_git_commit": "2ce3eefe292f029fb23c07a82c8308c429dd70b3",
"status": "active",
"type": "compose",
"updated": "2026-11-06T23:53:12Z",
"updated_by": "admin"
}Update stack
Change a stack's compose file, or set or remove its environment variables, and redeploy it. A stack from Git takes only variables; its file comes from the repository.
Inputs
- Stack
stacktextRequired - The stack: its name, such as shop, or its ID.
- Environment
environmenttext - The environment the stack is in. Only needed when two environments have a stack of that name.
- Compose file
compose_filetext - The whole new compose file (docker-compose.yml). Leave blank to keep it.
- Environment variables
environment_variablestext - Variables to set, one per line, such as APP_VERSION=1.4.2. Each replaces the stack's variable of that name or is added; the rest stay as they are.
- Remove variables
remove_variablestext - Names of variables to take off the stack, one per line, such as OLD_FLAG.
- Pull newer images
pull_imagestrue/false - Pull the newest version of each image's tag before deploying. Off uses the images already on the server.Default:
false. - Remove old services
prunetrue/false - Remove services that are no longer in the compose file. Leave blank to keep the stack's own setting.
Outputs
auto_updatetrue/false- Whether Portainer redeploys it by itself (GitOps updates)
changed_variableslist- The environment variables set
compose_filetext- The compose file's path, such as docker-compose.yml
compose_file_changedtrue/false- Whether a new compose file was given
createdtext- When it was made (UTC)
created_bytext- Who made it
env_nameslist- The names of its environment variables
environmenttext- The environment's name
environment_idnumber- The environment's ID
from_gittrue/false- Whether it is deployed from a Git repository
git_committext- The commit it is deployed from, if from Git
git_referencetext- The branch or tag it follows, such as refs/heads/main
git_urltext- The Git repository, if from Git
idnumber- The stack's ID, for other Portainer steps
linktext- A link to it in Portainer
messagetext- Why its last deployment failed, if it did
nametext- Its name
previous_git_committext- The commit it was deployed from before
pulled_imagestrue/false- Whether newer images were pulled first
removed_variableslist- The environment variables removed
statustext- active, inactive, deploying or failed
typetext- compose, swarm or kubernetes
updatedtext- When it was last changed (UTC); blank if never
updated_bytext- Who last changed it
Example output
{
"auto_update": false,
"changed_variables": [
"APP_VERSION"
],
"compose_file": "docker-compose.yml",
"compose_file_changed": true,
"created": "2026-11-06T23:52:52Z",
"created_by": "admin",
"env_names": [
"APP_VERSION"
],
"environment": "production",
"environment_id": 1,
"from_git": false,
"git_commit": "",
"git_reference": "",
"git_url": "",
"id": 2,
"link": "https://portainer.example.com/#!/1/docker/stacks/shop?id=2&type=2®ular=true&orphaned=false&orphanedRunning=false",
"message": "",
"name": "shop",
"previous_git_commit": "",
"pulled_images": false,
"removed_variables": [
"OLD_FLAG"
],
"status": "active",
"type": "compose",
"updated": "2026-11-06T23:53:12Z",
"updated_by": "admin"
}