Installation
Install PocketBase as a Go module:Quick start
Create a basic PocketBase application:main.go
Core concepts
App instance
Thecore.App interface is the backbone of PocketBase. It provides access to all core functionality including database operations, file storage, event hooks, and more.
Event hooks
PocketBase uses an event-driven architecture. You can register hooks to execute custom logic at specific points:Collections and records
Collections define the schema for your data. Records are instances of collection data:Configuration
Customize your PocketBase instance with configuration options:Configuration options
Hide the default console server info on app startup.
Enable development mode (logs SQL statements to stderr).
The data directory path (defaults to
./pb_data).Environment variable name for encryption key.
Default timeout for database queries.
Running the application
Start method
TheStart() method registers default system commands and executes the root command:
Bootstrap
Manually initialize the application before starting:Custom commands
Add custom CLI commands to your application:Next steps
App interface
Learn about the core App interface and its methods
Collections
Work with collections and schema definitions
Records
Create, read, update, and delete records
Events
Register event hooks for custom logic