New
Apps 6,419Makers 6,403This week 7
Promote your app−30%
Slonbase screenshot 1
9views in
the last 30 days

Slonbase

PocketBase's API on PostgreSQL: one Rust binary with database, auth, realtime and files

Built with Claude Code

by ayeshrodz · Unclaimed · from NZNew Zealand · added Oct 29, 2026
no ratings0 comments

slonbase

Your whole backend, built on PostgreSQL.
An open-source backend in one Rust binary: collections, a REST and realtime API, auth, files, hooks and an admin dashboard. Every collection is a real PostgreSQL table.

Release Docker image PostgreSQL 14+ Rust MIT license

Website · Quick start · Install · API · Hooks · Benchmarks

A client app creating and updating a task while the slonbase dashboard's grid updates live

A JavaScript client creating and updating a task. The dashboard's grid is live: realtime events arrive as the code runs.

Why slonbase

Define your data in a dashboard and get an API, auth, realtime and file storage right away, without writing a backend. slonbase gives you that in a single binary, and keeps your data in PostgreSQL, the database you can query, replicate, back up and scale with the tools you already trust.

  • 🐘 Real PostgreSQL tables. Every collection is a table. Query it with SQL, join it in reports, replicate it, back it up with pg_dump, or run it on a managed service.
  • ⚡ Realtime for every change. A trigger on each table announces every write, whoever makes it: the API, your SQL, an auth flow or another program. Each subscriber gets only what its rules allow.
  • ↔️ Scales out. Run several instances on one database behind any load balancer. Realtime, schema changes, settings and rate limits are shared through PostgreSQL, so no sticky sessions.
  • 🧩 Extend it your way. Hooks, routes, cron jobs and a query builder in JavaScript files, no build step; or a Rust library API.
  • 🗂️ Many projects, one server. Host several isolated apps from one installation, each in a database of its own.
  • 🚀 Fast where it matters. Written in Rust with tokio and axum; filters compile to parameterized SQL that uses your indexes (benchmarks).
  • 📦 One static binary. An 8 MB download with the dashboard built in. Install it with Docker, .deb/.rpm packages or a plain binary, and finish with a setup wizard.

Features

Data

  • Base, auth and view collections, with 14 field types
  • A filter language for queries and access rules: relation paths, @request.*, @collection.*
  • expand, back-relations, fields, sorting and paging
  • Batch requests in one transaction
  • Indexes, including unique and partial ones

Auth

  • Password, OAuth2 (Google, GitHub, Microsoft, OIDC, …), one-time passwords and MFA
  • Verification, password reset and email change
  • New-device sign-in alerts, impersonation

Realtime and files

  • SSE subscriptions with per-subscriber rules, filters and expand
  • Events for every change, made through the API or not
  • File fields on disk or any S3-compatible bucket; thumbnails, protected files, byte ranges

Operations

  • An admin dashboard with live grids, a schema editor and diagram, logs and an SQL console
  • Request logs, rate limits, superuser IP restrictions, Prometheus metrics
  • Backups (on a schedule, to S3) and one-click restores
  • JavaScript hooks, cron jobs, a query builder, and a Rust library API
  • Migrations in JavaScript, each in a transaction, with automigrate

Note

slonbase 1.0 is stable: within 1.x, upgrades don't break the API, configuration, your data, hooks or migrations (see stability). Back up before upgrading anyway, and bug reports are very welcome.

Coming from PocketBase?

slonbase is inspired by PocketBase, and it's an independent project, written from scratch in Rust, with its own design. Its API is compatible with PocketBase's, so you can bring an existing app along:

  • the PocketBase JavaScript and Dart SDKs work against slonbase as they are;
  • most pb_hooks and pb_migrations files run unchanged;
  • slonbase import-pocketbase brings over collections, records, files and settings, with users' password hashes, so nobody has to reset a password.

A test suite written with the official SDK runs against both servers in CI to keep it that way (compat/). The migration guide lists the differences.

PocketBase is the better choice when you want zero moving parts (one file, SQLite inside), when one small app on one small machine is the whole plan, or when you extend it in Go.

Quick start

In 60 seconds, with Docker. This starts slonbase and a PostgreSQL 17 server for it:

mkdir slonbase && cd slonbase
curl -fsSLO https://raw.githubusercontent.com/ayeshrodz/slonbase/main/compose.yaml
echo "POSTGRES_PASSWORD=$(openssl rand -hex 24)" > .env
docker compose up -d
docker compose logs slonbase | grep "setup?token"

