Deploy Pocketbase
Secure scalable self-hosted backend: persistence, easy deploy, healthcheck.
pocketbase
asepscareer/pocketbase
Just deployed
/data
Deploy and Host Pocketbase on Railway
Pocketbase is a lightweight, open-source backend packed into a single Go binary that includes a realtime SQLite database, built-in authentication, file storage, access rules, and an elegant admin UI. It exposes REST and realtime APIs, supports schema migrations and JavaScript hooks, enabling you to ship MVPs or small-to-medium apps quickly without wiring multiple services.
About Hosting pocketbase
Hosting pocketbase is simple: run the single binary in a container, expose the HTTP port, and persist the data directory. This template pins a release for reproducible builds, runs as a non-root user, honors the platform’s $PORT
, and expects a volume at /srv/pb/pb_data
so records, files, and config survive restarts. On first deploy, visit your instance’s /_/
path to create the superuser (admin). If you see a login screen instead, check the service logs for the one-time installer link or create a superuser via CLI. Upgrades are as easy as rebuilding with a newer version.
> First-time setup: After the first successful deploy, open https:///_/
to register the superuser for your instance. This happens once per new data volume.
Common Use Cases
- Rapid CRUD/MVP backends with auth, file uploads, and access rules
- Backend for mobile/SPA apps that need realtime data and an admin UI
- Internal tools, dashboards, and small multi-tenant apps
Dependencies for Pocketbase Hosting
- Container runtime: Alpine-based image with
ca-certificates
,tini
- Build tools (stage download):
curl
,unzip
- Environment variables:
PORT
(platform-provided),DATA_DIR
(default/srv/pb
) - Persistent storage: attach a platform Volume to
/srv/pb/pb_data
- Note: do not use
VOLUME
in the Dockerfile; configure volumes in the platform UI
- Note: do not use
Deployment Dependencies
- Documentation: https://pocketbase.io/docs/
- Releases: https://github.com/pocketbase/pocketbase/releases
- CLI reference: https://pocketbase.io/docs/cli/
- Login UI (your instance):
https:///_/
- Register UI please check logs:
Why Deploy Pocketbase 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 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
asepscareer/pocketbase