Pre-deployment checklist
Enable encryption
Set an encryption key to protect sensitive settings like SMTP passwords and S3 secrets.Generate a secure key:
Configure HTTPS
Never run PocketBase in production without HTTPS. Use a reverse proxy like nginx or Caddy to handle SSL/TLS termination.PocketBase also has built-in autocert support:This automatically obtains and renews Let’s Encrypt certificates.
Set up automated backups
Configure automatic backups using the cron expression in your settings:This runs backups daily at 2 AM and keeps the last 7 backups.See the backups documentation for more details.
Configure trusted proxy
If running behind a reverse proxy, configure the trusted proxy settings to correctly identify client IPs:
Security considerations
Change default admin credentials
After first deployment, immediately:- Log in to the admin UI at
/_/ - Create a new superuser account
- Delete or disable the default account
Restrict API access
Use collection rules to control data access:Secure file uploads
Configure file upload restrictions:Environment-specific settings
Never commit sensitive values to version control. Use environment variables:Performance optimization
Database optimization
PocketBase uses SQLite with WAL (Write-Ahead Logging) mode enabled by default for better concurrency. For high-traffic applications:- Ensure adequate disk I/O: Use SSDs for better performance
- Monitor database size: Large databases (>100GB) may benefit from external storage solutions
- Use indexes: Add indexes to frequently queried fields
File storage
For production applications with many file uploads, consider using S3-compatible storage:When using S3 for collection files, backups don’t include S3 files. You must back up S3 separately using your cloud provider’s backup tools.
Connection limits
PocketBase handles concurrent connections efficiently. For very high traffic:- Use a reverse proxy with connection pooling
- Deploy multiple PocketBase instances behind a load balancer (read-only replicas)
- Use CDN for static assets
Scaling strategies
Vertical scaling
PocketBase scales well vertically:- Small apps: 1 CPU, 512MB RAM
- Medium apps: 2 CPUs, 2GB RAM
- Large apps: 4+ CPUs, 4GB+ RAM
Horizontal scaling
For read-heavy workloads, you can set up read replicas:- Run a primary PocketBase instance for writes
- Replicate the database to read-only instances
- Route read traffic to replicas
Monitoring and maintenance
Health checks
Implement health check endpoints:Log monitoring
Query logs programmatically:Backup verification
Regularly test backup restoration:- Download a recent backup
- Restore to a test environment
- Verify data integrity
- Test critical functionality
Update strategy
Disaster recovery
Backup strategy
Implement a 3-2-1 backup strategy:- 3 copies of your data
- 2 different storage media
- 1 off-site backup
- Live data in
pb_data - Local backups in
pb_data/backups - Remote backups in S3
Recovery procedures
Document and test your recovery procedures:Next steps
Backups
Learn how to configure and manage backups
Migrations
Understand the migration system for schema changes