I’ve been working on creating a developer friendly quickly deployable demo for PocketBase with Fly.io. While there are still some rough edges, I believe it creates a pretty compelling case for how one can create a distributed edge DB with SQLite and have nice a layer like PocketBase on top.
Clone this Gist
Clone or Download the copy of Gist. Once downloaded/extracted, and cd
into the directory.
Install Flyctl
- Follow the installation instructions from Install flyctl · Fly Docs.
- Run
fly auth signup
to create a Fly.io account (email or GitHub). - Run
fly auth login
to login.
Deploy and Scale
- Create Fly app using
fly app create
, fill in the information on prompts. - Deploy on app using
fly deploy -a <application-name>
, hereapplication-name
will be the name of app you created - Scale the app to multiple pods you
fly scale count 2 -a <application-name>
. At least have 2 pods for Marmot to
start a cluster, otherwise Marmot process won’t come up and wait for more than 1 nodes to come up.
Create Admin
Once cluster is started go to http://<application-name>.fly.dev/_/
to launch admin panel, it will prompt you to create an
admin account. Choose your email and password. Once you hit create, it will create your admin account.
PocketBase might show you an error saying invalid token. If that happens just wait for a second or so to let
changes propagate. Try reloadinghttp://<application-name>.fly.dev/_/
until you see login form. If issue
persists try creating account again.
Use the APIs
Now you can play with your app’s API using http://<application-name>.fly.dev/api/
. Checkout
PocketBase Docs for deep dive.