DEV Community

Alex Spinov
Alex Spinov

Posted on

PocketBase Has a Free Backend — Auth, Database, Realtime, and File Storage in a Single Binary

Last month I needed a backend for a hackathon project. Thirty-six hours to build an app with user auth, a database, file uploads, and realtime subscriptions. I could spin up Express + Postgres + Redis + S3 + Socket.io... or I could download a single 15MB file.

PocketBase gave me everything in one binary. No Docker. No database setup. No environment variables. Just ./pocketbase serve and I had a full backend.

What You Get Free

PocketBase is open-source (MIT license). Free forever. Self-host anywhere:

  • SQLite database — embedded, zero-config, surprisingly fast
  • REST API — auto-generated CRUD for every collection
  • Realtime subscriptions — SSE-based, subscribe to record changes
  • User authentication — email/password, OAuth2 (Google, GitHub, etc.)
  • File storage — local filesystem or S3-compatible (R2, Backblaze)
  • Admin dashboard — web UI to manage collections, users, settings
  • API rules — granular permissions per collection/action
  • Hooks — JavaScript/Go hooks for custom logic
  • Backups — automated SQLite backups
  • Single binary — 15MB, runs on Linux, macOS, Windows

Quick Start

# Download (Linux/macOS)
wget https://github.com/pocketbase/pocketbase/releases/latest/download/pocketbase_0.25.0_linux_amd64.zip
unzip pocketbase_*.zip

# Start
./pocketbase serve

# Admin UI: http://127.0.0.1:8090/_/
# API: http://127.0.0.1:8090/api/
Enter fullscreen mode Exit fullscreen mode

Create an admin account, define collections in the UI, and your REST API is ready. No code needed for basic CRUD.

Real Example: JavaScript Client

import PocketBase from 'pocketbase';

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

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

// Create record
const post = await pb.collection('posts').create({
  title: 'Hello World',
  content: 'My first post',
  author: pb.authStore.record.id
});

// List with filters
const posts = await pb.collection('posts').getList(1, 20, {
  filter: 'created >= "2024-01-01"',
  sort: '-created',
  expand: 'author'
});

// Realtime subscription
pb.collection('posts').subscribe('*', (e) => {
  console.log(e.action, e.record);
});
Enter fullscreen mode Exit fullscreen mode

What You Can Build

1. MVP backend — auth + database + file uploads. Ship in hours, not days.

2. Internal tools — admin dashboard included. CRUD apps without building UI.

3. Mobile app backend — REST API + realtime. Official SDKs for JavaScript, Dart/Flutter.

4. Blog/CMS — collections for posts, comments, media. Admin UI for content management.

5. IoT data collector — lightweight enough for Raspberry Pi. SQLite handles millions of records.

Hosting Options (All Free)

  • Fly.io — deploy PocketBase as a Docker container. Free tier covers it.
  • Railway — one-click template available.
  • Your own VPS — any $5/month VPS runs PocketBase easily. Hetzner, Contabo.
  • Home server / Raspberry Pi — single binary, runs anywhere.

Limits to Know

SQLite = single-writer. One write at a time. Fine for <100 concurrent users. Not for high-write-throughput apps.

No horizontal scaling. One instance. No clustering. This is by design — PocketBase is for small-to-medium apps.

Migration story is evolving. Schema changes via the admin UI work, but version-controlled migrations need the Go/JS framework.

No built-in email sending. You need an SMTP provider (Resend, Mailgun) for verification emails.

The Firebase Alternative

PocketBase is what Firebase would be if it ran on your hardware. Auth, database, realtime, files — all in one. But you own the data, there's no vendor lock-in, and it's free forever.

For solo devs and small teams who don't want to manage infrastructure but also don't want to depend on Google — PocketBase is the answer.


Need custom backend automation? Email spinov001@gmail.com

More free tiers: 43+ Free APIs Every Developer Should Bookmark

Top comments (0)