Open the printed link and create your first superuser. That's it: the dashboard is at http://localhost:8090/_/ and the API at /api/.

On a hosting platform: Render (one click), Railway, Fly.io, Coolify and Dokploy each have a ready-made setup with a database.

Deploy to Render

Without Docker, PostgreSQL isn't bundled: slonbase connects to any PostgreSQL 14+ server, on the same machine, elsewhere, or a managed service, and the setup link asks for it.

Debian / Ubuntu: from the apt repository, so apt upgrade keeps it up to date:

curl -fsSL https://ayeshrodz.github.io/slonbase/slonbase.gpg | sudo tee /usr/share/keyrings/slonbase.gpg > /dev/null
curl -fsSL https://ayeshrodz.github.io/slonbase/slonbase.list | sudo tee /etc/apt/sources.list.d/slonbase.list
sudo apt update && sudo apt install slonbase
sudo journalctl -u slonbase | grep "setup?token"

Fedora / RHEL: sudo curl -fsSL -o /etc/yum.repos.d/slonbase.repo https://ayeshrodz.github.io/slonbase/slonbase.repo && sudo dnf install slonbase. The .deb and .rpm files are also on the releases page.

Binary: extract the .tar.gz from the releases and run ./slonbase serve.

Then connect from your app with any HTTP client, or with the PocketBase SDKs, which work with slonbase's API:

import PocketBase from "pocketbase";

const pb = new PocketBase("http://localhost:8090");
await pb.collection("users").authWithPassword("ann@example.com", "secret");
const posts = await pb.collection("posts").getList(1, 20, { filter: 'published = true', expand: "author" });

A look around

Records Overview
A collection's records in a live grid Overview
Schema Logs
Schema editor Logs
API rules API preview
API rules API preview

The schema diagram: every collection with its fields, and its relations

The schema diagram, drawn from the collections: hover one to follow its relations.

The dashboard follows your system's light or dark theme, works on phones, and ⌘K / Ctrl K jumps anywhere. It only uses the public API, so anything it does, you can script too.

Documentation

The guides are also on the documentation site, with search: ayeshrodz.github.io/slonbase/docs.

Commands

Command Description
slonbase serve Start the server (default).
slonbase setup Set up without the web wizard.
slonbase health Exit 0 if the local server is healthy (for container health checks).
slonbase superuser upsert|update|delete|otp ... Manage superusers. otp <email> prints a one-time password for signing in with MFA when emails can't be sent.
slonbase import-pocketbase <pb_data or backup.zip> Import a PocketBase installation.
slonbase migrate up|down|create|collections|list ... Apply, revert or write migrations.
slonbase project list|create|delete ... Manage projects; --project <name> runs superuser, import-pocketbase and migrate on one.

slonbase --help lists every option.

Performance

Compared with PocketBase, on the same machine, the same data and the same HTTP workloads, with default settings (method and full results):

Scenario slonbase req/s PocketBase req/s p99 ms (slonbase / PocketBase)
List 30 records 1,557 1,043 36.5 / 101.8
List 30, filtered 1,175 73 47.7 / 623.3
List 30, expand a relation 973 701 50.5 / 161.5
Create a record 1,728 (2,792 with async commit) 2,532 29.8 / 66.0

An embedded SQLite answers a single client's lookups faster, since it runs in the server's process. Writes are slower with PostgreSQL's default durability, and a little faster when PostgreSQL makes the same trade-off as SQLite's default (synchronous_commit = off; see why).

Contributing

Bug reports, ideas and pull requests are welcome; see CONTRIBUTING.md. The quickest checks:

cargo test                                                    # unit tests
SLONBASE_TEST_DATABASE_URL='postgres://postgres:postgres@127.0.0.1:5432/postgres?sslmode=disable' cargo test   # everything
(cd compat && npm ci) && DATABASE_URL='postgres://...' compat/run.sh slonbase                # the SDK compatibility suite

Please report security problems privately.

License

MIT. The dashboard vendors Preact (MIT) and htm (Apache-2.0); their licenses are in ui/app/vendor. It ships the Ubuntu Sans and Ubuntu Sans Mono fonts (Ubuntu Font Licence 1.0); the licence is in ui/app/fonts. slonbase is an independent project inspired by PocketBase (also MIT). It is not affiliated with or endorsed by PocketBase or its author, and it wouldn't exist without their work.

Description taken from the repository README.

Ratings

–
0 ratings
5 0
4 0
3 0
2 0
1 0

Rate this app

Sign in to rate

Comments 0

Sign in to comment

No comments yet.

Related apps

#api · #postgresql