Set up a full-featured, lightweight backend in minutes with PocketBase — an open-source Go-powered platform that combines database, authentication, and real-time APIs in a single file.
If you’re a developer looking for a simple, fast, and self-hosted backend, PocketBase might be exactly what you need.
It’s an open-source backend written in Go that lets you set up a complete backend with database, authentication, file storage, and real-time updates, all in a single executable file.
In this guide, we’ll explore what makes PocketBase special, how to set it up on both your local machine and on the cloud using Sevalla.
What is PocketBase
PocketBase is an all-in-one backend that provides everything you need to power a modern web or mobile app, eliminating the need for large infrastructure.
It includes an embedded SQLite database, real-time subscriptions, file and user management, a clean admin dashboard, and a REST-style API.
Since it runs from a single file, you can deploy it almost anywhere, from a VPS to your local machine or even a Raspberry Pi.
It’s designed for developers who want control and simplicity at the same time. You don’t need to manage separate servers for authentication, storage, and API endpoints.
PocketBase handles all of this out of the box. You can use it as a standalone backend or embed it in your Go application to create a custom solution.
Why Developers Love PocketBase
PocketBase focuses on speed and simplicity. You don’t need to install multiple packages or services.
Once downloaded, you can start it with a single command, and it will launch a web-based admin dashboard.
The database is built using SQLite, which means data is stored locally by default, but you can use extensions to connect it with your existing workflows or cloud storage.
You don’t need to install multiple packages or services. Once downloaded, you can start it with a single command, and it will launch a web-based admin dashboard.
The database is built using SQLite, which means data is stored locally by default, but you can use extensions to connect it with your existing workflows or cloud storage.
Another major advantage is its real-time capabilities. Every change in the database can be broadcast instantly to connected clients through WebSocket subscriptions. This makes it perfect for building apps like chat systems, dashboards, and collaboration tools that require instant updates.
How to Install Pocketbase
Getting PocketBase running takes less than a minute. You can download a prebuilt executable from the official releases page.
It supports all major platforms, including Windows, macOS, and Linux.
Once downloaded, extract the archive and navigate to the folder in your terminal. Run the following command:
./pocketbase serve
This command starts a local server and launches the admin dashboard at http://127.0.0.1:8090/_/. From there, you can create collections, add users, upload files, and manage data. There’s no setup wizard or dependency installation—everything is self-contained inside that one binary.
If you’re a Go developer, you can also install PocketBase as a Go module and use it directly in your project to build custom logic or extend the existing API.
Using PocketBase as a Go Framework
PocketBase can act as a Go framework, letting you build your own backend logic while keeping everything in one file. Here’s a simple example that shows how you can extend it with a custom route.
package main
import (
"log"
"github.com/pocketbase/pocketbase"
"github.com/pocketbase/pocketbase/core"
)
func main() {
app := pocketbase.New()
app.OnServe().BindFunc(func(se *core.ServeEvent) error {
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)
}
}
Once the file is ready, run these commands:
go mod init myapp && go mod tidy
go run main.go serve
You’ll now have a working backend with both the PocketBase dashboard and your custom /hello endpoint available at the same time.
This makes PocketBase flexible, you can use it as a ready-to-run backend or as part of a more complex Go project.
Extending PocketBase with JavaScript
PocketBase also includes a built-in JavaScript virtual machine that allows you to extend its behavior without recompiling the Go code.
You can write JavaScript scripts to handle triggers, validation, and events. For example, you can write a small script to send an email whenever a new record is created or to validate input before saving it to the database.
This makes it friendly for teams who may not be comfortable with Go but still want to add dynamic logic to their backend. You can find more details in the official documentation under “Extend with JavaScript.”
Using SDKs to Interact with PocketBase
To make it easier to communicate with your backend, PocketBase provides official SDKs for JavaScript and Dart.
The JavaScript SDK works well for browser-based or Node.js projects, while the Dart SDK is ideal for mobile apps built with Flutter. Both SDKs provide an easy way to connect, authenticate users, and perform CRUD operations without manually writing HTTP requests.
For example, in JavaScript you can connect and fetch data like this:
import PocketBase from 'pocketbase'
const pb = new PocketBase('http://127.0.0.1:8090')
const records = await pb.collection('posts').getList(1, 20)
console.log(records)
This simplicity allows you to focus on building your frontend while PocketBase handles authentication, database operations, and real-time updates.
Self-Hosting PocketBase using Sevalla
When you are ready to move beyond testing, PocketBase gives you two options. You can self-host it using your own infrastructure or use their managed cloud version at Pocketbase.io.
Self-hosting gives you full control and is usually preferred by technical teams who want to keep sensitive data in-house.
You can choose any cloud provider, like AWS, DigitalOcean, or others to set up Pocketbase. But I will be using Sevalla.
Sevalla is a PaaS provider designed for developers and dev teams shipping features and updates constantly in the most efficient way. It offers application hosting, database, object storage, and static site hosting for your projects.
I am using Sevalla for two reasons:
- Every platform will charge you for creating a cloud resource. Sevalla comes with a $50 credit for us to use, so we won’t incur any costs for this example.
- Sevalla has a template for Umami, so it simplifies the manual installation and setup for each resource you will need for installation.
Log in to Sevalla and click on Templates. You can see Pocketbaseas one of the templates.
Click on the “PocketBase” template. You will see the resources needed to provision the application. Click on “Deploy Template”.
You can see the resource being provisioned. Once the deployment is complete, go to the PocketBase application and click on “Visit app”
You will see a 404 message. Add _ to the url and you will see the login dashboard.
To login for the first time, you will need a superuser login. To create that, go back to the application and click “Logs”. You will see a url starting with http://0.0.0.0/
Replace the 0.0.0.0 with your new cloud url and copy paste the full path into the browser. You will see the option to create a super user for your PocketBase deployment.
Once you have created the super user, you can again go to /_ and login using the username and password. You should now see the PocketBase dashboard.
You now have a production-grade Pocketbase server running on the cloud. You can use this to set up tables for your database and use the JavaScript or other SDKs to interact with Pocketbase.
Security and Open Source Nature
PocketBase is open source and licensed under MIT, which means you’re free to use it in personal or commercial projects. If you find a bug or security issue, you can report it to the maintainers, and they’ll address it promptly.
The project’s transparent development and active community make it a solid choice for startups, indie developers, and hobbyists who prefer to own their infrastructure.
Because it’s still in active development, backward compatibility isn’t guaranteed before version 1.0. However, it’s already stable enough for small to medium-scale applications.
When to Use PocketBase
PocketBase is perfect for projects that need a simple backend with low maintenance. It’s ideal for prototypes, small SaaS products, indie apps, internal tools, and educational projects.
Instead of setting up a complex stack with PostgreSQL, Node.js, and Nginx, you can get your backend running instantly and focus on your product.
If your project later grows into something bigger, you can migrate to a more complex setup or continue using PocketBase as a lightweight service for specific features like authentication or real-time data sync.
Conclusion
PocketBase brings back the joy of fast development without complicated setups. With just one executable, you get a backend that supports authentication, real-time updates, file uploads, and an admin dashboard. It’s open source, fast, and customizable, making it a great choice for developers who want to move quickly without giving up control.
Whether you’re building a personal app, a startup MVP, or an internal dashboard, PocketBase gives you the power to set up a full backend in minutes. You can start small, extend it as needed, and deploy it anywhere — all while keeping your workflow simple and efficient.







Top comments (0)