DEV Community

Alex Spinov
Alex Spinov

Posted on

PocketBase Has a Free API — Your Backend in a Single File

PocketBase is an open-source backend in a single Go binary. It gives you a database, auth, file storage, and REST API out of the box — no server setup needed.

What Is PocketBase?

PocketBase is a self-hosted BaaS (Backend as a Service) that runs as a single executable. Download, run, done.

Includes:

  • SQLite database with REST API
  • Real-time subscriptions
  • Authentication (email, OAuth2)
  • File storage (S3-compatible)
  • Admin dashboard
  • No dependencies

Quick Start

# Download and run
wget https://github.com/pocketbase/pocketbase/releases/latest/download/pocketbase_linux_amd64.zip
unzip pocketbase_linux_amd64.zip
./pocketbase serve
Enter fullscreen mode Exit fullscreen mode

Admin UI: http://127.0.0.1:8090/_/
API: http://127.0.0.1:8090/api/

REST API

# List records
curl http://localhost:8090/api/collections/posts/records

# Create record
curl -X POST http://localhost:8090/api/collections/posts/records \
  -H "Content-Type: application/json" \
  -d '{"title":"Hello World","content":"My first post"}'

# Auth: register user
curl -X POST http://localhost:8090/api/collections/users/records \
  -H "Content-Type: application/json" \
  -d '{"email":"user@test.com","password":"12345678","passwordConfirm":"12345678"}'
Enter fullscreen mode Exit fullscreen mode

JavaScript SDK

import PocketBase from "pocketbase";

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

// Auth
await pb.collection("users").authWithPassword("user@test.com", "12345678");

// CRUD
const posts = await pb.collection("posts").getList(1, 20);
console.log(posts.items);

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

Use Cases

  1. MVP/prototypes — full backend in minutes
  2. Mobile app backend — REST + real-time + auth
  3. Internal tools — admin dashboard included
  4. IoT data collection — lightweight, runs anywhere
  5. Hobby projects — zero cost, single binary

PocketBase vs Alternatives

Feature PocketBase Supabase Firebase
Self-hosted Yes Yes No
Single binary Yes No No
Cost Free Free tier Free tier
Real-time Yes Yes Yes
Dependencies None Docker Cloud

Need web data at scale? Check out my scraping tools on Apify or email spinov001@gmail.com for custom solutions.

Top comments (0)