In this article, we will explore how to deploy a PocketBase application using the platform. PocketBase is a lightweight backend as a service (BAAS) system that allows you to easily build and deploy applications with an embedded database. is a platform that enables developers to deploy and scale their applications globally with ease. By combining PocketBase and, we can create a flying PocketBase application that is reliable and scalable. Let’s get started!


Before we begin, make sure you have the following:

  1. Basic knowledge of Docker and containerization.
  2. A account. If you don’t have one, sign up at
  3. A PocketBase application that you want to deploy.

Deploying Pocketbase on

Step 1: Creating the PocketBase Dockerfile
The first step is to create a Dockerfile that will define the environment for our PocketBase application. Here’s an example of a PocketBase Dockerfile:

FROM alpine:latest
RUN apk add --no-cache \
    unzip \
ADD${PB_VERSION}/pocketbase_${PB_VERSION} /tmp/
RUN unzip /tmp/ -d /pb/
CMD ["/pb/pocketbase", "serve", "--http="]

This Dockerfile downloads the PocketBase binary, extracts it, and exposes port 8080 for communication. Feel free to customize the Dockerfile according to your application’s needs.

Step 2: Install and Set Up flyctl
Next, we need to install flyctl, the command-line tool for interacting with Follow the installation instructions provided at Once installed, run the following commands to sign up and log in to your account:

flyctl auth signup
flyctl auth login

Step 3: Launching the PocketBase Application
Navigate to the directory where you created the Dockerfile, and run the following command to launch your PocketBase application on

flyctl launch

This command will prompt you to provide information about your application, such as its name, deployment region, etc. Answer the questions accordingly, and when asked about deploying a Postgresql database, choose “No” for now. Similarly, choose “No” when asked if you want to deploy immediately.

After the launch command completes, a fly.toml configuration file will be created in your working directory.

Step 4: Creating and Mounting a Persistent Volume
To ensure data persistence for your PocketBase application, we’ll create and mount a persistent volume using flyctl. Run the following command to create a 1GB persistent volume:

flyctl volumes create pb_data --size=1

You will be prompted to select a region for the volume. Choose the same region you selected during the application launch in Step 3.

Once the volume is created, open the fly.toml file and add the following mounts configuration at the root level:

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

This configuration tells to mount the pb_data volume at the specified destination within the PocketBase container.

Step 5: Deploying the PocketBase Application
Now, it’s time to deploy your PocketBase application on Run the following command:

flyctl deploy

This command will push your application’s Docker image to and deploy it on their platform. Once the deployment

is complete, you will be provided with a URL where your application is accessible.

Step 6: Testing the Flying PocketBase Application
To test your flying PocketBase application, open the URL provided by flyctl in your web browser. If everything is set up correctly, you should see the PocketBase welcome page.


Congratulations! You have successfully deployed a flying PocketBase application using By leveraging the power of’s platform and the flexibility of PocketBase, you can now build and deploy applications with ease. Feel free to explore the documentation for more advanced features and configuration options. Happy flying!

For further information feel free to check out this discussion on official pocket base github repository.