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.
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:
- Creates the web app on your server
- Grants the deploy user read access to the repo
- Attaches the repo and registers the push webhook
- Adds the domain and requests a certificate
- Triggers the first deployment
- Writes a
bonsai.jsonto the repo so later commands know the target
Options
| Flag | Description |
|---|---|
--repo | GitHub repository, owner/repo or a full URL. Required. |
--domain | Domain or subdomain to serve on. Required. |
--preset | html · astro · vite · eleventy · hugo · php. Auto-detected from a local checkout if omitted. |
--branch | Branch to deploy. Defaults to main. |
--no-ssl | Skip 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.
| Preset | Build | Served |
|---|---|---|
html | — | files as-is |
astro | npm ci && npm run build | /dist |
vite | npm ci && npm run build | /dist |
eleventy | npm ci && npm run build | /_site |
hugo | hugo --minify | /public |
php | — | Apache + PHP-FPM |
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
| Command | What it does |
|---|---|
bonsai init | Configure the CLI (token, default server, team). |
bonsai doctor | Verify configuration and connectivity. |
bonsai deploy <name> | Provision + deploy a site in one command. |
bonsai list | List 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:
| Variable | Purpose |
|---|---|
BONSAI_TOKEN | API token for your account. |
BONSAI_GITHUB_TOKEN | GitHub token for repo access + the webhook. |
BONSAI_SERVER_ID | Default server to deploy to. |
BONSAI_DEPLOY_TEAM | GitHub team granted read access to lander repos. |
BONSAI_BASE_DOMAIN | Default base domain for new sites. |
FAQ
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.
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.
Yes — bonsai rollback restores a previous version in seconds, without rewriting history.
On tuned Nginx on dedicated hardware — no cold starts, no per-request billing, no noisy neighbours.
It's free during early access. We'll introduce plans down the line; nothing you deploy now will be pulled out from under you.