DEV Community

Alex Spinov
Alex Spinov

Posted on

PocketBase Has a Free Backend — Auth, Database, and Storage in One File

The Fastest Way to Build a Backend

Supabase needs a cloud account. Firebase locks you into Google. Appwrite needs Docker. Setting up auth, a database, and file storage takes hours.

PocketBase does it in one binary.

PocketBase: Your Entire Backend in 15MB

PocketBase is a single binary that gives you:

  • SQLite database with REST API
  • User authentication (email, OAuth)
  • File storage
  • Real-time subscriptions
  • Admin dashboard

All in a 15MB file. No dependencies. No Docker. No cloud account.

Start in 10 Seconds

# Download (macOS)
wget https://github.com/pocketbase/pocketbase/releases/latest/download/pocketbase_0.23_darwin_amd64.zip
unzip pocketbase_*.zip
./pocketbase serve
Enter fullscreen mode Exit fullscreen mode

Open http://localhost:8090/_/ → create an admin account → start building.

Create a Collection (Table)

In the admin UI, create a "posts" collection with fields:

  • title (text)
  • content (rich text)
  • author (relation → users)
  • published (boolean)

PocketBase auto-generates REST and real-time APIs.

Use It From JavaScript

import PocketBase from 'pocketbase'

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

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

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

// List with filters
const posts = await pb.collection('posts').getList(1, 20, {
  filter: 'published = true',
  sort: '-created'
})

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

File Uploads

const formData = new FormData()
formData.append('avatar', fileInput.files[0])

await pb.collection('users').update(userId, formData)
Enter fullscreen mode Exit fullscreen mode

Files stored on disk. Served via built-in file handler. Thumbnails generated automatically.

OAuth in 2 Clicks

Enable Google, GitHub, Discord, or Apple OAuth from the admin panel. No code changes needed.

PocketBase vs Alternatives

Feature PocketBase Supabase Firebase
Price Free (self-host) Free tier Free tier
Setup 1 binary Cloud signup Cloud signup
Database SQLite PostgreSQL NoSQL
Auth Built-in Built-in Built-in
Storage Built-in Built-in Built-in
Real-time Built-in Built-in Built-in
Vendor lock-in None Low High
Scaling Vertical Horizontal Auto

When to Use PocketBase

  • MVPs and prototypes (fastest backend setup)
  • Side projects (free, simple, reliable)
  • Mobile app backends (REST API + auth + storage)
  • Internal tools (admin panel included)

When to Use Supabase/Firebase

  • Large scale (millions of users)
  • Team collaboration (cloud dashboard)
  • PostgreSQL features (complex queries, extensions)

Get Started

Download from pocketbase.io, run the binary, build your app.


Need external data for your app? 88+ scrapers on Apify. Custom: spinov001@gmail.com

Top comments (0)