PocketBase
Research Date: 2026-02-23
Source URL: https://pocketbase.io
GitHub Repository: https://github.com/pocketbase/pocketbase
Version at Research: v0.36.5
License: MIT
Overview
PocketBase is an open-source Go backend that ships as a single self-contained executable, bundling an embedded SQLite database with realtime subscriptions, built-in auth management (password, OTP, OAuth2, MFA), file storage, and a superuser dashboard UI — all exposed via a REST-ish API. It can be used as a zero-config standalone app or as a Go library to add custom routes, hooks, and business logic while keeping a single portable binary as the output.
Problem Addressed
| Problem |
Solution |
| Setting up a backend requires wiring together a web framework, database, auth system, file storage, and admin UI |
Single executable includes all of these; run ./pocketbase serve and the full backend is live |
| Auth systems require significant custom code for OAuth2, OTP, MFA, and email verification |
Built-in auth collections with configurable password, OTP, OAuth2 (30+ providers), and MFA support |
| Prototypes and hobby projects are abandoned due to backend complexity |
Sub-5-minute setup from download to working API with dashboard |
| Realtime features require external brokers (Redis, Pusher, WebSocket servers) |
Built-in SSE-based realtime subscriptions on any collection out of the box |
| File uploads need separate S3 configuration and storage logic |
Built-in file field type; storage switches between local disk and S3 via config |
| Database schema management is manual and error-prone |
Collections and fields managed via dashboard UI or Go/JS migration files that can be committed to git |
Key Statistics
| Metric |
Value |
Date Gathered |
| GitHub Stars |
56,299 |
2026-02-23 |
| GitHub Forks |
3,141 |
2026-02-23 |
| Latest Release |
v0.36.5 |
2026-02-23 |
| Release Date |
2026-02-21 |
2026-02-23 |
| Primary Language |
Go |
2026-02-23 |
| Repository Created |
2022-07-05 |
2026-02-23 |
| Official SDKs |
JavaScript, Dart |
2026-02-23 |
Key Features
Embedded Database
- SQLite via
modernc.org/sqlite (pure Go, no CGO required)
- 3 collection types: Base (application data), View (read-only SQL SELECT), Auth (users with auth fields)
- 15+ field types: bool, number, text, email, URL, editor, date, autodate, select, file, relation, JSON, geopoint, password, number
- Declarative filter rules per collection (
@request.auth.id, &&, ||, nesting)
- Realtime SSE subscriptions on any collection with automatic event broadcasting
- Incremental schema migrations stored as JS/Go files committable to git
Authentication
- Email/password with configurable identity field (default email, any unique field)
- OTP (one-time password via email code) with auto-verify-on-success option
- OAuth2 via 30+ providers (Google, GitHub, Microsoft, GitLab, etc.) — single-call popup flow
- Multi-factor authentication (MFA) — combine any two auth methods
- Stateless JWT tokens; no server-side session storage; "logout" = discard token client-side
- Multiple Auth collections with independent fields and rules (users, managers, clients, etc.)
- Role-based and ownership-based access via filter rule expressions
File Storage
- File field type stores filenames in SQLite; file content on local disk or S3
- Single or multiple file uploads per field; set modifiers to append/prepend/remove files
- Thumbnails and image processing configurable per file field
Admin Dashboard
- Superuser dashboard at
/_/ for managing collections, records, auth, logs, and settings
- Schema changes in the dashboard auto-generate JS migration files
- Superuser accounts managed via
./pocketbase superuser CLI subcommands
REST-ish API
- CRUD endpoints auto-generated for every collection
- Filter, sort, expand (relations), and fields projection query parameters
- Standard routes:
http://127.0.0.1:8090/api/
- Static file serving from
pb_public/ directory
Go Framework Mode
- Import
github.com/pocketbase/pocketbase as a library to add custom routes, middleware, and hooks
- Hook system (
app.OnServe(), app.OnRecordCreate(), etc.) for lifecycle event interception
- JS VM plugin (enabled by default in prebuilt binary) for extending with JavaScript without recompilation
- Single
CGO_ENABLED=0 go build produces a statically linked binary for any target
Technical Architecture
Deployment Modes
Standalone mode (prebuilt binary):
Download → extract → ./pocketbase serve
→ localhost:8090/api/ (REST API)
→ localhost:8090/_/ (Admin dashboard)
→ localhost:8090/ (Static files from pb_public/)
Go framework mode:
go mod init myapp && go mod tidy
→ import pocketbase, add hooks/routes
→ CGO_ENABLED=0 go build → single binary
Data Directories
| Directory |
Purpose |
pb_data/ |
Application data, SQLite DB, uploaded files (gitignore) |
pb_migrations/ |
JS/Go migration files with schema changes (commit to git) |
pb_public/ |
Static files served at root URL |
Stack
| Component |
Technology |
| Language |
Go 1.23+ |
| Database |
SQLite (modernc.org/sqlite, pure Go) |
| Realtime |
SSE (Server-Sent Events) |
| Auth tokens |
JWT (stateless) |
| File storage |
Local disk or S3 |
| JS extensibility |
Goja JS VM |
| Admin UI |
Embedded SvelteKit SPA |
Installation & Usage
# Download prebuilt binary (Linux amd64)
wget https://github.com/pocketbase/pocketbase/releases/download/v0.36.5/pocketbase_0.36.5_linux_amd64.zip
unzip pocketbase_0.36.5_linux_amd64.zip
# Start server (auto-opens browser for first superuser setup)
./pocketbase serve
# Self-update
./pocketbase update
JavaScript SDK Usage
import PocketBase from 'pocketbase';
const pb = new PocketBase('http://127.0.0.1:8090');
// Authenticate
const authData = await pb.collection('users').authWithPassword('user@example.com', 'password');
// CRUD
const record = await pb.collection('posts').create({ title: 'Hello', content: 'World' });
const list = await pb.collection('posts').getList(1, 20, { filter: 'author = "abc123"' });
// Realtime subscription
pb.collection('posts').subscribe('*', (e) => {
console.log(e.action, e.record);
});
Go Framework Extension
package main
import (
"log"
"github.com/pocketbase/pocketbase"
"github.com/pocketbase/pocketbase/core"
)
func main() {
app := pocketbase.New()
app.OnServe().BindFunc(func(se *core.ServeEvent) error {
se.Router.GET("/hello", func(re *core.RequestEvent) error {
return re.String(200, "Hello world!")
})
return se.Next()
})
if err := app.Start(); err != nil {
log.Fatal(err)
}
}
Relevance to Claude Code Development
Applications
- Rapid backend for skill prototypes: PocketBase provides an instant backend for any skill or agent that needs persistent data, user auth, or file storage — no cloud account or database setup required.
- Agent state persistence: Use PocketBase collections as a lightweight external state store for multi-session agent workflows, replacing ad-hoc file-based or SQLite-from-scratch approaches.
- Tool backend for MCP servers: PocketBase's REST API and realtime subscriptions make it a natural backend for MCP servers that need persistent records and push notifications to connected clients.
- Local BaaS for development: Replaces Firebase/Supabase for local-first development; single binary spun up in CI for integration tests without external dependencies.
Patterns Worth Adopting
- Single-binary distribution: PocketBase's zero-dependency
CGO_ENABLED=0 build producing a static binary is a pattern for distributing agent tools without runtime requirements.
- Migration files as code: Storing schema changes as committable JS migration files enables reproducible database state — applicable to any tool that manages structured data.
- Filter rule DSL: PocketBase's
@request.auth.id, &&/||, nested relation traversal rule syntax is a clean pattern for declarative access control without custom middleware code.
- Hook-based extensibility: The
app.On*() hook pattern for intercepting lifecycle events (create, update, delete) without forking the core — directly applicable to plugin architectures.
- Realtime without extra infrastructure: SSE-based subscriptions baked into the core (no Redis, no Pusher) demonstrate that realtime can be a zero-dependency first-class feature.
Integration Opportunities
- PocketBase as skill session store: A
sessions collection in PocketBase could replace the current sessions/ directory pattern for tracking multi-session agent context with query support.
- MCP server backed by PocketBase: Build an MCP server that exposes PocketBase CRUD operations as tools, giving Claude Code agents structured persistent storage via the Tool use interface.
- Research entry tracking: Use PocketBase to store, query, and track research entries by category/date/freshness — enabling
--validate and --rerun mode queries without scanning the filesystem.
- Webhook hooks for agent triggers: PocketBase's
OnRecord* hooks can fire webhooks that trigger agent tasks (e.g., new research entry created → trigger --validate workflow).
Competitive Analysis
| Tool |
Comparison |
| Supabase |
Hosted PostgreSQL BaaS; PocketBase is lighter, self-hosted, no Docker required |
| Firebase |
Google-hosted; PocketBase is open source, runs offline, no vendor lock-in |
| Appwrite |
Docker-based multi-service; PocketBase is a single binary |
| Directus |
CMS-focused, requires Node.js; PocketBase is Go, self-contained |
References
Research Method: Information gathered from official website, GitHub repository README, GitHub API (stars, forks, language, creation date), official documentation (collections, authentication), and latest release page.
Freshness Tracking
| Field |
Value |
| Last Verified |
2026-02-23 |
| Version at Verification |
v0.36.5 |
| GitHub Stars |
56,299 (as of 2026-02-23) |
| Next Review Recommended |
2026-05-23 |
Review Triggers:
- v1.0 stable release (currently pre-1.0 with active development)
- Major auth or collection API breaking changes
- GitHub stars milestone (60K, 70K)
- New official SDK language support
- S3-compatible storage provider changes
1---2name: problem-addressed-243description: PocketBase is an open-source Go backend that ships as a single self-contained executable, bundling an embedded SQLite database with realtime subscriptions, built-in auth management (password, OTP, OAuth2, MFA), file…4---5# PocketBase67**Research Date**: 2026-02-238**Source URL**: <https://pocketbase.io>9**GitHub Repository**: <https://github.com/pocketbase/pocketbase>10**Version at Research**: v0.36.511**License**: MIT1213---1415## Overview1617PocketBase is an open-source Go backend that ships as a single self-contained executable, bundling an embedded SQLite database with realtime subscriptions, built-in auth management (password, OTP, OAuth2, MFA), file storage, and a superuser dashboard UI — all exposed via a REST-ish API. It can be used as a zero-config standalone app or as a Go library to add custom routes, hooks, and business logic while keeping a single portable binary as the output.1819---2021## Problem Addressed2223| Problem | Solution |24|---------|----------|25| Setting up a backend requires wiring together a web framework, database, auth system, file storage, and admin UI | Single executable includes all of these; run `./pocketbase serve` and the full backend is live |26| Auth systems require significant custom code for OAuth2, OTP, MFA, and email verification | Built-in auth collections with configurable password, OTP, OAuth2 (30+ providers), and MFA support |27| Prototypes and hobby projects are abandoned due to backend complexity | Sub-5-minute setup from download to working API with dashboard |28| Realtime features require external brokers (Redis, Pusher, WebSocket servers) | Built-in SSE-based realtime subscriptions on any collection out of the box |29| File uploads need separate S3 configuration and storage logic | Built-in file field type; storage switches between local disk and S3 via config |30| Database schema management is manual and error-prone | Collections and fields managed via dashboard UI or Go/JS migration files that can be committed to git |3132---3334## Key Statistics3536| Metric | Value | Date Gathered |37|--------|-------|---------------|38| GitHub Stars | 56,299 | 2026-02-23 |39| GitHub Forks | 3,141 | 2026-02-23 |40| Latest Release | v0.36.5 | 2026-02-23 |41| Release Date | 2026-02-21 | 2026-02-23 |42| Primary Language | Go | 2026-02-23 |43| Repository Created | 2022-07-05 | 2026-02-23 |44| Official SDKs | JavaScript, Dart | 2026-02-23 |4546---4748## Key Features4950### Embedded Database5152- SQLite via `modernc.org/sqlite` (pure Go, no CGO required)53- 3 collection types: **Base** (application data), **View** (read-only SQL SELECT), **Auth** (users with auth fields)54- 15+ field types: bool, number, text, email, URL, editor, date, autodate, select, file, relation, JSON, geopoint, password, number55- Declarative filter rules per collection (`@request.auth.id`, `&&`, `||`, nesting)56- Realtime SSE subscriptions on any collection with automatic event broadcasting57- Incremental schema migrations stored as JS/Go files committable to git5859### Authentication6061- **Email/password** with configurable identity field (default email, any unique field)62- **OTP** (one-time password via email code) with auto-verify-on-success option63- **OAuth2** via 30+ providers (Google, GitHub, Microsoft, GitLab, etc.) — single-call popup flow64- **Multi-factor authentication** (MFA) — combine any two auth methods65- Stateless JWT tokens; no server-side session storage; "logout" = discard token client-side66- Multiple Auth collections with independent fields and rules (users, managers, clients, etc.)67- Role-based and ownership-based access via filter rule expressions6869### File Storage7071- File field type stores filenames in SQLite; file content on local disk or S372- Single or multiple file uploads per field; set modifiers to append/prepend/remove files73- Thumbnails and image processing configurable per file field7475### Admin Dashboard7677- Superuser dashboard at `/_/` for managing collections, records, auth, logs, and settings78- Schema changes in the dashboard auto-generate JS migration files79- Superuser accounts managed via `./pocketbase superuser` CLI subcommands8081### REST-ish API8283- CRUD endpoints auto-generated for every collection84- Filter, sort, expand (relations), and fields projection query parameters85- Standard routes: `http://127.0.0.1:8090/api/`86- Static file serving from `pb_public/` directory8788### Go Framework Mode8990- Import `github.com/pocketbase/pocketbase` as a library to add custom routes, middleware, and hooks91- Hook system (`app.OnServe()`, `app.OnRecordCreate()`, etc.) for lifecycle event interception92- JS VM plugin (enabled by default in prebuilt binary) for extending with JavaScript without recompilation93- Single `CGO_ENABLED=0 go build` produces a statically linked binary for any target9495---9697## Technical Architecture9899### Deployment Modes100101```text102Standalone mode (prebuilt binary):103 Download → extract → ./pocketbase serve104 → localhost:8090/api/ (REST API)105 → localhost:8090/_/ (Admin dashboard)106 → localhost:8090/ (Static files from pb_public/)107108Go framework mode:109 go mod init myapp && go mod tidy110 → import pocketbase, add hooks/routes111 → CGO_ENABLED=0 go build → single binary112```113114### Data Directories115116| Directory | Purpose |117|-----------|---------|118| `pb_data/` | Application data, SQLite DB, uploaded files (gitignore) |119| `pb_migrations/` | JS/Go migration files with schema changes (commit to git) |120| `pb_public/` | Static files served at root URL |121122### Stack123124| Component | Technology |125|-----------|------------|126| Language | Go 1.23+ |127| Database | SQLite (modernc.org/sqlite, pure Go) |128| Realtime | SSE (Server-Sent Events) |129| Auth tokens | JWT (stateless) |130| File storage | Local disk or S3 |131| JS extensibility | Goja JS VM |132| Admin UI | Embedded SvelteKit SPA |133134---135136## Installation & Usage137138```bash139# Download prebuilt binary (Linux amd64)140wget https://github.com/pocketbase/pocketbase/releases/download/v0.36.5/pocketbase_0.36.5_linux_amd64.zip141unzip pocketbase_0.36.5_linux_amd64.zip142143# Start server (auto-opens browser for first superuser setup)144./pocketbase serve145146# Self-update147./pocketbase update148```149150### JavaScript SDK Usage151152```javascript153import PocketBase from 'pocketbase';154const pb = new PocketBase('http://127.0.0.1:8090');155156// Authenticate157const authData = await pb.collection('users').authWithPassword('user@example.com', 'password');158159// CRUD160const record = await pb.collection('posts').create({ title: 'Hello', content: 'World' });161const list = await pb.collection('posts').getList(1, 20, { filter: 'author = "abc123"' });162163// Realtime subscription164pb.collection('posts').subscribe('*', (e) => {165 console.log(e.action, e.record);166});167```168169### Go Framework Extension170171```go172package main173174import (175 "log"176 "github.com/pocketbase/pocketbase"177 "github.com/pocketbase/pocketbase/core"178)179180func main() {181 app := pocketbase.New()182183 app.OnServe().BindFunc(func(se *core.ServeEvent) error {184 se.Router.GET("/hello", func(re *core.RequestEvent) error {185 return re.String(200, "Hello world!")186 })187 return se.Next()188 })189190 if err := app.Start(); err != nil {191 log.Fatal(err)192 }193}194```195196---197198## Relevance to Claude Code Development199200### Applications201202- **Rapid backend for skill prototypes**: PocketBase provides an instant backend for any skill or agent that needs persistent data, user auth, or file storage — no cloud account or database setup required.203- **Agent state persistence**: Use PocketBase collections as a lightweight external state store for multi-session agent workflows, replacing ad-hoc file-based or SQLite-from-scratch approaches.204- **Tool backend for MCP servers**: PocketBase's REST API and realtime subscriptions make it a natural backend for MCP servers that need persistent records and push notifications to connected clients.205- **Local BaaS for development**: Replaces Firebase/Supabase for local-first development; single binary spun up in CI for integration tests without external dependencies.206207### Patterns Worth Adopting2082091. **Single-binary distribution**: PocketBase's zero-dependency `CGO_ENABLED=0` build producing a static binary is a pattern for distributing agent tools without runtime requirements.2102. **Migration files as code**: Storing schema changes as committable JS migration files enables reproducible database state — applicable to any tool that manages structured data.2113. **Filter rule DSL**: PocketBase's `@request.auth.id`, `&&`/`||`, nested relation traversal rule syntax is a clean pattern for declarative access control without custom middleware code.2124. **Hook-based extensibility**: The `app.On*()` hook pattern for intercepting lifecycle events (create, update, delete) without forking the core — directly applicable to plugin architectures.2135. **Realtime without extra infrastructure**: SSE-based subscriptions baked into the core (no Redis, no Pusher) demonstrate that realtime can be a zero-dependency first-class feature.214215### Integration Opportunities2162171. **PocketBase as skill session store**: A `sessions` collection in PocketBase could replace the current `sessions/` directory pattern for tracking multi-session agent context with query support.2182. **MCP server backed by PocketBase**: Build an MCP server that exposes PocketBase CRUD operations as tools, giving Claude Code agents structured persistent storage via the Tool use interface.2193. **Research entry tracking**: Use PocketBase to store, query, and track research entries by category/date/freshness — enabling `--validate` and `--rerun` mode queries without scanning the filesystem.2204. **Webhook hooks for agent triggers**: PocketBase's `OnRecord*` hooks can fire webhooks that trigger agent tasks (e.g., new research entry created → trigger `--validate` workflow).221222### Competitive Analysis223224| Tool | Comparison |225|------|------------|226| Supabase | Hosted PostgreSQL BaaS; PocketBase is lighter, self-hosted, no Docker required |227| Firebase | Google-hosted; PocketBase is open source, runs offline, no vendor lock-in |228| Appwrite | Docker-based multi-service; PocketBase is a single binary |229| Directus | CMS-focused, requires Node.js; PocketBase is Go, self-contained |230231---232233## References234235| Source | URL | Accessed |236|--------|-----|----------|237| Official Website | <https://pocketbase.io> | 2026-02-23 |238| GitHub Repository | <https://github.com/pocketbase/pocketbase> | 2026-02-23 |239| Documentation | <https://pocketbase.io/docs> | 2026-02-23 |240| Collections Docs | <https://pocketbase.io/docs/collections> | 2026-02-23 |241| Authentication Docs | <https://pocketbase.io/docs/authentication> | 2026-02-23 |242| JavaScript SDK | <https://github.com/pocketbase/js-sdk> | 2026-02-23 |243| Dart SDK | <https://github.com/pocketbase/dart-sdk> | 2026-02-23 |244| Releases Page | <https://github.com/pocketbase/pocketbase/releases> | 2026-02-23 |245246**Research Method**: Information gathered from official website, GitHub repository README, GitHub API (stars, forks, language, creation date), official documentation (collections, authentication), and latest release page.247248---249250## Freshness Tracking251252| Field | Value |253|-------|-------|254| Last Verified | 2026-02-23 |255| Version at Verification | v0.36.5 |256| GitHub Stars | 56,299 (as of 2026-02-23) |257| Next Review Recommended | 2026-05-23 |258259**Review Triggers**:260261- v1.0 stable release (currently pre-1.0 with active development)262- Major auth or collection API breaking changes263- GitHub stars milestone (60K, 70K)264- New official SDK language support265- S3-compatible storage provider changes