Deploying to Production
PocketPages is easy to deploy. If you follow the recommended project structure, everything in /pb_*
can be deployed.
The two most popular ways to go live with PocketBase are to use pockethost.io or to self-host using Fly.io.
Recommended: Deploy to pockethost.io
pockethost.io is the premiere PocketBase hosting service trusted by over 10,000 developers and millions of end users.
In under 30 seconds, you can provision a free instance with unlimited (Fair Use) resources.
Manual Deployment
The easiest way to deploy is using the PocketHost.IO CLI utility (PHIO). Here's how:
- Install the PHIO CLI globally:
npm i -g phio
- Login to your PocketHost account:
phio login
- Link your local project to your PocketHost instance:
phio link <instanceName>
- Deploy your project:
phio deploy
Github Actions Deployment
To set up automated deployments using Github Actions:
cp -r node_modules/pocketpages/starters/deploy-pockethost-ga .
You'll need to set a few Github secrets. Look in the YAML file for details.
Deploy to Fly.io
Warning: Self-hosting is an advanced setup. I know Fly pretty well and it still took me an hour.
To set up Fly.io deployment:
cp -r node_modules/pocketpages/starters/deploy-fly-ga .
After this, you should see a Dockerfile
and fly.toml
.
Use fly launch
and fly deploy
to create a Fly app and deploy it.
For more information, see Host for Free on Fly.io