PocketBase
An open-source, real-time Go backend in a single executable file with embedded SQLite, auth, file storage, and admin UI.
Why consider PocketBase?
PocketBase is an open-source Go backend providing an embedded SQLite database, real-time subscriptions, file management, and an admin dashboard in a single executable.
Learn PocketBase by building
Practical setup notes, real use cases, and copy-ready examples in one focused guide.
In this guide6 sections
Building with PocketBase: A Single-File Backend
PocketBase is an open-source backend written in Go that integrates an embedded SQLite database, real-time subscriptions, file management, and an administration dashboard into a single executable file. This architecture simplifies deployment and operations by removing the need for separate database servers and file storage infrastructure for many applications.
By providing built-in authentication, access control rules, and an intuitive administrative interface out of the box, PocketBase allows developers to focus on application logic. It provides a REST API and official SDKs for JavaScript and Dart, making it accessible from web, mobile, desktop, and CLI environments.
Deployment Approaches
PocketBase offers two distinct deployment models depending on your project requirements and familiarity with Go.
PocketBase can be used as a standalone application by downloading a precompiled executable, or it can be integrated into custom applications as a Go framework. When operating as a standalone application, developers can still write custom business logic. Users can extend the backend functionality with both Go and JavaScript, as the prebuilt executable includes a JavaScript VM plugin enabled by default.
To run the standalone version, download the executable for your platform, extract it, and start the server:
./pocketbase serveWhen started, the application will automatically generate a pb_data directory to store your application data, users, and uploaded files. It also provisions a pb_migrations directory, tracking database schema changes. The local environment serves static assets from a pb_public folder on http://127.0.0.1:8090, exposes the superuser dashboard at http://127.0.0.1:8090/_/, and provides the core backend operations at http://127.0.0.1:8090/api/.
Developing Custom Applications as a Go Framework
When a project requires complex business logic or integration with existing Go codebases, PocketBase can function as a toolkit. This approach embeds the PocketBase core within a custom Go application while maintaining the benefit of compiling down to a single portable executable.
Setting Up the Go Project
To initialize a custom application, create a new directory and start by defining the application entry point. You must have Go 1.25 or later installed. Create a file named main.go and implement the setup:
package mainimport ( "log" "github.com/pocketbase/pocketbase" "github.com/pocketbase/pocketbase/core")func main() { app := pocketbase.New() app.OnServe().BindFunc(func(se *core.ServeEvent) error { // registers new "GET /hello" route se.Router.GET("/hello", func(re *core.RequestEvent) error { return re.String(200, "Hello world!") }) return se.Next() }) if err := app.Start(); err != nil { log.Fatal(err) }}This code initializes the core engine, attaches a custom route hook (/hello), and starts the server.
To download the required dependencies for the project, run:
go mod init myapp && go mod tidyRunning and Compiling the Framework
During development, you can start the application directly using the Go toolchain:
go run main.go serveWhen it is time to deploy the application, you can compile it into a statically linked binary. Using the pure Go SQLite driver supported by PocketBase, this ensures that the application has no external C library dependencies on the target system. Compile the executable with:
CGO_ENABLED=0 go buildThis command produces a single executable that encompasses the SQLite database engine, the PocketBase framework, and your custom routing logic.
Supported Build Targets
Because PocketBase uses a pure Go SQLite implementation, it can cross-compile to a wide variety of target architectures without requiring a C compiler. The supported compilation targets include common architectures such as linux amd64, linux arm64, windows amd64, darwin amd64, and darwin arm64, as well as more specialized targets like linux riscv64 and freebsd amd64. This portability makes PocketBase suitable for environments ranging from Raspberry Pi devices to enterprise cloud servers.
Integrating SDK Clients
Once the backend is operational, frontend integration is straightforward using the provided SDK clients. The JavaScript SDK supports browser environments, Node.js, and React Native applications. The Dart SDK provides support for Flutter and Dart applications across web, mobile, and desktop platforms. These clients handle authentication token management, real-time Server-Sent Events (SSE) subscriptions, and standardized error handling, ensuring a smooth connection to the backend API endpoints exposed by the framework.
Related tools
More options with a similar category or technology profile.
Aerospike Database
Real-time distributed NoSQL database optimized for flash storage and hybrid memory.
Tile38
Real-time geospatial database, spatial index, and geofencing engine in Go.
BadgerDB
Fast embedded key-value database written purely in Go based on WiscKey architecture.
TiKV
CNCF graduated distributed transactional Key-Value database powered by Rust and Raft.