CLI & APICommand reference
stackblaze import
Create the services and databases a docker-compose.yml, render.yaml, fly.toml or stackblaze.yaml describes, in a project environment
Usage: stackblaze import [options] <file>
Create the services and databases a docker-compose.yml, render.yaml, fly.toml
or stackblaze.yaml describes, in a project environment
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)
--json Output JSON (same as -o json) (default: false)
--format <name> Importer to use (default: from the filename, else the
content) (choices: "auto", "stackblaze", "render",
"compose", "fly", default: "auto")
--answer <KEY=value> Value for an env var the file leaves to you (sync:
false); repeatable. Asked interactively when omitted
--dry-run Show what would be created; create nothing (default:
false)
-o, --output <format> Output format: text or json (choices: "text", "json")
-h, --help Print help
The file is compiled by the platform (nothing is created yet), then each
database is declared on the environment and each service is created — the
same two steps as committing an import on the dashboard canvas, so the
result is the same. Names already used in the environment are suffixed, and
the table says so. Anything the importer cannot carry over is printed as a
warning. Builds start right away; follow one with `stackblaze wait -a <app>`.
Formats: docker-compose.yml / compose.yaml (services; postgres/redis/… images
become databases), render.yaml, fly.toml (one app), stackblaze.yaml.
Examples:
$ stackblaze import docker-compose.yml -p shop
$ stackblaze import render.yaml -p shop -e staging --dry-run
$ stackblaze import fly.toml -p shop --answer SESSION_SECRET=… --json
May be disabled by your platform admin.Example
Preview what a docker-compose.yml with a web server and a Redis cache would create. --dry-run creates nothing; the warnings say what the importer changes:
services:
web:
image: nginxinc/nginx-unprivileged:1.27-alpine
ports:
- "8080:8080"
environment:
REDIS_URL: redis://cache:6379
depends_on:
- cache
cache:
image: redis:7-alpinestackblaze import docker-compose.yml -p github-demo-cw8z -e dev --dry-runOK docker-compose.yml (docker-compose) → github-demo-cw8z/dev: 1 service, 1 database would be created
┌──────────┬──────────────────────┬─────────┐
│ Resource │ Kind │ Plan │
├──────────┼──────────────────────┼─────────┤
│ cache │ database (Valkey) │ planned │
├──────────┼──────────────────────┼─────────┤
│ web │ app (docker · plain) │ planned │
└──────────┴──────────────────────┴─────────┘
! docker-compose.yml: "web" REDIS_URL was repointed at the cache add-on (compose service DNS does not carry over)
! docker-compose.yml: "web" depends_on is ignored — services start independently and retry
--dry-run: nothing was created. Run again without it to import.