Skip to Content
CLI & APICommand reference

stackblaze apps

Manage apps

Usage: stackblaze apps|app [options] [command]

Manage apps

Options:
  -h, --help                          Print help

Commands:
  list [options]                      List apps across projects
  get [options] [name]                Show app details (spec, status, pods,
                                      events); [name] = app (default: linked
                                      app)
  restart [options] [name]            Rolling restart of an app; [name] = app
                                      (default: linked app)
  redeploy [options] [name]           Redeploy an app: git apps rebuild, image
                                      apps re-pull (or --tag); [name] = app
  scale [options] [assignments...]    Scale web/worker instances or autoscaling
                                      (one release)
  delete [options] [name]             Delete an app and the databases only it
                                      uses (with their data); [name] = app
                                      (default: linked app)
  rename [options] <name> <new-name>  Rename an app (the name people see; its
                                      resource name, URL and data stay the
                                      same); <name> = current name
  create [options] [name]             Create an app (docker image or git repo)
  update [options] [name]             Update app config (branch, image, port,
                                      pod size, domain, health check, start
                                      command, env); [name] = app
  help [command]                      Print this message or the help of the
                                      given subcommand(s)

apps list

Usage: stackblaze apps list [options]

List apps across projects

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)
  -o, --output <format>  Output format: text or json (choices: "text", "json")
  -h, --help             Print help

Example

List the apps in one project, with the environment each one runs in.

stackblaze apps list -p github-demo-gv35
┌──────────────────┬─────────────┬───────┬──────────┐
│ Project          │ Environment │ App   │ Strategy │
├──────────────────┼─────────────┼───────┼──────────┤
│ github-demo-gv35 │ dev         │ nginx │ docker   │
└──────────────────┴─────────────┴───────┴──────────┘

apps get

Usage: stackblaze apps get [options] [name]

Show app details (spec, status, pods, events); [name] = app (default: linked
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)
  -o, --output <format>  Output format: text or json (choices: "text", "json")
  -h, --help             Print help

Example

Show an app's resource name, public URL, status, pod count and number of variables.

stackblaze apps get hello-web -p github-demo-cw8z -e dev
OK github-demo-cw8z/dev/hello-web
resource: hello-web-qw6y
url:    https://hello-web-qw6y.cloud-dev-central-1.stackblaze.app
status: running
pods:   1
env:    2 variable(s)

Add --json for the full spec (image, health check, ingress, resources, variables with masked values).

apps restart

Usage: stackblaze apps restart [options] [name]

Rolling restart of an app; [name] = app (default: linked 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)
  -o, --output <format>  Output format: text or json (choices: "text", "json")
  -h, --help             Print help

Example

Rolling restart of an app by name: same image, no rebuild.

stackblaze apps restart hello-web -p github-demo-cw8z -e dev
OK Restarted github-demo-cw8z/dev/hello-web (same image, no rebuild)

apps redeploy

Usage: stackblaze apps redeploy [options] [name]

Redeploy an app: git apps rebuild, image apps re-pull (or --tag); [name] = 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)
  --tag <tag>            Deploy this image tag instead
  -m, --message <text>   Release message shown in the deployments timeline
  -o, --output <format>  Output format: text or json (choices: "text", "json")
  -h, --help             Print help

Example

Deploy an image app on a different tag.

stackblaze apps redeploy hello-web -p github-demo-cw8z -e dev --tag 1.27.4-alpine -m "nginx 1.27.4"
OK Deploying github-demo-cw8z/dev/hello-web → tag 1.27.4-alpine

apps scale

Usage: stackblaze apps scale [options] [assignments...]

Scale web/worker instances or autoscaling (one release)

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)
  --skip-deploy                  Stage the change on the server instead of
                                 deploying it (apply later with `pending
                                 apply`) (default: false)
  -m, --message <text>           Release message shown in the deployments
                                 timeline
  -r, --replicas <n>             Instance count for --process (0–50, legacy
                                 form)
  --process <name>               Process for -r: web or worker (default: "web")
  --autoscale <process=min:max>  Enable autoscaling (repeatable), e.g. web=2:5
  --autoscale-off <process>      Disable autoscaling for a process (repeatable)
  -o, --output <format>          Output format: text or json (choices: "text",
                                 "json")
  -h, --help                     Print help

Examples:
  $ stackblaze scale web=3                  run 3 web instances
  $ stackblaze scale web=2 worker=1         both processes, one release
  $ stackblaze scale --autoscale web=2:5    autoscale between 2 and 5 web instances
  $ stackblaze scale --autoscale-off web    back to a fixed instance count
  $ stackblaze scale -r 0 --process worker  legacy single-process form

Instance counts are checked against your plan's per-service limit. Use
--skip-deploy to stage the change and ship it later with other staged changes.

Example

Turn on autoscaling between 1 and 3 web instances, then go back to a fixed single instance.

stackblaze apps scale -p github-demo-cw8z -e dev -a hello-web --autoscale web=1:3 -m "Autoscale web"
stackblaze apps scale -p github-demo-cw8z -e dev -a hello-web --autoscale-off web web=1
OK Scaled github-demo-cw8z/dev/hello-web web → autoscaling 1–3
OK Scaled github-demo-cw8z/dev/hello-web web → 1 instance(s) (was 2), autoscaling off

apps delete

Usage: stackblaze apps delete [options] [name]

Delete an app and the databases only it uses (with their data); [name] = app
(default: linked 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)
  -y, --yes              Skip confirmation prompt (default: false)
  --keep-data            Delete only the app; keep its databases and their data
                         (default: false)
  -o, --output <format>  Output format: text or json (choices: "text", "json")
  -h, --help             Print help

Example

Delete an app together with the PostgreSQL database only it uses. Without -y the CLI lists what will go and asks you to confirm; pass --keep-data to keep the database.

