PocketBase Deploy

Configures production PocketBase deployments with systemd, Docker, reverse proxies, TLS, and backups.

30.5k|3.5k|Updated Jul 4, 2025
One-click install
npx skills add https://github.com/davila7/claude-code-templates --skill pocketbase-deploy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: PocketBase Deploy
Source: https://github.com/davila7/claude-code-templates/tree/main/cli-tool/components/skills/pocketbase/pb-deploy
Command: npx skills add https://github.com/davila7/claude-code-templates --skill pocketbase-deploy

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Deploying PocketBase to production involves many moving parts—service management, TLS certificates, reverse proxy tuning for realtime SSE, SMTP, S3 storage, and safe backups—and misconfiguring any of them causes downtime or data loss.

Core Features & Use Cases

  • Service & Container Setup: Provides ready-to-use systemd unit files with security hardening, plus a Dockerfile and docker-compose configuration with health checks.
  • Reverse Proxy & TLS: Supplies Caddy and nginx configurations with automatic Let's Encrypt certificates and the SSE settings required for PocketBase realtime subscriptions.
  • Production Hardening & Operations: Covers SMTP setup, superuser MFA, settings encryption keys, rate limiting, S3-compatible file storage, and safe SQLite hot-backup scripts with retention.
  • Use Case: You have a PocketBase app running locally and need to ship it to a VPS. Use this Skill to generate the systemd service, nginx config with TLS, and a nightly backup cron job in one pass.

Quick Start

Deploy my PocketBase app to a production server with systemd, nginx, TLS, and automated daily backups.

Frequently Asked Questions about PocketBase Deploy

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I deploy PocketBase to a production server?

Download the single PocketBase binary for your architecture, run it behind a systemd service, and expose it through a reverse proxy like Caddy or nginx with TLS. Store data in the pb_data directory and bind the server to localhost so only the proxy is public.

Should I use Caddy or nginx as a reverse proxy for PocketBase?

Caddy is simpler because it obtains and renews Let's Encrypt TLS certificates automatically with a two-line config. Nginx requires manual certbot setup but offers finer control; both need proxy_buffering disabled for realtime SSE subscriptions.

Why is PocketBase realtime not working behind nginx?

Realtime subscriptions use Server-Sent Events, which break when nginx buffers responses. Set proxy_buffering off, proxy_cache off, and a long proxy_read_timeout such as 3600s in the location block proxying to PocketBase.

How do I back up a PocketBase SQLite database safely?

Use the sqlite3 .backup command or the built-in Dashboard backup API, which perform hot backups without corrupting data. Never copy the .db file directly while PocketBase is running, since it may be in an inconsistent state.

Can PocketBase store uploaded files on S3?

Yes, PocketBase supports S3-compatible storage configured in Dashboard settings or via hooks. It works with AWS S3, Backblaze B2, Cloudflare R2, MinIO, DigitalOcean Spaces, and Wasabi, with forcePathStyle available for MinIO and Backblaze.

How do I secure the PocketBase admin dashboard in production?

Bind PocketBase to 127.0.0.1 so the dashboard is unreachable publicly, then access it through an SSH tunnel. Additionally enable MFA for superuser accounts and use the --encryptionEnv flag to encrypt sensitive settings at rest.