Other / Self-hosted
Need help? Simply contact us on Discord and we'll help you get set up.
Enable Logical Replication
PowerSync reads the Postgres WAL using logical replication in order to create sync buckets in accordance with the specified PowerSync Sync Rules.
If you are managing Postgres yourself, set wal_level = logical
in your config file:
Alternatively, you can use the below SQL commands to check and enable logical replication:
Note that Postgres must be restarted after changing this config.
If you're using a managed Postgres service, there may be a setting for this in the relevant section of the service's admin console.
Create a PowerSync Database User
Create a PowerSync user on Postgres:
For read-only access, only the SELECT
privilege is required — INSERT
, UPDATE
and DELETE
can be removed.
To restrict read access to specific tables, explicitly list allowed tables for both the SELECT
privilege, and for the publication (as well as for any other publications that may exist).
Create "powersync" Publication
Connect PowerSync to Your Database
In the PowerSync dashboard project tree, click on "Create new instance":
Give your instance a name, such as "Testing"
Under the "General" tab, you can change the default cloud region from US to EU or JP if desired (more cloud regions are available, contact us if you need a different region).
Under the "DB Connections" tab, click on the + icon.
Fill in the connection details on the subsequent screen.
If you want to query your database via the PowerSync dashboard, enable "Allow querying in the editor?".
Also note that if you're using a self-signed SSL certificate for your database server, click the "Download Certificate" button to dynamically fetch the recommended certificate directly from your server.
Note if you get any error such as
server certificate not trusted: SELF_SIGNED_CERT_IN_CHAIN
, click "Download Certificate" to attempt automatic resolution.
Click "Test Connection" and fix any errors.
Click "Save".
PowerSync deploys and configures an isolated cloud environment for you, which will take a few minutes to complete.
Last updated