Bonsai Cloud Docs
Documentation

Bonsai Cloud

Git push → live. Connect a repo and Bonsai Cloud provisions the web app, DNS, TLS, and the deploy webhook — then every push after that deploys itself.

Early access. Bonsai Cloud is free while we build it out. We'll sort out plans later — for now, deploy as much as you like.

Introduction

Bonsai Cloud is managed hosting for landing pages and small sites. You point it at a GitHub repository and a domain; it creates everything needed to serve that site and wires up continuous deployment. There's no dashboard clicking and no infrastructure to babysit.

It handles the whole loop for you:

  • The web app on tuned Nginx (native for static, hybrid for PHP)
  • The DNS record (auto-created for Cloudflare-managed domains)
  • A Let's Encrypt certificate, renewed automatically
  • An auto-deploy webhook so every push goes live
  • Instant, non-destructive rollback when you need it

Static site generators (Astro, Vite, Eleventy, Hugo), plain HTML, and PHP lead-capture landers are all first-class.

Quickstart

From zero to a live, HTTPS site in three commands.

1. Install the CLI

npm install -g @bonsaicloud/cli

2. Connect your account

bonsai init stores your token and picks your default server and team. It's interactive and only needs to run once.

bonsai init
bonsai doctor   # verify connectivity

3. Deploy

bonsai deploy acme \
  --repo edgedigital/acme-lander \
  --domain acme.example.com
✓ Web app created
✓ DNS record created (acme.example.com → 77.42.25.95)
✓ Repo attached · webhook registered
✓ SSL issued (Let's Encrypt, dns-01)
✓ Deployment triggered

Done. acme → https://acme.example.com  ·  ~50s

That's it — the site is live over HTTPS, and every push to the branch redeploys it. Run it from inside the repo and the preset is auto-detected; you can omit the name too.

The deploy command

bonsai deploy <name> --repo <owner/repo> --domain <fqdn> [options]

A single deploy runs the full provisioning sequence:

  1. Creates the web app on your server
  2. Grants the deploy user read access to the repo
  3. Attaches the repo and registers the push webhook
  4. Adds the domain and requests a certificate
  5. Triggers the first deployment
  6. Writes a bonsai.json to the repo so later commands know the target

Options

FlagDescription
--repoGitHub repository, owner/repo or a full URL. Required.
--domainDomain or subdomain to serve on. Required.
--presethtml · astro · vite · eleventy · hugo · php. Auto-detected from a local checkout if omitted.
--branchBranch to deploy. Defaults to main.
--no-sslSkip certificate issuance (serve over HTTP only).

Presets

A preset tells Bonsai how to build (if at all) and which directory to serve. It's auto-detected from your repo; pass --preset to be explicit.

PresetBuildServed
htmlfiles as-is
astronpm ci && npm run build/dist
vitenpm ci && npm run build/dist
eleventynpm ci && npm run build/_site
hugohugo --minify/public
phpApache + PHP-FPM
PHP landers. The php preset runs on a hybrid Nginx + Apache stack, so a lander's .htaccess and form handler work as-is. Secrets live in a server-side config.php (git-ignored) that you create once — see the FAQ.

Domains & SSL

Pass any domain to --domain. For domains on a connected Cloudflare account, Bonsai creates the DNS record for you and issues the certificate via DNS-01 validation — no manual steps. For other providers, point an A record at your server first; Bonsai checks that it resolves before requesting the certificate.

Certificates are Let's Encrypt and renew automatically. HTTPS is typically live within a minute of deploying.

Auto-deploy & rollback

After the first deploy, the push webhook is live: every push to the branch builds and goes live automatically. No dashboards, no manual redeploys.

Shipped something you'd like to undo? Roll back to any previous commit — non-destructively (a new commit restores the old content, so history is preserved):

bonsai rollback acme            # pick from recent commits
bonsai rollback acme --to 85e6c46   # or target a specific commit

Roll "forward" again with a normal push.

CLI reference

CommandWhat it does
bonsai initConfigure the CLI (token, default server, team).
bonsai doctorVerify configuration and connectivity.
bonsai deploy <name>Provision + deploy a site in one command.
bonsai listList the sites you've deployed.
bonsai logs [name]Show the latest deploy / activity log.
bonsai redeploy [name]Trigger a deployment manually.
bonsai rollback [name]Roll the live site back to a previous commit.
bonsai open [name]Open the live URL in your browser.
bonsai rm [name]Delete a site (guarded by a confirmation).

Commands that take [name] default to the bonsai.json in the current directory, so inside a repo you can just run bonsai redeploy.

Configuration

Config lives in ~/.bonsai/config.json (written by bonsai init). Every value can be overridden with an environment variable — handy for CI:

VariablePurpose
BONSAI_TOKENAPI token for your account.
BONSAI_GITHUB_TOKENGitHub token for repo access + the webhook.
BONSAI_SERVER_IDDefault server to deploy to.
BONSAI_DEPLOY_TEAMGitHub team granted read access to lander repos.
BONSAI_BASE_DOMAINDefault base domain for new sites.

FAQ

Is it only for static sites?

No. Static (HTML + any generator) and PHP lead-capture landers are both supported. PHP runs on a hybrid stack with the form handler and .htaccess intact.

How do PHP secrets stay safe?

The webhook URL and other secrets live in a server-side config.php that's git-ignored and created once on the server. It survives redeploys, and Bonsai keeps it (and the lead store) out of public reach.

Can I roll back a bad deploy?

Yes — bonsai rollback restores a previous version in seconds, without rewriting history.

Where does my site run?

On tuned Nginx on dedicated hardware — no cold starts, no per-request billing, no noisy neighbours.

What does it cost?

It's free during early access. We'll introduce plans down the line; nothing you deploy now will be pulled out from under you.