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
- A VPS with at least 1 vCPU, 512 MB RAM, and 5 GB storage
- Dokploy installed and running on your server (installation docs)
- A domain name (e.g.,
api.yourdomain.com) with DNS A record pointing to your server's IP
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:latestwith 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:
../files/pocketbase-data— SQLite database files, uploaded files, and logs../files/pocketbase-public— Public directory served at the root URL (for hosting a frontend)../files/pocketbase-migrations— Database migration files (used with the migrations system)
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
- In your Dokploy project, navigate to the Domains tab
- Click Add Domain and enter your domain (e.g.,
api.yourdomain.com) - Set the container port to
8090 - Enable HTTPS — Dokploy automatically provisions a Let's Encrypt SSL certificate
- 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
- In Dokploy, go to your project's Deployments tab and click Deploy
- Watch the build logs — the
pocketbasecontainer should start almost instantly - Check the Logs tab for the
pocketbaseservice. Look for:Server started at http://0.0.0.0:8090 - Open
https://api.yourdomain.com/_/in your browser — you should see the PocketBase admin setup page - Create your admin account and explore the dashboard
- 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.
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
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.