LanguageGB
App Deployment

Deploy a PocketBase app

PocketBase is a self-contained backend-as-a-service with built-in auth, SQLite database, file storage, real-time subscriptions, and a REST API — all in one binary. No code required. Deploy and configure entirely through the admin dashboard at /_/.

What this means

What this means

PocketBase is an open-source backend written in Go. A CM Cloud PocketBase deployment installs the PocketBase binary, creates a persistent pb_data/ directory, and — if you supply a Git repository — clones it and loads your pb_migrations/ and pb_hooks/ from it. Your data lives at the app level, not inside a release, so it survives redeployments and rollbacks. File storage is local to the runtime VM (not S3). Deploying without a repository still gives you a working, empty PocketBase you configure entirely through the dashboard at /_/.

Before you start

Before you start

Decide whether you want a code-defined backend or a dashboard-defined one. For code-defined, push a Git repository containing pb_migrations/ (collection schema and API rules) and/or pb_hooks/ (custom endpoints, scheduled jobs, mail) and paste its URL into the Artifact Reference field; private repos also need a GitHub token with repo scope. For dashboard-defined, leave that field empty and create everything in /_/. You do not need to install Go or compile anything.

Step-by-step guidance

Step-by-step guidance

  1. Purchase an App Hosting plan or start a free trial from the Services page.
  2. Navigate to Portal → Services and open your App Hosting service.
  3. In the Deploy App section, set Action to Deploy PocketBase app and Runtime to pocketbase.
  4. To deploy a bare PocketBase backend, leave the Artifact Reference field empty.
  5. To define your backend in code, paste your GitHub repo URL into the Artifact Reference field — the repository is cloned and any pb_migrations/ and pb_hooks/ it contains are loaded. For private repos, also paste a GitHub Personal Access Token (repo scope). Leave the field empty for a dashboard-only backend.
  6. Leave build and start command fields empty — PocketBase is configured automatically.
  7. Click Redeploy App and wait up to 60 seconds.
  8. Visit https://your-domain/_/ to open the PocketBase admin dashboard and create your superuser account.
  9. In the admin dashboard, create Collections (your database tables) with the fields and types you need. Apps that only need authentication can skip this step — the built-in users collection is always available with no setup.
  10. Set API rules on each collection to control who can read, create, update, and delete records. The default for new collections is admin-only — you must explicitly set rules (e.g. @request.auth.id != "" for authenticated users) or requests from your frontend will be denied with a 403 error.
  11. Your PocketBase API is live at https://your-domain/api/ — connect your frontend using the PocketBase JS SDK or any HTTP client.
  12. Real-time subscriptions work out of the box — WebSocket connections are proxied through nginx. Use pb.collection('name').subscribe('*', callback) in your frontend.

What CM Cloud support will review

What CM Cloud support will review

Support verifies that the PocketBase binary is running, the admin dashboard is accessible at /_/, and nginx is correctly proxying both HTTP requests and WebSocket connections to the service port.

What is not automated yet

What is not automated yet

If you deploy without a repository, collection schemas, API rules, and user accounts are not created for you — configure them in the dashboard at /_/. Migration files whose timestamp is older than PocketBase's own built-in migrations are silently skipped, so generate filenames with a current timestamp. Attaching a repository to an app that already has collections created by hand can fail: a migration that creates an already-existing collection will error at startup. PocketBase uses SQLite, not MySQL. File storage is local to the runtime VM.

Safety note

Safety note

Reading this article does not trigger payment, provisioning, DNS, registrar, Cloudflare, or provider changes.

Safe next action

Safe next action

Open the deploy form on your service page, select Deploy PocketBase app, and leave Artifact Reference empty to start with a blank backend. Then visit /_/ to create your admin account.

Contact Support