This repository is a local development environment for testing a custom Coolify one-click service template. It provisions an Ubuntu VM with Docker and Coolify, then injects the PowerSync compose template, logo, and service registry entry into the running Coolify container—similar to what you would contribute upstream (see Add a new service template to Coolify and Services introduction).
brew install vagrantInstall VirtualBox from the official VirtualBox download page (not via Homebrew unless you prefer the cask; the Oracle installer is the common path).
Vagrant is configured to use the VirtualBox provider for this project.
-
Install Vagrant and VirtualBox (above).
-
From the repository root, bring the VM up (first run downloads the box and runs provisioning):
vagrant up
-
Open Coolify in your browser (see Access Coolify).
-
After changing files under
services/, re-run provisioning so Coolify picks up updates:vagrant provision
-
If necessary (for example inspecting containers) you can always SSH into the VM using
vagrant ssh
| Command | Purpose |
|---|---|
vagrant up |
Create/start the VM and run provisioning. |
vagrant provision |
Run provisioners again without a full rebuild (useful after editing services/* or the Vagrantfile). |
vagrant ssh |
Open an SSH session into the VM as the default user. |
vagrant destroy |
Stop and delete the VM (data inside the VM is removed unless you use external disks). |
vagrant reload |
Reboot the VM (e.g. after changing forwarded ports or VirtualBox settings). |
In vagrantfile, vb.gui is false by default. Set it to true in the virtualbox provider block if you want to open the VM console:
- Username:
vagrant - Password:
vagrant
.
├── vagrantfile
│ VM definition: Ubuntu 24.04, port forwards, synced `./services` →
│ `/home/vagrant/services`, Docker + Coolify install script, and a provisioner
│ that copies PowerSync assets into the Coolify container and patches
│ `service-templates.json`.
├── services/
│ ├── powersync.yaml
│ │ Coolify-style Docker Compose template for PowerSync (metadata comments +
│ │ `services.powersync` definition).
│ ├── powersync.svg
│ │ Service logo; copied into Coolify's `public/svgs/` path expected by the
│ │ template.
Port forwarding from the vagrantfile:
- Coolify dashboard: http://localhost:8000 (guest
8000→ host8000). - HTTP on the VM (often proxy / apps on port 80): http://localhost:8080 (guest
80→ host8080). - HTTPS: host
8443→ guest443. - Extra range: guest ports
6000–6060are also forwarded to the same ports on the host.
Complete the Coolify first-time setup in the UI as prompted.
- In Coolify, create a new project (or open an existing one).
- Add a new resource → Service (one-click / compose-based service).
- Search for
powersyncand select the PowerSync template. - Configure required environment variables (see
services/powersync.yaml), especially:PS_DATA_SOURCE_URIPS_SYNC_BUCKET_URIPS_BACKEND_JWKS_URI
Deploy and verify logs and health checks from the Coolify UI.
This walks through deploying Supabase and PowerSync together in Coolify using one-click templates.
- Add a new resource → Service → search for Supabase and select it.
- Before deploying, go to the Supabase service Settings and enable "Connect To Predefined Network". This is required so PowerSync can reach the Supabase database.
- Deploy and wait for all containers to become healthy.
Coolify assigns a domain using the VM's external IP, which isn't reachable from the host machine. To fix this:
- Go to the Supabase service → click supabase-kong → find the domain/URL field.
- Replace the external IP with the VM's private IP (
192.168.56.10). For example:- Before:
http://supabasekong-<service-id>.161.142.146.132.sslip.io - After:
http://supabasekong-<service-id>.192.168.56.10.sslip.io
- Before:
- Redeploy the Supabase service and visit the updated URL.
You need two things:
- Service ID — visible in the Supabase Kong URL. If the URL is
http://supabasekong-ae2yug3bigzjp3rcm7svy4ou.192.168.56.10.sslip.io, the service ID isae2yug3bigzjp3rcm7svy4ou. - Postgres password — found in the Supabase service environment variables on the General tab (
SERVICE_PASSWORD_POSTGRES).
The database connection URL follows this pattern:
postgresql://postgres:<PASSWORD>@supabase-db-<SERVICE_ID>:5432/postgres
-
Add a new resource → Service → search for PowerSync.
-
Set these environment variables:
Variable Value PS_DATA_SOURCE_URIpostgresql://postgres:<password>@supabase-db-<service-id>:5432/postgresPS_SYNC_BUCKET_URISame as above (can use the same database) PS_BACKEND_JWKS_URIhttp://supabasekong-<service-id>.192.168.56.10.sslip.io/auth/v1/.well-known/jwks.json -
Deploy PowerSync.
PowerSync requires logical replication. Follow the PowerSync database setup guide, then create the publication:
CREATE PUBLICATION powersync FOR ALL TABLES;The template ships with placeholder sync streams referencing mytable. Replace them with your actual tables:
- In Coolify, go to the PowerSync service → Storages → Files.
- Edit sync-config.yaml with your sync stream definitions.
- Save and redeploy.
See the sync streams documentation for details.
| Variable | Required | Description |
|---|---|---|
PS_DATA_SOURCE_URI |
Yes | Source database connection string (postgresql://user:pass@host:5432/db) |
PS_SYNC_BUCKET_URI |
Yes | Sync bucket storage connection string (can be the same database) |
PS_BACKEND_JWKS_URI |
Yes | JWKS endpoint for verifying client JWTs |
PS_DATA_SOURCE_TYPE |
Yes | Database type (default: postgresql) |
PS_SYNC_BUCKET_TYPE |
Yes | Storage type (default: postgresql) |
PS_HS256_KEY and PS_API_TOKEN are auto-generated by Coolify.
Both files are editable in the Coolify UI under Storages → Files:
- powersync.yaml — main service configuration (ports, connections, auth).
- sync-config.yaml — sync streams defining which data is synced to each client.
When connecting PowerSync to another Coolify service, enable "Connect To Predefined Network" in the Settings of the other service. The PowerSync template already joins this network. Use the full container name (e.g. supabase-db-<service-id>) as the hostname in connection strings.