---
title: "Deploy Pocketbase"
description: "[Jul'26] Secure scalable backend with persistence, easy deploy & check."
category: "Other"
url: https://railway.com/deploy/pocketbase-1
---

# Deploy Pocketbase

[Jul'26] Secure scalable backend with persistence, easy deploy & check.

**[Deploy Pocketbase on Railway](https://railway.com/template/pocketbase-1)**

- **Creator:** codestorm
- **Category:** Other
- **Total deploys:** 123

## Template content

### pocketbase https://devicons.railway.app/pocketbase

- **Source:** codestorm-official/pocketbase
- **Public domain:** Yes

## Documentation

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

&gt; **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

### 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:
![logs](https://github.com/asepscareer/pocketbase/blob/main/preview.png?raw=true)

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

## Similar templates

- [Rocky Linux](https://railway.com/deploy/rocky-linux) — [Jul'26] Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀
- [Foundry Virtual Tabletop](https://railway.com/deploy/X5tR6G) — A Self-Hosted & Modern Roleplaying Platform
- [Letta Code Remote](https://railway.com/deploy/letta-code-remote) — Run a Letta Code agent 24/7. No inbound ports, just deploy.

Open this page in a browser: https://railway.com/deploy/pocketbase-1
