Deployment options
You can deploy PocketBase using several approaches:- Standalone binary: Download and run the PocketBase executable directly on your server
- Docker container: Use containerization for consistent deployment across environments
- Platform-as-a-Service: Deploy to platforms like Fly.io, Railway, or DigitalOcean App Platform
- Traditional VPS: Run on virtual private servers from providers like AWS, Google Cloud, or DigitalOcean
System requirements
PocketBase has minimal system requirements:- Operating system: Linux, macOS, or Windows (restore functionality requires Unix-based systems)
- Memory: As little as 256MB RAM for small applications
- Storage: Depends on your data volume and backup strategy
- Architecture: Supports amd64, arm64, and armv7
For production deployments, you should have at least 2x the size of your
pb_data directory available as free disk space to safely perform backups.Data directory structure
PocketBase stores all data in thepb_data directory:
Running PocketBase
Start PocketBase with the serve command:--http: Change the HTTP server address (default:127.0.0.1:8090)--dir: Specify a custom data directory (default:./pb_data)--publicDir: Set a custom public directory path--hooksDir: Set a custom hooks directory path--migrationsDir: Set a custom migrations directory path
Binding to
0.0.0.0 makes PocketBase accessible from external networks. Use 127.0.0.1 for local-only access.Environment variables
PocketBase supports configuration through environment variables:-
Encryption: Set the encryption key for sensitive settings
-
Data directory: Override the default data directory
Process management
For production deployments, use a process manager to ensure PocketBase runs continuously:systemd (Linux)
Create a systemd service file at/etc/systemd/system/pocketbase.service:
Docker
Create aDockerfile:
Reverse proxy
In production, you should run PocketBase behind a reverse proxy like nginx or Caddy for:- SSL/TLS termination
- Load balancing
- Rate limiting
- Static file serving
nginx example
Caddy example
Next steps
Going to production
Learn about production-specific configurations and best practices
Backups
Set up automated backups to protect your data
Migrations
Manage database schema changes with migrations