Skip to main content
The easiest way to run PowerSync locally is with the PowerSync CLI, which scaffolds and manages a Docker Compose stack for you. See the Setup Guide for step-by-step CLI instructions: powersync init self-hosted + powersync docker configure + powersync docker start. If you’d prefer to write your own Docker Compose setup, here’s a minimal example.

Docker Compose Example

Create a working directory with three files:

docker-compose.yaml

This example uses Postgres as the source database and MongoDB as bucket storage. Postgres is also supported as bucket storage — see Self-Hosted Instance Configuration for details.

service.yaml

The main PowerSync Service configuration. See Self-Hosted Instance Configuration for the full reference.

sync-config.yaml

Defines what data syncs to clients. See Sync Streams for full syntax.

Start the Stack

Resources