Deploy Pocketbase
Open Source backend for your SaaS and Mobile app in 1 file.
Pocketbase
Just deployed
/pb/pb_data
PocketBase on Railway
Your entire backend in one click.
Database, auth, file storage, realtime API and an admin dashboard — deployed and ready in under a minute.
⚡ Why this template?
Stop wiring together a database, an auth provider, a file bucket and an API server. PocketBase gives you all of that in a single Go binary — and this template runs it on Railway with persistent storage already configured, so your data survives every redeploy.
Perfect for MVPs, side projects, prototypes and small production apps where you want a real backend without the infrastructure babysitting.
✨ What you get out of the box
- 🗄️ Embedded SQLite database with realtime subscriptions over WebSockets
- 🔐 Built-in authentication — email/password, OAuth2 (Google, GitHub, etc.) and one-time passwords
- 📁 File storage & management (local or S3-compatible)
- 🎛️ Beautiful admin dashboard to manage collections, records, users and settings — no extra UI to build
- 🔌 Auto-generated REST-ish API the moment you create a collection
- 💾 Persistent volume pre-mounted so your data is never wiped on deploy
- ⚙️ Zero-config networking — Railway assigns your public HTTPS domain automatically
🚀 Get started in 3 steps
- Click "Deploy on Railway" above and let it build.
- Open your service's public URL and add
/_/at the end (e.g.https://your-app.up.railway.app/_/) to reach the admin dashboard. - Create your first superuser account on the setup screen — and you're live. Start creating collections and your API endpoints appear instantly.
> 💡 Tip: Click "Generate Domain" in the Railway service Settings if you don't see a public URL yet.
💾 Your data is safe
This template mounts a persistent volume at /pb_data, where PocketBase keeps the SQLite database, uploaded files and settings. That means redeploys, restarts and new versions won't erase your data — the #1 mistake people make when self-hosting PocketBase.
🔌 Connect your app
The easiest way to talk to your backend is through an official SDK:
import PocketBase from 'pocketbase';
const pb = new PocketBase('https://your-app.up.railway.app');
// Authenticate a user
await pb.collection('users').authWithPassword('user@example.com', 'password');
// Query records with filters, realtime, pagination — all built in
const posts = await pb.collection('posts').getList(1, 20, {
filter: 'published = true',
});
- JavaScript / TypeScript — pocketbase/js-sdk (browser, Node.js, React Native)
- Dart / Flutter — pocketbase/dart-sdk (web, mobile, desktop)
⚙️ Configuration (optional)
| Variable | Description |
|---|---|
PORT | Set automatically by Railway — PocketBase binds to it. |
PB_VERSION | (if your Dockerfile uses it) Pin the PocketBase version to build. |
> Adjust this table to match the variables your template actually exposes.
📚 Resources
> ⚠️ Heads up: PocketBase is still under active development (currently pre-v1.0.0), so full backward compatibility isn't guaranteed between minor versions. It's great for most projects — just skim the changelog before upgrading critical apps.
PocketBase is free and open source under the MIT License. Built with ❤️ on Railway.
Template Content
Pocketbase
laguillo/pocketbase