Skip to content

Commit 3075646

Browse files
committed
docs: update quickstarts
1 parent 00e836e commit 3075646

File tree

2 files changed

+71
-16
lines changed

2 files changed

+71
-16
lines changed

docs/postgresql/SELF_HOSTED_POSTGRES_QUICKSTART.md

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,22 @@ This guide helps you enable CloudSync on a **self-hosted PostgreSQL database**.
44

55
## Step 1: Deploy PostgreSQL with CloudSync
66

7-
Use the pre-built PostgreSQL Docker image that includes the CloudSync extension. This image is available for:
8-
- PostgreSQL 15
9-
- PostgreSQL 17
7+
You can enable CloudSync in one of two ways:
8+
- Use the published Docker image if you run PostgreSQL in Docker
9+
- Install the released extension files into an existing native PostgreSQL installation
10+
11+
### Option A: Docker
12+
13+
Use the published PostgreSQL image that already includes the CloudSync extension:
14+
- `sqlitecloud/sqlite-sync-postgres:15`
15+
- `sqlitecloud/sqlite-sync-postgres:17`
1016

1117
Example using Docker Compose:
1218

1319
```yaml
1420
services:
1521
db:
16-
image: <cloudsync-postgres-image>
22+
image: sqlitecloud/sqlite-sync-postgres:17
1723
container_name: cloudsync-postgres
1824
environment:
1925
POSTGRES_USER: postgres
@@ -39,6 +45,23 @@ Run:
3945
docker compose up -d
4046
```
4147

48+
### Option B: Existing PostgreSQL Without Docker
49+
50+
If you already run PostgreSQL directly on a VM or bare metal, download the release tarball that matches your operating system, CPU architecture, and PostgreSQL major version.
51+
52+
Extract the archive, then copy the three extension files into PostgreSQL's extension directories:
53+
54+
```bash
55+
cp cloudsync.so "$(pg_config --pkglibdir)/"
56+
cp cloudsync.control cloudsync--1.0.sql "$(pg_config --sharedir)/extension/"
57+
```
58+
59+
Then connect to PostgreSQL and enable the extension:
60+
61+
```sql
62+
CREATE EXTENSION IF NOT EXISTS cloudsync;
63+
```
64+
4265
---
4366

4467
## Step 2: Register Your Database in the CloudSync Dashboard
@@ -110,4 +133,4 @@ If you need role-based access control (RLS) or production security:
110133
2. **Select tables** you want to sync (checkbox each table)
111134
3. Click **Deploy Changes**
112135

113-
CloudSync is now active on your selected tables.
136+
CloudSync is now active on your selected tables.

docs/postgresql/SELF_HOSTED_SUPABASE_QUICKSTART.md

Lines changed: 43 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,51 @@
22

33
This guide helps you enable CloudSync on a **fresh or existing** self-hosted Supabase instance. CloudSync adds offline-first synchronization capabilities to your PostgreSQL database.
44

5-
## Step 1: Use the Custom PostgreSQL Image with CloudSync
5+
## Step 1: Use the CloudSync Supabase Image
66

7-
When deploying or updating your Supabase instance, use our custom PostgreSQL image that includes the CloudSync extension instead of the standard Supabase Postgres image.
7+
When deploying or updating your Supabase instance, use the published CloudSync Supabase image instead of the standard Supabase Postgres image.
88

99
### For New Deployments
1010

11-
Follow [Supabase's Installing Supabase](https://supabase.com/docs/guides/self-hosting/docker#installing-supabase) guide to set up the initial files and `.env` configuration. Then, instead of using the default Supabase Postgres image, update your `docker-compose.yml`:
11+
Follow [Supabase's Installing Supabase](https://supabase.com/docs/guides/self-hosting/docker#installing-supabase) guide to set up the initial files and `.env` configuration. Then, before the first `docker compose up -d`, update your `docker-compose.yml` to use the CloudSync-enabled Postgres image:
1212

1313
```yaml
1414
db:
15-
# PostgreSQL 15
16-
image: <cloudsync-image-15>
15+
# Supabase on PostgreSQL 15
16+
image: sqlitecloud/sqlite-sync-supabase:15.8.1.085
1717
# instead of: public.ecr.aws/supabase/postgres:15.8.1.085
1818

19-
# OR PostgreSQL 17
20-
image: <cloudsync-image-17>
19+
# OR Supabase on PostgreSQL 17
20+
image: sqlitecloud/sqlite-sync-supabase:17.6.1.071
2121
# instead of: public.ecr.aws/supabase/postgres:17.6.1.071
2222
```
2323

24-
Then run:
24+
Use the tag that matches your Supabase Postgres base image exactly. Convenience tags `sqlitecloud/sqlite-sync-supabase:15` and `sqlitecloud/sqlite-sync-supabase:17` are also published, but the exact Supabase tag is the safest choice.
25+
26+
### Add the CloudSync Init Script
27+
28+
Create the init SQL:
29+
30+
```bash
31+
mkdir -p volumes/db
32+
cat > volumes/db/cloudsync.sql << 'EOF'
33+
CREATE EXTENSION IF NOT EXISTS cloudsync;
34+
EOF
35+
```
36+
37+
Add a volume mount to the `db` service in `docker-compose.yml`:
38+
39+
```yaml
40+
services:
41+
db:
42+
volumes:
43+
# ... existing volume mounts ...
44+
- ./volumes/db/cloudsync.sql:/docker-entrypoint-initdb.d/init-scripts/100-cloudsync.sql:Z
45+
```
46+
47+
The `100-` prefix ensures CloudSync loads after Supabase's own init scripts, which are typically numbered `98-99` in the self-hosted Docker Compose setup.
48+
49+
Then start Supabase:
2550

2651
```bash
2752
docker compose pull
@@ -30,14 +55,22 @@ docker compose up -d
3055

3156
### For Existing Deployments
3257

33-
Follow [Supabase's Updating](https://supabase.com/docs/guides/self-hosting/docker#updating) guide. When updating the Postgres image, replace the default image with the CloudSync-enabled image (will be provided):
58+
Follow [Supabase's Updating](https://supabase.com/docs/guides/self-hosting/docker#updating) guide. When updating the Postgres image, replace the default image with the matching CloudSync image:
3459

3560
```bash
36-
# Update docker-compose.yml with the new CloudSync image
61+
# Update docker-compose.yml to use:
62+
# sqlitecloud/sqlite-sync-supabase:15.8.1.085
63+
# or sqlitecloud/sqlite-sync-supabase:17.6.1.071
3764
docker compose pull
3865
docker compose down && docker compose up -d
3966
```
4067

68+
If Postgres has already been initialized and you are adding CloudSync afterward, the init script will not run automatically. Connect to the database and run:
69+
70+
```sql
71+
CREATE EXTENSION IF NOT EXISTS cloudsync;
72+
```
73+
4174
---
4275

4376
## Step 2: Register Your Database in the CloudSync Dashboard
@@ -108,4 +141,3 @@ If you need role-based access control (RLS) or production security:
108141
4. Click **Deploy Changes**
109142

110143
CloudSync is now active on your selected tables.
111-

0 commit comments

Comments
 (0)