Railway

Deploy PocketBase S3 Backups

[Jun'26] PocketBase with Litestream backups to Railway Bucket.

Deploy PocketBase S3 Backups

/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.

img

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:

  1. Click Deploy on Railway
  2. Review the generated services and variables
  3. Select the Railway Bucket region before deployment
  4. Deploy the template
  5. Open the PocketBase dashboard at /_/
  6. 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:

  1. Open your generated Railway domain
  2. Go to:
/_/
  1. Create the PocketBase superuser
  2. Log in to the PocketBase dashboard
  3. 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:

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.

logs

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

More templates in this category

View Template
Rocky Linux
[Jun'26] Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀

codestorm
View Template
Foundry Virtual Tabletop
A Self-Hosted & Modern Roleplaying Platform

Lucas
View Template
Letta Code Remote
Run a Letta Code agent 24/7. No inbound ports, just deploy.

Letta