README.md

November 25, 2025 ยท View on GitHub

Logo

pb-deployer

Automates the lifecycle of deploying PocketBase apps to production

Stargazers Contributors AGPL-3.0
Screenshot
**WARNING**HOBBY PROJECT**

Ask DeepWiki

๐Ÿš€ Quick Start

git clone https://github.com/magooney-loon/pb-deployer
cd pb-deployer
go run cmd/scripts/main.go --install

Core Workflow

  1. Server Registration: Add remote host connection details
  2. Server Setup: Automated user creation and directory structure
  3. Security Lockdown: Firewall, fail2ban, disable root SSH (Optional)
  4. App Deployment: Upload prod dist, systemd service creation
  5. Version Management: Rollback support with file storage

Directory Structure

/opt/pocketbase/
โ”œโ”€โ”€ apps/           # Application deployments (per app directory)
โ”œโ”€โ”€ backups/        # Deployment backups (timestamped)
โ”œโ”€โ”€ logs/           # Application logs
โ””โ”€โ”€ staging/        # Temporary staging during deployments

Deployment Steps

  1. Downloading and staging deployment package
  2. Checking service status
  3. Stopping existing service
  4. Creating backup of current deployment
  5. Preparing deployment directory
  6. Installing new version
  7. Creating/updating systemd service
  8. Creating superuser (if initial deployment)
  9. Starting service
  10. Verifying & finalizing deployment
Logo

See **/*/README.md for detailed docs.

Make sure you loaded your SSH keys, check with ssh-add -l

Contribution

PRs are encouraged, but consider opening a discussion first for minor/major changelogs.