stackblaze apps delete hello-site -y -p github-demo-cw8z -e dev
OK Deleted github-demo-cw8z/dev/hello-site
OK Deleted database hello-web-qw6y-postgresql-s32l (PostgreSQL) and its data

apps rename

Usage: stackblaze apps rename [options] <name> <new-name>

Rename an app (the name people see; its resource name, URL and data stay the
same); <name> = current name

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)
  -o, --output <format>  Output format: text or json (choices: "text", "json")
  -h, --help             Print help

Example

Change the name people see for an app. Its resource name, URL and data stay the same, and the new name works with -a and apps get.

stackblaze apps rename hello-web hello-site -p github-demo-cw8z -e dev
stackblaze apps get hello-site -p github-demo-cw8z -e dev
OK Renamed github-demo-cw8z/dev/hello-web → hello-site
Only the name people see changed; the app, its URL and data are untouched.
OK github-demo-cw8z/dev/hello-site
resource: hello-web-qw6y
url:    https://hello-web-qw6y.cloud-dev-central-1.stackblaze.app
…

apps create

Usage: stackblaze apps create [options] [name]

Create an app (docker image or git repo)

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
  --phase <name>             Environment name (default: production)
  -a, --app <name>           App name
  --json                     Output JSON (same as -o json) (default: false)
  --mode <mode>              docker or git (default: docker with --image, git
                             with --repository) (choices: "docker", "git")
  --name <name>              App name (or pass it positionally)
  --image <ref>              Docker image, e.g. nginx:1.27 (docker mode)
  --tag <tag>                Image tag when --image has none (default: latest)
  --repository <url>         Git URL (git mode)
  --branch <name>            Git branch (default: "main")
  --buildstrategy <s>        buildpacks, dockerfile, railpack, or plain
  --build-context <dir>      Mono-repo build context
  --dockerfile-path <path>   Dockerfile path
  --port <n>                 Container port (docker: default = the image EXPOSE
                             port)
  --worker                   Background worker: no port, no public URL
                             (default: false)
  --replicas <n>             Instance count (default: 1)
  --domain <host>            Custom domain
  --addon <name>             Attach addon by kind/name (repeatable)
  --env <pair>               KEY=value (repeatable)
  --healthcheck              Turn the HTTP health check on (a new version takes
                             traffic once it passes)
  --no-healthcheck           Turn the health check off (rollouts are not gated)
  --healthcheck-path <path>  Health check path, e.g. /api/health (default /;
                             turns the check on)
  --start-command <cmd>      Run this instead of the image or build's start
                             command, e.g. "node dist/main"
  --wait                     Poll until running (default: false)
  --timeout <seconds>        Max --wait time (default 600)
  -o, --output <format>      Output format: text or json (choices: "text",
                             "json")
  -h, --help                 Print help

Example

Create an app from a Docker image in the dev environment, with its port and one variable, and wait until it is running.

stackblaze apps create hello-web -p github-demo-cw8z --phase dev \
  --image nginxinc/nginx-unprivileged:1.27-alpine --port 8080 \
  --env GREETING=hello --wait
OK Created github-demo-cw8z/dev/hello-web (docker nginxinc/nginx-unprivileged:1.27-alpine)
Waiting for github-demo-cw8z/dev/hello-web-qw6y to be ready (up to 10m00s)…
  github-demo-cw8z/dev/hello-web-qw6y: deploying — Waiting for hello-web-qw6y-web deployment; rolling out (Deploy 1.27-alpine): waiting for the new pod (1s elapsed)
…
  github-demo-cw8z/dev/hello-web-qw6y: deploying — Deployment does not have minimum availability. (1m45s elapsed)
OK github-demo-cw8z/dev/hello-web-qw6y is ready
url: https://hello-web-qw6y.cloud-dev-central-1.stackblaze.app

The app keeps the name you gave it (hello-web); its resource name and URL get a short suffix (hello-web-qw6y).

apps update

Usage: stackblaze apps update [options] [name]

Update app config (branch, image, port, pod size, domain, health check, start
command, env); [name] = 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
  --phase <name>             Environment name (default: production)
  -a, --app <name>           App name
  --json                     Output JSON (same as -o json) (default: false)
  --branch <name>            Git branch
  --image <ref>              Docker image, e.g. nginx or nginx:1.27 (a bare
                             name keeps the current tag)
  --tag <tag>                Docker image tag
  --port <n>                 Container port
  -r, --replicas <n>         Web instances
  --worker-replicas <n>      Worker instances
  --podsize <name>           Pod size name from platform config
  --domain <host>            Custom domain (replaces ingress hosts)
  --buildstrategy <s>        buildpacks, dockerfile, railpack, or plain
  --build-context <dir>      Mono-repo build context
  --dockerfile-path <path>   Dockerfile path
  --healthcheck              Turn the HTTP health check on (a new version takes
                             traffic once it passes)
  --no-healthcheck           Turn the health check off (rollouts are not gated)
  --healthcheck-path <path>  Health check path, e.g. /api/health (default /;
                             turns the check on)
  --start-command <cmd>      Run this instead of the image or build's start
                             command (no Procfile commit needed)
  --no-start-command         Go back to the image or build's own start command
  --env <pair>               KEY=value (repeatable)
  -o, --output <format>      Output format: text or json (choices: "text",
                             "json")
  -h, --help                 Print help

Example

Move an image app to a new tag and turn on the HTTP health check, so the new version only takes traffic once / answers.

stackblaze apps update hello-web -p github-demo-cw8z --phase dev \
  --tag 1.27.3-alpine --healthcheck-path /
OK Updated github-demo-cw8z/dev/hello-web
image.tag, healthcheck.path=/, healthcheck on

On this page