Skip to Content
CLI & APICommand reference

stackblaze deployments

Deployment history and rollback

Usage: stackblaze deployments|deployment [options] [command]

Deployment history and rollback

Options:
  -h, --help                      Print help

Commands:
  list [options]                  List deploy history (git builds and image
                                  deploys) for an app
  rollback [options] [deploy-id]  Roll back to an earlier deploy (its image and
                                  configuration, or a config release); previous
                                  success if omitted
  help [command]                  Print this message or the help of the given
                                  subcommand(s)

deployments list

Usage: stackblaze deployments list [options]

List deploy history (git builds and image deploys) for an app

Options:
  --api-url <url>        StackBlaze API base URL (env STACKBLAZE_API_URL)
  --token <token>        API token, sb_pat_... (env STACKBLAZE_TOKEN)
  -p, --project <name>   Project name
  -e, --env <name>       Environment name (default: production)
  -a, --app <name>       App name
  --json                 Output JSON (same as -o json) (default: false)
  -n, --limit <n>        Max entries (server default 100)
  -o, --output <format>  Output format: text or json (choices: "text", "json")
  -h, --help             Print help

Example

Show an app's last five deploys: image deploys, redeploys and config releases, with the message each one was shipped with.

stackblaze deployments list -p github-demo-cw8z -e dev -a hello-web -n 5
┌───────────────────────────┬────────────┬─────────────────┬───────────────────────────────────────────┬────────────────────────────────┬──────────────────────────┐
│ ID                        │ Status     │ Trigger         │ Ref                                       │ Message                        │ Created                  │
├───────────────────────────┼────────────┼─────────────────┼───────────────────────────────────────────┼────────────────────────────────┼──────────────────────────┤
│ cmww8ehr10048wn01ja1kspc2 │ live       │ config          │ nginxinc/nginx-unprivileged:1.27.4-alpine │ Beta channel on two instances  │ 2026-11-25T14:41:15.613Z │
├───────────────────────────┼────────────┼─────────────────┼───────────────────────────────────────────┼────────────────────────────────┼──────────────────────────┤
│ cmww8dg8t009iuz01803q6juc │ canceled   │ tag_deploy      │ nginxinc/nginx-unprivileged:1.27.4-alpine │ nginx 1.27.4                   │ 2026-11-25T14:40:27.006Z │
├───────────────────────────┼────────────┼─────────────────┼───────────────────────────────────────────┼────────────────────────────────┼──────────────────────────┤
│ cmww8bms8008quz014dxaeq6m │ superseded │ manual_redeploy │ nginxinc/nginx-unprivileged:1.27.3-alpine │ Pick up the patched base image │ 2026-11-25T14:39:02.169Z │
├───────────────────────────┼────────────┼─────────────────┼───────────────────────────────────────────┼────────────────────────────────┼──────────────────────────┤
│ cmww89o0r0085uz017g5ufyyb │ superseded │ manual_redeploy │ nginxinc/nginx-unprivileged:1.27.3-alpine │ Restarted                      │ 2026-11-25T14:37:30.460Z │
├───────────────────────────┼────────────┼─────────────────┼───────────────────────────────────────────┼────────────────────────────────┼──────────────────────────┤
│ cmww886rq007muz0149xv0gdr │ superseded │ manual_redeploy │ nginxinc/nginx-unprivileged:1.27.3-alpine │ Restarted                      │ 2026-11-25T14:36:21.447Z │
└───────────────────────────┴────────────┴─────────────────┴───────────────────────────────────────────┴────────────────────────────────┴──────────────────────────┘

Pass an ID to stackblaze deployments rollback to go back to that deploy.

deployments rollback

Usage: stackblaze deployments rollback [options] [deploy-id]

Roll back to an earlier deploy (its image and configuration, or a config
release); previous success if omitted

Options:
  --api-url <url>        StackBlaze API base URL (env STACKBLAZE_API_URL)
  --token <token>        API token, sb_pat_... (env STACKBLAZE_TOKEN)
  -p, --project <name>   Project name
  -e, --env <name>       Environment name (default: production)
  -a, --app <name>       App name
  --json                 Output JSON (same as -o json) (default: false)
  --build <name>         Build job name to roll back to (same as the positional
                         id)
  --image-only           Redeploy only the image tag; keep the current
                         configuration and auto-deploy (default: false)
  --wait                 Poll until the app is running after rollback (default:
                         false)
  --timeout <seconds>    Max --wait time (default 600)
  -y, --yes              Skip confirmation prompt (default: false)
  -o, --output <format>  Output format: text or json (choices: "text", "json")
  -h, --help             Print help

<deploy-id> is an ID from `stackblaze deployments list` (a ledger id or a
build name). A past deploy comes back in full: its image AND the
configuration it ran with, and auto-deploy turns off so the next push does
not bring the change back (add-ons, volumes, domains and plan stay as they
are). --image-only redeploys just the image tag. Config releases roll back
the configuration. Works for image apps too.

--wait --json prints ONE JSON document (the rollback with a `wait` field)
and exits 1 when the app does not come up.

Example

Roll back to an earlier deploy from deployments list (its image and the configuration it ran with) and wait until the app is up again. Type yes to confirm, or pass -y.

stackblaze deployments rollback cmww8bms8008quz014dxaeq6m --wait -p github-demo-cw8z -e dev -a hello-web
!  This will roll github-demo-cw8z/dev/hello-web-qw6y back to image tag 1.27.3-alpine and the configuration it ran with (deploy cmww8bms8008quz014dxaeq6m).
!  Auto-deploy turns off, so the next push does not bring the change back. Add-ons, volumes and domains stay as they are.
Type "yes" to continue: yes
OK Rolled back github-demo-cw8z/dev/hello-web-qw6y → tag 1.27.3-alpine + its configuration (deploy cmww8bms8008quz014dxaeq6m)
Auto-deploy is off. Turn it back on in the app's settings in the dashboard once the fix is pushed.
Waiting for github-demo-cw8z/dev/hello-web-qw6y to be ready (up to 10m00s)…
OK github-demo-cw8z/dev/hello-web-qw6y is ready
url: https://hello-web-qw6y.cloud-dev-central-1.stackblaze.app

On this page