Running PocketOne
PocketOne is your whole backend in one file. The pocketone executable is a database, a REST and realtime API, user
accounts and sign-in, file storage, an admin dashboard, a server for your pages and static files, and a JavaScript
runtime for your own code, plus PocketOne's extensions (deploys, restore, API tokens, AI models, MCP). There's nothing
else to install and nothing else to run.
An app is a folder. You start pocketone in it, and everything it keeps sits next to it.
Start it
mkdir myapp && cd myapp
pocketone superuser upsert [email protected] 'a long password' --dir ./pb_data
pocketone serve --dir ./pb_data
Server started at http://127.0.0.1:8090
> Dashboard: http://127.0.0.1:8090/_/
> REST API: http://127.0.0.1:8090/api/
--diris the app's data folder. Without it,pocketoneusespb_datanext to the executable, so pass it (or setdir:in the configuration'sapp:section) to keep each app's data in its own folder.--httpis where it listens (default127.0.0.1:8090);--http 0.0.0.0:8090listens on every address.pocketone serve example.comserves HTTPS for that domain, with a certificate it gets and renews itself.--devprints every request and SQL statement, catches outgoing mail when no mail server is set (and shows it at http://127.0.0.1:8025), and skips a hook file with an error instead of stopping.- Stop it with Ctrl-C. Nothing else is running: no database server, no queue, no worker.
pocketone --help lists every command; pocketone serve --help every flag. To keep it running on a server, see
Run on a Linux server.
What's in the folder
| Folder | What it holds | Backed up | Deployed and synced | Safe to delete |
|---|---|---|---|---|
pb_data |
the database, uploaded files, logs | yes | never | no: it's your data |
pb_hooks |
your server code: hooks and routes (*.pb.ts), and *.pb.wasm modules |
as code, in git | yes | no |
pb_pages |
your site's pages | as code, in git | yes | no |
pb_migrations |
your migrations: collection changes and seed data | as code, in git | yes | no |
pb_public |
static files served as they are (a built single-page app, images) | as code, in git | yes | no |
pb_templates |
page templates you ejected (pocketone template eject) |
as code, in git | yes | no |
pb_cache |
files extensions can rebuild, one folder each | never | never | yes, at any time |
Only pb_data is created for you; make the others when you need them. The app also writes types.d.ts and a
tsconfig.json next to them, so your editor knows the JavaScript API, and reads pocketone.yaml and .env from the
same folder if you add them (Configuration). Add pb_data/ and pb_cache/ to your
.gitignore.
pb_data
| In it | Is |
|---|---|
data.db |
the database: every collection and record, the settings |
auxiliary.db |
the logs |
storage/ |
uploaded files, by collection and record (unless files are stored in S3) |
backups/ |
backups you made (unless they're sent to S3) |
litestream/ |
the change history for point-in-time restore |
Never edit these by hand while the app runs, and never open the live database with another tool. Use the dashboard, the API or your code.
pb_cache
Each extension that keeps disposable files has its own folder, pb_cache/<extension>/. Everything in it can be
rebuilt, so deleting it is always safe: the app carries on, perhaps a little slower until the cache fills again.
pocketone cache # each extension's folder, its file count and size
pocketone cache clear # empty every folder
pocketone cache clear <name> # empty one extension's folder
On a multisite host, each instance's pb_cache is kept by the host outside the instance's folder, so copies and moves
of an instance never carry it.
The dashboard and superusers
The dashboard at /_/ is where you manage the app: collections and records, settings, logs, backups, and the
screens extensions add (AI models, search, tokens, bulk mail).

Superusers are the people who can open it. They're records of a built-in collection, _superusers, and they can do
everything: see and change every record, past every API rule, and call the admin endpoints. Keep
them few.
pocketone superuser upsert [email protected] 'a long password' --dir ./pb_data # create, or reset the password
pocketone superuser delete [email protected] --dir ./pb_data
pocketone superuser otp [email protected] --dir ./pb_data # a one-time password to sign in with
Create the first one before the first serve. Without any superuser, the app prints a link (and opens it in a
browser, on your own machine) to a page that creates one.


Your app's users
Your app's own accounts are a different thing: records of an auth collection you control. Every app starts with
one, users, and you can add more (customers, staff). Users sign in through the API
or your pages, never the dashboard, and what each may do is decided by your
collections' API rules.

| Superusers | Users | |
|---|---|---|
| Collection | _superusers (built in) |
users, or any auth collection you add |
| Sign in at | the dashboard (/_/), the CLI, the admin API |
your app: the REST API, the SDK, your pages |
| May do | everything | what your API rules allow |
| Made by | pocketone superuser upsert, or another superuser |
signing up, or you, in the dashboard or code |
See Authentication for sign-in methods, and API tokens for scripts and other apps that call yours.
Where a request goes
| Path | Served by |
|---|---|
/_/ |
the dashboard |
/api/... |
the REST API: records, auth, files, realtime, and your custom routes |
/api/_c/... |
the extension APIs |
/mcp |
MCP, for AI agents |
| anything else | your pages in pb_pages and the files in pb_public |
Hooks run on all of it: before and after records are saved, on requests, when mail goes out.
Extension tables
Extensions that store records keep them in collections named _<extension>_<table> (_bulkmail_campaigns,
_llm_calls), so you can tell them from your own at a glance and see which extension owns each. They live in
pb_data with the rest of your data, so they're backed up with it. Extensions create and update them with their own
migrations, recorded apart from yours, so pocketone migrate never touches them:
pocketone extensions migrations # every extension's migrations and when each was applied
pocketone extensions migrate down bulkmail # revert bulkmail's last migration (its data goes with it)
Next
- Collections and fields: define your data.
- Hooks: your first server code.
- Starter kits: an app to begin from.
- Deploy and live sync: put the folder on a server.
Questions and comments
Comments are a GitHub Discussions thread; sign in with GitHub to post.