1.7 KiB
pb
A simple and fast PocketBase deployment tool.
⚠️ Fair Warning
This is a personal project. I built it to manage and deploy some side-quests using PocketBase: Milkstonks, ringing.guide, belfry.world and waterways.watch.
Use at your own peril.
Commands
init
Start a new PocketBase project (optionally provide a service name via pb init <name>) with a pb.toml:
[server]
port = 8090
# ip = '127.0.0.1'
# domain = 'example.com'
[pocketbase]
version = '0.35.1'
service = 'rusty-dusty'
volume = 'pb_data'
dev
Run the local dev server.
deploy
Syncs pb_public, pb_migrations, and pb_hooks, then restarts the remote PocketBase service. The command will automatically run setup if the PocketBase binary isn’t present on the remote.
status
Show the remote PocketBase systemd service state along with its configured port, PID, and uptime.
setup
Run everything required to deploy an application to a fresh host. This will:
- Setup up a firewall.
- Install and setup Caddy.
- Download pocketbase and configure remote secrets.
- Configure systemd.
logs
Streams the remote logs (/root/pb/{service}/{service}.log).
secrets
Manage the remote secrets in /root/pb/{service}/.env.
pb secrets listprints every variable name (comments and empty lines are ignored).pb secrets set KEY=VALUE [...]adds or updates one or more key/value pairs while leaving the other file entries untouched.pb secrets delete KEY [...]removes the named entries.
Deployment
Remember to point the domain configured in pb.toml at the server.