Deploy pocketbase-railway
Deploy a full backend in 60s🪄: PocketBase with auth, storage, admin UI
pocketbase
Just deployed
/pb/pb_data
Deploy and Host pocketbase-railway on Railway
PocketBase is the open-source, single-binary alternative to Supabase and Firebase — one ~12MB Go executable that gives you a SQLite database, REST API, authentication, file storage, realtime subscriptions, and an admin dashboard. This template deploys it to Railway with a persistent volume, a pre-seeded sample collection, and auto-created admin access so it works the moment it's online.
About Hosting pocketbase-railway
Hosting pocketbase-railway is a single-container deploy: Railway builds a multi-arch Alpine image pinned to a specific PocketBase release, then runs the binary with a persistent volume mounted at /pb/pb_data so your database, uploads, and settings survive redeploys and restarts.
An entrypoint script handles first-boot setup — it creates the admin superuser from environment variables (PB_ADMIN_EMAIL / PB_ADMIN_PASSWORD) — and a healthcheck on /api/health keeps the service honest. Versioned JS migrations and hooks are copied into the image, so schema changes and custom logic deploy automatically with each push.
Common Use Cases
- Backend for web/mobile apps — auth, data, and file storage via a REST API, no server code to write.
- Internal tools & admin panels — the built-in dashboard at
/_/manages collections, records, and users out of the box. - Rapid prototyping — deploy a working backend in one click, seed it with migrations, and iterate with SDKs for JS, Dart/Flutter, and more.
Dependencies for pocketbase-railway Hosting
- Railway volume — persistent storage at
/pb/pb_data(512 MB default, resize anytime). - Environment variables —
PB_ADMIN_EMAIL/PB_ADMIN_PASSWORD(orPB_SKIP_ADMIN=truefor the installer flow).
Implementation Details
The container runs a lightweight entrypoint that resolves the admin credentials and data directory from env vars, creates the superuser on first boot, then starts PocketBase:
/pb/pocketbase superuser create "${PB_ADMIN_EMAIL}" "${PB_ADMIN_PASSWORD}" --dir="${PB_DATA_DIR}" || true
exec /pb/pocketbase serve --http="0.0.0.0:${PORT:-8080}" --dir="${PB_DATA_DIR}"
A sample migration (pb_migrations/20240801000000_sample_todos.js) creates a todos collection with open rules and seeds two records, so the API and dashboard have data on first open. Extend with your own migrations and pb_hooks — they're applied automatically on every deploy.
Why Deploy pocketbase-railway on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying pocketbase-railway on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
Template Content
pocketbase
8u9i/pocketbase-railway