Skip to main content
This guide covers everything you need to install and configure pb-ext for development and production use.

System Requirements

Minimum Requirements

ComponentVersionNotes
Go1.25.7 or higherRequired for building and running pb-ext
Operating SystemLinux, macOS, WindowsCross-platform support
RAM512 MB minimum1 GB+ recommended for production
Disk Space100 MBFor binaries, database, and dependencies
pb-ext requires Go 1.25.7 or higher. Earlier versions are not supported due to module dependencies.

Optional Dependencies

ToolPurposeInstallation
Node.jsFrontend building with pb-clinodejs.org
GitVersion control and examplesgit-scm.com
curlTesting API endpointsUsually pre-installed

Installation Methods

Verifying Installation

After installation, verify everything works correctly:
1

Check Go Version

go version
Should output go version go1.25.7 or higher.
2

Check pb-cli

pb-cli --help
Should display the pb-cli usage information.
3

Run Test Server

Create a minimal test:
mkdir test-pb
cd test-pb
go mod init test-pb
go get github.com/magooney-loon/pb-ext/core
Create main.go:
package main
import (
    "log"
    app "github.com/magooney-loon/pb-ext/core"
)
func main() {
    srv := app.New(app.InDeveloperMode())
    app.SetupLogging(srv)
    if err := srv.Start(); err != nil {
        log.Fatal(err)
    }
}
Run it:
go run main.go serve
4

Access Admin Panel

Open http://127.0.0.1:8090/_ in your browser.You should see the PocketBase admin setup page.
5

Access Dashboard

After creating an admin account, visit http://127.0.0.1:8090//.You should see the pb-ext health dashboard with system metrics.

Configuration

Environment Variables

pb-ext respects standard PocketBase environment variables:
VariableDefaultDescription
PB_DATA_DIR./pb_dataDatabase and storage directory
PB_ENCRYPTION_KEYGeneratedDatabase encryption key
PB_LOG_LEVELinfoLogging level (debug, info, warn, error)
Set environment variables before starting:
export PB_DATA_DIR=/var/lib/pb-data
export PB_LOG_LEVEL=debug
pb-cli --run-only

Configuration Options

Configure pb-ext via functional options in your main.go:
import (
    app "github.com/magooney-loon/pb-ext/core"
    "github.com/pocketbase/pocketbase"
)

func main() {
    // Option 1: Custom PocketBase config
    srv := app.New(
        app.WithConfig(&pocketbase.Config{
            DefaultDev:     true,
            DefaultDataDir: "./custom_pb_data",
        }),
    )
    
    // Option 2: Existing PocketBase instance
    pb := pocketbase.New()
    srv := app.New(app.WithPocketbase(pb))
    
    // Option 3: Developer mode toggle
    srv := app.New(app.InDeveloperMode())
    
    // Start server
    app.SetupLogging(srv)
    srv.Start()
}
WithConfig and WithPocketbase are mutually exclusive. Use one or the other, not both.

Custom Port Configuration

Change the default port (8090) programmatically:
import "os"

func main() {
    // Set port before creating server
    os.Args = []string{"app", "serve", "--http=127.0.0.1:9090"}
    
    srv := app.New(app.InDeveloperMode())
    app.SetupLogging(srv)
    srv.Start()
}
Or via command line:
pb-cli --run-only -- serve --http=127.0.0.1:9090

Troubleshooting

Problem: The pb-cli command is not found after installation.Solution: Ensure $GOPATH/bin is in your PATH:
# Check GOPATH
go env GOPATH

# Add to PATH (Linux/macOS)
export PATH="$PATH:$(go env GOPATH)/bin"

# Add to PATH (Windows PowerShell)
$env:Path += ";$(go env GOPATH)\bin"
Make it permanent by adding to your shell profile (~/.bashrc, ~/.zshrc, etc.):
echo 'export PATH="$PATH:$(go env GOPATH)/bin"' >> ~/.bashrc
source ~/.bashrc
Problem: Error messages about Go version requirements.Solution: Upgrade to Go 1.25.7 or higher:
# Download from golang.org/dl
# Or use version manager like gvm:

# Install gvm
bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)

# Install Go 1.25.7
gvm install go1.25.7
gvm use go1.25.7 --default
Problem: bind: address already in use error.Solution: Find and kill the process using port 8090:
# Find process
lsof -i :8090
# Or
netstat -tuln | grep 8090

# Kill process
kill -9 <PID>

# Or use a different port
pb-cli --run-only -- serve --http=127.0.0.1:9090
Problem: go mod tidy fails to download dependencies.Solution: Check your Go module proxy settings:
# Use default proxy
go env -w GOPROXY=https://proxy.golang.org,direct

# Or use mirror (China)
go env -w GOPROXY=https://goproxy.cn,direct

# Retry
go clean -modcache
go mod tidy
Problem: Cannot write to pb_data directory.Solution: Check directory permissions:
# Create directory with proper permissions
mkdir -p pb_data
chmod 755 pb_data

# Or run with specific user
sudo chown -R $USER:$USER pb_data
Problem: Cannot access /_/_ dashboard.Solution: The dashboard requires superuser authentication:
  1. First visit /_/ to create an admin account
  2. Log in to the admin panel
  3. Then access /_/_ - you should be automatically authenticated
If issues persist, clear cookies and try again.
Problem: Swagger UI shows no endpoints.Solution: Ensure your route files have the // API_SOURCE directive:
package main

// API_SOURCE  ← This is required!

import (
    "github.com/magooney-loon/pb-ext/core/server/api"
    "github.com/pocketbase/pocketbase/core"
)

func registerRoutes(app core.App) {
    // Your routes...
}
Check debug endpoint for AST parsing errors: http://127.0.0.1:8090/api/docs/debug/ast

Platform-Specific Notes

Linux

pb-ext works out of the box on most Linux distributions. For production deployments:
# Install as systemd service
sudo nano /etc/systemd/system/pb-ext.service
[Unit]
Description=pb-ext Server
After=network.target

[Service]
Type=simple
User=www-data
WorkingDirectory=/var/www/pb-ext
ExecStart=/var/www/pb-ext/server serve
Restart=always

[Install]
WantedBy=multi-user.target
sudo systemctl enable pb-ext
sudo systemctl start pb-ext

macOS

On macOS, you may need to allow the binary through Gatekeeper:
# If you get "unidentified developer" warning
xattr -d com.apple.quarantine ./pb-server

# Or build from source instead
go build -o pb-server cmd/server/main.go

Windows

On Windows, use PowerShell or CMD:
# Install pb-cli
go install github.com/magooney-loon/pb-ext/cmd/pb-cli@latest

# Add to PATH permanently
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";$env:GOPATH\bin", "User")

# Run server
pb-cli --run-only
Windows Defender may flag the compiled binary. Add an exclusion for your project directory if needed.

Next Steps

Additional Resources