Database Connection
Connect a PowerSync instance to your backend database.
This page covers PowerSync Cloud. For self-hosted PowerSync, refer to this section.
Create a PowerSync Instance
- In the Overview workspace of the PowerSync Dashboard, you will be prompted to create your first instance:
If you’ve previously created an instance in your project, you can create an additional instance by navigating to Manage instances and clicking Create new instance:
You can also create an entirely new project with its own set of instances. Click on the PowerSync icon in the top left corner of the Dashboard or on Admin Portal at the top of the Dashboard, and then click on Create Project.
- Give your instance a name, such as “Testing”.
- [Optional] You can change the default cloud region from US to EU, JP (Japan), AU (Australia) or BR (Brazil) if desired.
- Note: Additional cloud regions will be considered on request, especially for customers on our Enterprise plan. Please contact us if you need a different region.
- [Optional] You can opt in to using the
Next
version of the Service, which may contain early access or experimental features. Always use theStable
version in production. - Click Next.
Specify Connection Details
Each database provider has their quirks when it comes to specifying connection details, so we have documented database-specific and provider-specific instructions below:
Postgres Provider Specifics
Select your Postgres hosting provider for steps to connect your newly-created PowerSync instance to your Postgres database:
For other providers and self-hosted databases:
MongoDB Specifics
- Fill in your connection details from MongoDB:
- Copy your cluster’s connection string and paste it into the PowerSync instance URI field. PowerSync will automatically parse this URI to populate other connection details.
- The format should be
mongodb+srv://[username:password@]host/[database]
. For example,mongodb+srv://admin:<db_password>@cluster0.abcde1.mongodb.net/powersync
- The format should be
- Enter your database user’s password into the Password field. See the necessary permissions in Source Database Setup.
- “Database name” is the database in your cluster to replicate.
- Copy your cluster’s connection string and paste it into the PowerSync instance URI field. PowerSync will automatically parse this URI to populate other connection details.
- Click “Test Connection” and fix any errors. If have any issues connecting, reach out to our support engineers on our Discord server or otherwise contact us.
- Make sure that your database allows access to PowerSync’s IPs — see Security and IP Filtering
- Click “Save”.
PowerSync deploys and configures an isolated cloud environment for you, which can take a few minutes to complete.
Also see:
MySQL (Alpha) Specifics
- Fill in your connection details from MySQL:
- “Name” can be any name for the connection.
- “Host” and “Database name” is the database to replicate.
- “Username” and “Password” maps to your database user.
- Click “Test Connection” and fix any errors. If have any issues connecting, reach out to our support engineers on our Discord server or otherwise contact us.
- Make sure that your database allows access to PowerSync’s IPs — see Security and IP Filtering
- Click “Save”.
PowerSync deploys and configures an isolated cloud environment for you, which can take a few minutes to complete.