README.md
November 25, 2025 ยท View on GitHub
pb-deployer
Automates the lifecycle of deploying PocketBase apps to production
**WARNING**HOBBY PROJECT**
๐ Quick Start
git clone https://github.com/magooney-loon/pb-deployer
cd pb-deployer
go run cmd/scripts/main.go --install
Core Workflow
- Server Registration: Add remote host connection details
- Server Setup: Automated user creation and directory structure
- Security Lockdown: Firewall, fail2ban, disable root SSH (Optional)
- App Deployment: Upload prod dist, systemd service creation
- 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
- Downloading and staging deployment package
- Checking service status
- Stopping existing service
- Creating backup of current deployment
- Preparing deployment directory
- Installing new version
- Creating/updating systemd service
- Creating superuser (if initial deployment)
- Starting service
- Verifying & finalizing deployment
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.