MCP ConfigsApr 2, 2026·3 min read

PocketBase — Backend in One File for AI Apps

Open-source backend with database, auth, file storage, and admin UI in a single executable. Perfect for AI app backends. 57K+ stars.

TL;DR
PocketBase bundles database, auth, file storage, and admin UI into one Go binary.
§01

What it is

PocketBase is an open-source backend written in Go that packages a SQLite database, user authentication, file storage, and a real-time admin dashboard into a single executable file. You download one binary, run it, and get a fully functional backend with REST and real-time APIs.

It targets indie developers, AI app builders, and small teams who need a backend fast without managing separate database servers, auth providers, and file storage services. It works well as a backend for AI-powered apps, chatbots, and prototypes.

§02

How it saves time or tokens

PocketBase eliminates infrastructure setup. Instead of configuring a database server, setting up an auth service, and wiring file uploads, you run one command and start building your frontend or AI logic. The admin UI lets you create collections (tables), define fields, and manage records visually. For AI apps, this means you can store conversation logs, user data, and model outputs without writing backend code.

§03

How to use

  1. Download and start PocketBase:
# Download for your platform from GitHub releases
wget https://github.com/pocketbase/pocketbase/releases/latest/download/pocketbase_0.25_linux_amd64.zip
unzip pocketbase_0.25_linux_amd64.zip
./pocketbase serve
  1. Open the admin UI at http://127.0.0.1:8090/_/ and create your first collection.
  1. Use the REST API from your app:
# Create a record
curl -X POST http://127.0.0.1:8090/api/collections/messages/records \
  -H 'Content-Type: application/json' \
  -d '{"text": "Hello from AI", "role": "assistant"}'
§04

Example

// Using PocketBase JavaScript SDK
import PocketBase from 'pocketbase';

const pb = new PocketBase('http://127.0.0.1:8090');

// Authenticate a user
await pb.collection('users').authWithPassword('user@example.com', 'password');

// Store an AI conversation
await pb.collection('conversations').create({
  user_id: pb.authStore.model.id,
  prompt: 'Explain recursion',
  response: 'Recursion is when a function calls itself...',
  model: 'claude-sonnet',
  tokens_used: 245
});

// Query with filters
const recent = await pb.collection('conversations').getList(1, 10, {
  sort: '-created',
  filter: 'tokens_used > 100'
});
§05

Related on TokRepo

§06

Common pitfalls

  • PocketBase uses SQLite, which handles reads well but has write concurrency limits. For apps with heavy concurrent writes, consider PostgreSQL-backed alternatives.
  • Scaling beyond a single server requires manual replication. PocketBase is designed for single-instance deployment, not horizontal scaling.
  • File storage is local by default. For production, configure S3-compatible storage to avoid data loss if the server disk fails.

Frequently Asked Questions

Can PocketBase handle production workloads?+

PocketBase works well for small to medium production apps. It uses SQLite internally, which handles thousands of concurrent reads efficiently. Write-heavy workloads may hit SQLite's single-writer limitation. For most AI apps, chatbots, and tools with moderate traffic, PocketBase is production-ready.

Does PocketBase support real-time subscriptions?+

Yes. PocketBase has built-in real-time event streaming over Server-Sent Events (SSE). You can subscribe to collection changes from the client SDK and receive create, update, and delete events instantly. This is useful for live chat interfaces and real-time AI response streaming.

How do I back up a PocketBase database?+

PocketBase stores everything in a single SQLite file (pb_data/data.db). You can back it up by copying this file while PocketBase is running -- SQLite supports safe concurrent reads. The admin UI also has a backup export feature. For automated backups, schedule a cron job to copy the database file.

Can I extend PocketBase with custom logic?+

Yes. PocketBase can be used as a Go framework where you import it as a package and add custom routes, hooks, and middleware. You can also write JavaScript hooks that run on record create, update, or delete events. This lets you add AI processing pipelines triggered by database changes.

What client SDKs does PocketBase offer?+

PocketBase provides official SDKs for JavaScript/TypeScript and Dart/Flutter. The JavaScript SDK works in Node.js, browsers, and frameworks like React, Vue, and Svelte. Community SDKs exist for Python, Go, and other languages. All SDKs support auth, CRUD, real-time subscriptions, and file uploads.

Citations (3)
🙏

Source & Thanks

Created by Gani Georgiev. Licensed under MIT.

pocketbase — ⭐ 57,300+

Thanks to Gani Georgiev for building the simplest path from zero to production backend.

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.