DOKPLOY-GUIDE 6 min read fordnox

Deploy PocketBase with Dokploy: Docker Compose Setup Guide

Step-by-step guide to deploying PocketBase backend on your VPS using Dokploy and Docker Compose. Includes SQLite storage, admin UI, real-time subscriptions, and SSL configuration.


Deploy PocketBase with Dokploy

Dokploy is an open-source server management platform that simplifies deploying Docker Compose applications on your VPS. It handles reverse proxy configuration, SSL certificates, and deployment management — making it straightforward to host PocketBase as your self-hosted backend.

This guide walks you through deploying PocketBase with persistent data storage and automatic HTTPS. PocketBase is an open-source backend in a single file — it includes a real-time database (SQLite), authentication, file storage, and an admin UI with no external dependencies.

Prerequisites

Docker Compose Configuration

Create a new Compose project in Dokploy and paste the following configuration:

version: "3.8"

services:
  pocketbase:
    image: ghcr.io/muchobien/pocketbase:latest
    restart: unless-stopped
    ports:
      - "8090:8090"
    volumes:
      - ../files/pocketbase-data:/pb/pb_data
      - ../files/pocketbase-public:/pb/pb_public
      - ../files/pocketbase-migrations:/pb/pb_migrations
    healthcheck:
      test: ["CMD-SHELL", "wget -qO- http://localhost:8090/api/health || exit 1"]
      interval: 30s
      timeout: 10s
      retries: 3

Note: PocketBase is a single Go binary with no external dependencies. There is no official Docker image from the PocketBase team, but several well-maintained community images exist. The image above is one of the most popular. Alternatively, you can create a minimal Dockerfile: FROM alpine:latest with the PocketBase binary downloaded from the releases page.

Environment Variables

PocketBase uses minimal environment variables — most configuration is done through the admin UI or CLI flags:

Variable Purpose Example
(none required) PocketBase runs with sensible defaults

PocketBase's primary configuration happens through its admin dashboard after deployment. You can optionally pass CLI arguments by overriding the container command, for example: command: ["./pocketbase", "serve", "--http=0.0.0.0:8090", "--origins=https://yourapp.com"] to restrict CORS origins.

Volumes & Data Persistence

This setup uses Dokploy's ../files convention for bind-mounted volumes:

The ../files path is relative to the compose file inside Dokploy's project directory. This ensures your data persists across redeployments. Avoid using absolute paths because Dokploy may clean them during redeployment.

If you need S3 backup support, consider using named Docker volumes instead. Named volumes can be backed up with Dokploy's built-in backup features. PocketBase also natively supports S3-compatible storage for file uploads — configure this in the admin settings.

Domain & SSL Setup

  1. In your Dokploy project, navigate to the Domains tab
  2. Click Add Domain and enter your domain (e.g., api.yourdomain.com)
  3. Set the container port to 8090
  4. Enable HTTPS — Dokploy automatically provisions a Let's Encrypt SSL certificate
  5. Save and wait for the certificate to be issued (usually under a minute)

Dokploy's built-in Traefik reverse proxy handles TLS termination and routes traffic to your PocketBase container. HTTPS is required for real-time subscriptions (SSE) and secure API access.

Verifying the Deployment

  1. In Dokploy, go to your project's Deployments tab and click Deploy
  2. Watch the build logs — the pocketbase container should start almost instantly
  3. Check the Logs tab for the pocketbase service. Look for: Server started at http://0.0.0.0:8090
  4. Open https://api.yourdomain.com/_/ in your browser — you should see the PocketBase admin setup page
  5. Create your admin account and explore the dashboard
  6. Your API is available at https://api.yourdomain.com/api/ — test with: curl https://api.yourdomain.com/api/health

Troubleshooting

PocketBase container fails with "permission denied" The container needs write access to the data directory. From your server shell: mkdir -p ../files/pocketbase-data && chmod 777 ../files/pocketbase-data.

Real-time subscriptions not connecting PocketBase uses Server-Sent Events (SSE) for real-time data. Ensure your Dokploy Traefik proxy is not buffering SSE responses. If connections drop, check Traefik configuration for proxy buffering settings.

File uploads returning errors Check that ../files/pocketbase-data has sufficient disk space. PocketBase stores uploaded files in the data directory by default. For larger deployments, configure S3-compatible storage in the admin settings.

SSL certificate not issuing Ensure your domain's DNS A record points to your server's IP and has propagated. Dokploy uses Let's Encrypt HTTP-01 challenges, so port 80 must be accessible. Check Traefik logs in Dokploy for certificate-related errors.


Learn more about PocketBase in our complete overview.

Need a VPS? Hostinger VPS starts at $4.99/mo — perfect for running PocketBase.


For more on Docker Compose deployments in Dokploy, see the Dokploy Docker Compose documentation.

App data sourced from selfh.st open-source directory.

~/self-hosted-app/pocketbase/dokploy/get-started

Ready to get started?

Get the best VPS hosting deal today. Hostinger offers 4GB RAM VPS starting at just $4.99/mo.

Get Hostinger VPS — $4.99/mo

// up to 75% off + free domain included

// related topics

pocketbase dokploy docker compose self-hosted backend as a service pocketbase deployment

fordnox

Expert VPS reviews and hosting guides. We test every provider we recommend.

// last updated: February 13, 2026. Disclosure: This article may contain affiliate links.