orbitpush init
Create the storage zone and pull zone for a site and write orbitpush.json, without deploying.
npx orbitpush init [options]
Sets up a site without deploying it. In a terminal you rarely need it, because the first deploy asks the same questions. Use init to set up a site from a script, or before your first build exists.
It asks for the project name, build output directory, main storage region, replication regions and CDN delivery regions. If BUNNY_API_KEY is not set, it also asks for the API key. Then it creates:
- a storage zone, named after the project,
- a pull zone with the storage zone as its origin, available at
https://<name>.b-cdn.net, - with
--domainand--alias, those hostnames on the pull zone, and prints the DNS record for each,
and writes orbitpush.json. It stops if orbitpush.json already exists.
Options
Each option skips the matching question. An option no command knows stops with an error.
| Option | Description |
|---|---|
--name <name> |
Storage zone and pull zone name. Letters, numbers and dashes. Default: the directory name |
--dir <path> |
Build output directory. Default: the first of dist, build, out, public that exists |
--domain <host> |
Primary domain |
--alias <host> |
Hostname that redirects to the domain. Repeatable |
--region <code> |
Main storage region: DE, UK, SE, NY, LA, SG, SYD, BR, JH. Default: DE |
--replication-region <code> |
Extra storage region. Repeatable. Default: none |
--delivery-region <zone> |
CDN delivery region: EU, US, ASIA, SA, AF. Repeatable. Default: EU, US |
-y, --yes |
Use the defaults for everything not given as an option |
Repeatable options also take a comma-separated list: --delivery-region EU,US.
Without a terminal
init needs --name and --dir, or --yes to take the defaults, so a guessed name never creates zones:
npx orbitpush init --name my-site --dir dist --domain www.example.com --alias example.com --region DE --delivery-region EU --delivery-region US --yes
Domains
Domains are not asked for. Add them later with orbitpush domains add, which waits for DNS and turns on HTTPS. For a domain given to init, run domains add for it once its DNS record is set.
Names
The pull zone and storage zone names are global across bunny.net. If the name is taken, choose another one.
When it fails
If init fails before orbitpush.json is written, it deletes the zones it just created, so you can run it again with the same name. If that cleanup fails too, init names the zone to delete in the dashboard. Failures after that point, such as a missing SSL certificate, are fixed by the next deploy.