Skip to content
PocketBase Cloud CLI

Deploy PocketBase from your terminal.

One binary takes a project from your laptop to a deployed instance in the cloud, and manages everything in between — collections, records, API rules, hooks, backups, and deployments.

npm i -g @pocketbasecloud/cli

macOS, Linux and Windows. The curl installer needs no Node at all.

  • Native, self-contained binary
  • ·--json for scripting
  • ·Works with any PocketBase instance
my-app — zsh
# in a PocketBase project
pbc cloud deploy
  detected pocketbase · pb_hooks · pb_migrations
  packaging hooks and migrations
✓ live at https://my-app-db.pocketbasecloud.com
# same command, in a Vite app
pbc cloud deploy
  detected frontend · vite
  building npm run build
✓ live at https://web.pocketbasecloud.com
pbc cloud deploy
  detected pocketbase · pb_hooks
✓ live at https://my-app-db.pocketbasecloud.com
Use cases

What can you do with the CLI?

Three kinds of resource, one binary. Each deck below is the commands you would actually run, in the order you would run them.

01 / 03

PocketBase

Scaffold a project locally, deploy the instance, and ship your hooks and migrations with it.

3 steps
01·pocketbase

Develop locally

Scaffold a project and get a PocketBase binary on your machine in one command. The version is pinned in pbc.json, so everyone on the team runs the same build.

pbc initRead the local development docs
my-app — zsh
pbc init
  downloading pocketbase for this OS and CPU
  scaffolding pb_hooks/ · pb_migrations/
  pinning pocketbaseVersion in pbc.json
✓ ready — run ./pocketbase serve
./pocketbase serve
  listening http://127.0.0.1:8090
02·pocketbase

Deploy PocketBase

Your hooks and migrations ride along with the instance. Migrations are merged with the ones already there and applied by the restart that follows, so a redeploy never resets data.

pbc cloud pb deployRead the PocketBase docs
my-app — zsh
pbc cloud pb deploy --name my-app-db
  packaging pb_public · pb_hooks · pb_migrations
  hooks 2 files installed
  migrations merged with the instance
  restarting applying new migrations
✓ live at https://my-app-db.pocketbasecloud.com
03·pocketbase

Keep hooks in the repository

The dashboard editor is one way in. Keep pb_hooks/ in version control instead, review hooks like the rest of your code, and push the directory when it is ready.

pbc cloud pb hooks pushRead the hooks docs
my-app — zsh
pbc cloud pb hooks push ./pb_hooks --name my-app-db
  uploading main.pb.js · billing.pb.js
  reloading my-app-db
✓ 2 hooks active
# watch one run in production
pbc cloud logs pb --name my-app-db -f
02 / 03

Frontend hosting

Build, package, and upload a static site, then put your own domain in front of it.

2 steps
01·frontend

Deploy a frontend

One command runs your build, packages the output, uploads it, and waits for HTTPS to come up. The first deploy records the site in pbc.json, so every deploy after it needs no flags at all.

pbc cloud frontend deployRead the frontend docs
web — zsh
pbc cloud frontend deploy --name web
  building npm run build
  packaging dist/ · 1.2 MB
  uploading waiting for HTTPS
✓ live at https://web.pocketbasecloud.com
# every deploy after this one
pbc cloud deploy
✓ redeployed in 11s
02·frontend

Attach a custom domain

Point a CNAME at your site, then let the CLI check it. Once DNS resolves, the certificate is issued for you — there is no dashboard step, and nothing to renew.

pbc cloud frontend domain addRead the custom domain docs
web — zsh
pbc cloud frontend domain add app.example.com --name web
  add a CNAME record at your DNS provider:
  app.example.com -> ntq3xk1.pocketbasecloud.com
# once the record has propagated
pbc cloud frontend domain verify app.example.com --name web
  dns resolves to the right target
  issuing certificate via ACME
✓ live at https://app.example.com
03 / 03

Backend hostingPro

Run Node.js, Deno, Bun or Next.js, with encrypted configuration and live logs.

2 steps
01·backendPro

Deploy a backend

The runtime, build command, and output directory are inferred from the directory itself — deno.json, bun.lockb, next.config, package.json — and written into pbc.json on the first deploy.

pbc cloud backend deployRead the backend docs
my-app-api — zsh
pbc cloud backend deploy --name my-app-api
  detected nextjs · next.config.ts
  building next build
  packaging source + lockfile
  installing dependencies in the container
✓ live at https://my-app-api.pocketbasecloud.com
02·backend

Set secrets, then watch them work

Environment variables are stored encrypted and applied on the next restart. When something misbehaves, follow the container’s log from the same terminal instead of opening a dashboard.

pbc cloud env setRead the environment docs
my-app-api — zsh
pbc cloud env set STRIPE_KEY=… --target backend --name my-app-api
✓ stored encrypted · restarting my-app-api
pbc cloud logs backend --name my-app-api -f
  12:04:11 POST /api/checkout 200 41ms
  12:04:12 POST /api/webhook 200 18ms
  12:04:19 GET /api/orders 200 9ms
Commands

One tool for the whole lifecycle

Scaffold and run PocketBase locally, deploy instances, backends, and static sites, then manage what you deployed — without leaving the shell.

Read the CLI docs
pbc --help

Local

Instance

Cloud

/ to filter · ↑↓ to move · enter to copy
PocketBase Cloud CLI

Install, log in, deploy.

Three commands between an empty terminal and a live deployment.

  1. 01Install
    npm i -g @pocketbasecloud/cli

    Or curl | sh — no Node required.

  2. 02Login
    pbc cloud login

    Opens a browser once, then remembers.

  3. 03Deploy
    pbc cloud deploy

    Detects what this directory is.