---
title: "Deploy PocketBase"
description: "Open Source realtime backend for SaaS and Mobile Apps in 1 file"
category: "Storage"
url: https://railway.com/deploy/pocketbase-7
---

# Deploy PocketBase

Open Source realtime backend for SaaS and Mobile Apps in 1 file

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

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/pocketbase-7/manifest.json

- **Creator:** ZtoA
- **Category:** Storage
- **Total deploys:** 2

## Template content

### PocketBase https://pocketbase.io/images/logo.svg

- **Image:** elestio/pocketbase:latest
- **Health check:** /api/health
- **Public domain:** Yes

## Documentation

# Deploy and Host PocketBase on Railway

![PocketBase - open source backend in 1 file](https://i.imgur.com/aCBbjKx.png)

[PocketBase](https://pocketbase.io/) is an open-source backend platform that provides a database, user authentication, file storage, and a REST API in a single package. It includes a web-based administration dashboard and real-time subscriptions, making it a practical choice for developers building web and mobile applications without managing multiple backend services.

## About Hosting PocketBase

Hosting PocketBase on Railway gives you a publicly accessible backend and administration dashboard with minimal setup. Once deployed, Railway provides a generated domain that you can use to access your PocketBase instance and connect your frontend application to its API.

The administration dashboard is available at `/_/` on your generated domain. This template uses port `8090` for HTTP traffic and `/api/health` for health checks. A persistent volume mounted at `/pb/pb_data` stores your application data across container replacements and redeployments.

After deployment, you must create your first superuser account using the installation URL provided in the deployment logs before signing in to the dashboard.

## Common Use Cases

- **Web and mobile application backends:** Provide database access, authentication, file storage, and APIs for applications built with Astro, React, Vue, Svelte, or mobile frameworks.
- **User authentication and management:** Add user registration, login, and access control without building an authentication system from scratch.
- **Rapid prototyping and MVPs:** Build and test full-stack applications with a built-in database, API, and administration dashboard.

## Dependencies for PocketBase Hosting

- [PocketBase](https://pocketbase.io/) — Open-source backend platform.
- [PocketBase GitHub repository](https://github.com/pocketbase/pocketbase) — Source code, releases, and project documentation.

## Implementation Details

### Access your PocketBase instance

After deployment, open the public domain generated by Railway.

- **Administration dashboard:** `https://your-app.up.railway.app/_/`
- **API base URL:** `https://your-app.up.railway.app/api/`

Replace `your-app.up.railway.app` with your actual Railway-generated domain.

### Create your first superuser account

PocketBase prints a special installation URL in the deployment logs to create your first superuser account.

1. Open your PocketBase service in Railway and view its deployment logs.
2. Find the message instructing you to launch the URL to create your first superuser account.
3. Copy the installation URL shown in the logs. It will resemble `http://0.0.0.0:8090/_/#/pbinstall/your-installation-token`.
4. Remove the internal host and port, `http://0.0.0.0:8090`, while keeping the complete path and installation token beginning with `/_/#/pbinstall/`.
5. Append that path to your Railway-generated domain.

For example, if your Railway domain is `https://your-app.up.railway.app`, the final URL should look like this:

`https://your-app.up.railway.app/_/#/pbinstall/your-installation-token`

6. Open the resulting URL in your browser and follow the instructions to create your superuser account.

**Important:** Use the actual installation token from your deployment logs. The example token above is a placeholder. Do not open the internal `0.0.0.0:8090` address directly.

After creating your account, visit `https://your-app.up.railway.app/_/` and sign in to access the administration dashboard.

### Railway configuration

- **HTTP port:** `8090`
- **Healthcheck path:** `/api/health`
- **Persistent volume mount path:** `/pb/pb_data`
- **Public access:** Use the Railway-generated domain.

The persistent volume stores PocketBase's database, uploaded files, and other application data. Keep the volume attached to the service to preserve data across container replacements and redeployments.

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

- [RustFS | (Just Updated) S3 Object Store, Public URL and Keys Set](https://railway.com/deploy/rustfs-or-just-updated-s3-object-store-p) — S3-compatible object store, keys and public URL preset, volume kept
- [TimescaleDB](https://railway.com/deploy/timescaledb-railway-template) — A PostgreSQL-based time-series database for analytics on Railway.
- [Garage S3 Storage](https://railway.com/deploy/garage-s3-storage) — Ultra-light S3 server: fast, open-source, plug-and-play.

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