Skip to Content
CLI & APICommand reference

stackblaze ssh

Open an interactive shell in an app pod (Console must be enabled for your organization - Platform → Console & SSH)

Usage: stackblaze ssh [options] [sshArgs...]

Open an interactive shell in an app pod (Console must be enabled for your
organization: Platform → Console & SSH)

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
  --pod <name>           Pod name (default: the app's first web pod)
  --container <name>     Container name: web, worker, … (default: web, else the
                         first)
  --command <shell>      Run this command instead of an interactive sh; exits
                         with its exit code
  --timeout <seconds>    Give up on --command after this many seconds (default:
                         no limit; a session that sends nothing at all fails
                         after 20s)
  --native               Use your system ssh client through the SSH gateway
                         (needs an SSH key on your account: stackblaze ssh-keys
                         add) (default: false)
  --print                With --native: print the ssh command instead of
                         running it (default: false)
  -i, --identity <file>  With --native: private key file for ssh (ssh -i)
  -h, --help             Print help

Modes:
  stackblaze ssh                       shell over the StackBlaze API (no SSH keys needed)
  stackblaze ssh --native              the real ssh client: ssh -p <port> project/env/app@<gateway>
  stackblaze ssh --native -- -L 8080:localhost:8080
                                       extra ssh arguments after --
  stackblaze ssh --native --print      print the command (for scripts, ~/.ssh/config, IDEs)

With --native, scp and sftp use the same user and host:
  scp -P <port> ./dump.sql project.production.web@<gateway>:/tmp/

Example

Run one command in the app's web pod and exit with its exit code. Leave out --command for an interactive shell.

stackblaze ssh -p github-demo-cw8z -e dev -a hello-web \
  --command 'nginx -v 2>&1; df -h /data/uploads | tail -1; ls --color=never /data/uploads/imports'
nginx version: nginx/1.27.3
JuiceFS:juicefs           1.0G      8.0K   1024.0M   0% /data/uploads
customers-2026-11.csv

On this page