Railway

Deploy Pocketbase

Open Source backend for your SaaS and Mobile app in 1 file.

Deploy Pocketbase

Just deployed

/pb/pb_data

PocketBase - open source backend in 1 file

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.

Deploy on Railway

PocketBase v0.36 License MIT Persistent storage


⚡ 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

  1. Click "Deploy on Railway" above and let it build.
  2. Open your service's public URL and add /_/ at the end (e.g. https://your-app.up.railway.app/_/) to reach the admin dashboard.
  3. 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',
});

⚙️ Configuration (optional)

VariableDescription
PORTSet 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

More templates in this category

View Template
Garage S3 Storage
Ultra-light S3 server: fast, open-source, plug-and-play.

PROJETOS
View Template
Postgres Backup to Cloudflare R2 (S3-Compatible)
Automated PostgreSQL backups to S3-compatible storage with encryption

Artour
View Template
ReadySet
A lightweight caching engine for Postgres

Milo