Skip to content

Run PocketBase on

New Course Coming Soon:

Get Really Good at Git

First set up See run an app on

Also see my Docker tutorials.

Create an empty folder, add this Dockerfile (update the PB_VERSION value to the latest version of PocketBase available):

FROM ubuntu:latest


RUN apk add --no-cache \
    unzip \

# download and unzip PocketBase
ADD${PB_VERSION}/pocketbase_${PB_VERSION} /tmp/

RUN unzip /tmp/ -d /pb/

# uncomment to copy the local pb_migrations dir into the image
# COPY ./pb_migrations /pb/pb_migrations

# uncomment to copy the local pb_hooks dir into the image
# COPY ./pb_hooks /pb/pb_hooks


# start PocketBase
CMD ["/pb/pocketbase", "serve", "--http="]

Run fly launch --build-only to create and build the app but not deploy it, as we need to attach a volume to persist data across deploys (but first we need to initialize it and the fly.toml file)

Run fly volumes create pb_data --size=1 to create the volume. Create it in the same region of the app

Now in fly.toml add:

  destination = "/pb/pb_data"
  source = "pb_data"

Now run fly deploy --ha=false

Pocketbase will be available at https://<yourapp>

Only problem I had was internal connection URLs (.internal) in Fly, I haven’t found a way to make both IPv4 (used for external connection) work alongside IPv6 (used for internal connections), so in my app (also in Fly) I used external URL (hope to fix).

Are you intimidated by Git? Can’t figure out merge vs rebase? Are you afraid of screwing up something any time you have to do something in Git? Do you rely on ChatGPT or random people’s answer on StackOverflow to fix your problems? Your coworkers are tired of explaining Git to you all the time? Git is something we all need to use, but few of us really master it. I created this course to improve your Git (and GitHub) knowledge at a radical level. A course that helps you feel less frustrated with Git. Launching May 21, 2024. Join the waiting list!

Here is how can I help you: