Deploy PocketBase S3 Backups
[Jun'26] PocketBase with Litestream backups to Railway Bucket.
Pocketbase
Just deployed
/data
Bucket
Bucket
Just deployed
Deploy and Host PocketBase S3 Backups on Railway
PocketBase is a lightweight, open-source backend packed into a single Go binary. It includes a realtime 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, and is suitable for shipping MVPs, internal tools, and small-to-medium applications quickly.
This Railway template deploys PocketBase with persistent storage and Litestream backups to Railway Bucket. You can deploy it in one click, let Railway provision the required resources, and start using PocketBase from your generated service URL.

About This Template
This template includes:
- PocketBase running as the main backend service
- Persistent storage for PocketBase data
- Railway Bucket for object storage backup target
- Litestream for continuous database backup/replication
- One-click deployment through Railway Template
The goal is simple: deploy PocketBase quickly, while keeping your data safer through automated Litestream backups stored in Railway Bucket.
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 is designed to:
- Run PocketBase inside a container
- Honor Railway’s provided
PORT - Store PocketBase data in persistent storage
- Use Litestream to back up the PocketBase database to Railway Bucket
- Start automatically after deployment
After the first successful deploy, open your Railway-generated domain and visit:
https://your-app.up.railway.app/_/
Use this page to create your PocketBase superuser account.
If you see a login screen instead of the registration page, check the Railway deployment logs. PocketBase may print a one-time installer or setup link during first initialization.
One-Click Deploy
This template is intended for one-click deployment.
You only need to:
- Click Deploy on Railway
- Review the generated services and variables
- Select the Railway Bucket region before deployment
- Deploy the template
- Open the PocketBase dashboard at
/_/ - Create your superuser account
Railway will provision the required services and inject the generated bucket variables into the deployment.
Railway Bucket Region
Railway gives users control over where their bucket objects are stored.
The bucket region is selected by the user before deploying the template.
The region where the bucket's objects are stored.
Selected by the user.
Important note:
The bucket's region cannot be configured by the template.
The region can be selected before deploying the template.
This means the template can define that a Railway Bucket is required, but the final bucket region is chosen by the user during deployment.
Litestream Backups
Litestream is used to continuously replicate the PocketBase database to Railway Bucket.
In this template, Litestream runs alongside PocketBase. Once the required bucket variables are available, Litestream starts automatically and sends backups to Railway Bucket.
Backups are powered by Railway Bucket, which is S3-compatible storage.
Common Use Cases
- Rapid CRUD and MVP backends
- Backend for mobile apps or SPAs
- Internal tools and dashboards
- Small SaaS products
- Admin panels with authentication and file uploads
- Lightweight realtime applications
- Projects that need simple deployment with automated backups
Dependencies for PocketBase Hosting
Deployment Dependencies
This template uses:
- PocketBase
- Litestream
- Railway Bucket
- Persistent storage
- Container runtime
Railway provides the runtime environment and generated deployment variables.
Environment Variables
Railway automatically provides the application port:
PORT
This template may also use variables for PocketBase data and Litestream backup configuration, depending on the implementation:
DATA_DIR
LITESTREAM_BUCKET
LITESTREAM_ENDPOINT
LITESTREAM_ACCESS_KEY_ID
LITESTREAM_SECRET_ACCESS_KEY
LITESTREAM_REGION
When deployed through the Railway Template, the bucket-related variables are expected to be generated from the Railway Bucket service.
Persistent Storage
PocketBase stores its application data, uploaded files, collections, users, and configuration in its data directory.
This template is designed to use persistent storage so your PocketBase data survives restarts and redeployments.
Do not rely on container filesystem storage for production data. Container filesystems are ephemeral and may be lost when the service is rebuilt or redeployed.
First-Time Setup
After deployment:
- Open your generated Railway domain
- Go to:
/_/
- Create the PocketBase superuser
- Log in to the PocketBase dashboard
- Start creating collections, users, APIs, and rules
Example:
https://your-app.up.railway.app/_/
Admin Dashboard
PocketBase includes a built-in admin dashboard.
You can access it from:
https://your-app.up.railway.app/_/
From the dashboard, you can manage:
- Collections
- Records
- Users
- Authentication settings
- API rules
- File uploads
- Application settings
API Access
PocketBase exposes REST and realtime APIs automatically.
REST API:
https://your-app.up.railway.app/api/
Admin dashboard:
https://your-app.up.railway.app/_/
Deployment Dependencies
Useful references:
- PocketBase Documentation: https://pocketbase.io/docs/
- PocketBase Releases: https://github.com/pocketbase/pocketbase/releases
- PocketBase CLI Reference: https://pocketbase.io/docs/cli/
- Litestream Documentation: https://litestream.io/
- Railway Buckets: https://docs.railway.com/
Register UI
If the registration page does not appear immediately, check your Railway service logs.
PocketBase may provide a setup or installer link during the first startup.

Why Deploy PocketBase on Railway?
Railway is a platform for deploying infrastructure and application services with minimal configuration.
By deploying PocketBase on Railway, you get:
- Fast one-click deployment
- Managed deployment environment
- Persistent storage support
- Railway Bucket integration
- Public service URL
- Easy redeployments
- Simple scaling path for small-to-medium projects
This template is useful when you want PocketBase running quickly, but also want backups stored outside the main application container.
Template Content
Pocketbase
codestorm-official/pocketbase-s3-backupsBucket
Bucket
