Skip to Content
CLI & APICommand reference

stackblaze volume

List extra volumes on the linked app

Usage: stackblaze volume|volumes [options] [command]

List extra volumes on the 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

Commands:
  list [options]           List extra volumes on the linked app
  add [options] [name]     Attach a persistent volume to the linked app
  delete [options] <name>  Detach an extra volume from the linked app

volume list

Usage: stackblaze volume list [options]

List extra volumes on the 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

List the volumes attached to an app.

stackblaze volume list -p github-demo-cw8z -e dev -a hello-web
┌─────────┬───────────────┬──────┬────────┐
│ Name    │ Mount         │ Size │ Class  │
├─────────┼───────────────┼──────┼────────┤
│ uploads │ /data/uploads │ 1Gi  │ shared │
└─────────┴───────────────┴──────┴────────┘

volume add

Usage: stackblaze volume add [options] [name]

Attach a persistent volume to the 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)
  --name <name>          Volume name, DNS-1123 (or pass it positionally)
  --mount <path>         Container mount path
  --size <qty>           Size (default: "5Gi")
  -o, --output <format>  Output format: text or json (choices: "text", "json")
  -h, --help             Print help

A volume belongs to this app. To share files between apps, add a Storage bucket and connect it to both apps.

Example

Attach a 1 GiB persistent volume to an app at /data/uploads. The app rolls out with it.

stackblaze volume add uploads --mount /data/uploads --size 1Gi -p github-demo-cw8z -e dev -a hello-web
OK Added volume uploads at /data/uploads on github-demo-cw8z/dev/hello-web-qw6y

volume delete

Usage: stackblaze volume delete [options] <name>

Detach an extra volume from the 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 (default: false)
  -o, --output <format>  Output format: text or json (choices: "text", "json")
  -h, --help             Print help

Example

Detach a volume from an app. Type the volume name to confirm, or pass -y.

stackblaze volume delete data -p github-demo-cw8z -e stage -a vite-starter
stackblaze volume list -p github-demo-cw8z -e stage -a vite-starter
!  This will detach volume data from the app.
Type the volume name to confirm: data
OK Removed volume data from github-demo-cw8z/stage/vite-starter-5tjx
No extra volumes on this app.

On this page