Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added images/coolify/expand_content.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/coolify/powersync_config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/coolify/powersync_deploy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/coolify/powersync_env.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/coolify/powersync_resource.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/coolify/powersync_storage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/coolify/powersync_sync_rules.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 8 additions & 2 deletions mint.json
Original file line number Diff line number Diff line change
Expand Up @@ -338,10 +338,16 @@
"self-hosting/getting-started",
{
"group": "Installation",
"pages": [
"pages": [{
"group": "Powersync-service",
"pages": [
"self-hosting/installation/powersync-service-setup",
"self-hosting/installation/coolify"
]
},
"self-hosting/installation",
"self-hosting/installation/database-setup",
"self-hosting/installation/powersync-service-setup",

"self-hosting/installation/client-side-setup",
"self-hosting/installation/app-backend-setup"
]
Expand Down
118 changes: 118 additions & 0 deletions self-hosting/installation/coolify.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
---
title: "Coolify"
description: "Configuration details for deploying the PowerSync Service on Coolify"
---

[Coolify](https://coolify.io/) is an open-source, self-hosted platform that simplifies the deployment and management of applications, databases, and services on your own infrastructure.
Think of it as a self-hosted alternative to platforms like Heroku or Netlify.

<Warning>
Before deploying the Powersync Service on Coolify, it is highly recommended to read through the [PowerSync Service Setup](/self-hosting/installation/powersync-service-setup)
guide to understand the requirements and configuration options.
</Warning>


## Deploying PowerSync on Coolify

<Steps>
<Step title="Add PowerSync service to project resources">
Add the PowerSync Service resource to your project by either scrolling through the `Services` section or by searching for `powersync` in the search bar.
<Frame>
<img src="/images/coolify/powersync_resource.png"/>
</Frame>
<Note>
The default one-click deployable PowerSync Service uses
* MongoDB for internal storage,
* PostgreSQL for replication, and
Copy link
Collaborator

@kobiebotha kobiebotha Nov 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MongDB and MySQL not supported in this version, or did we miss that?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From my understanding mongo is supported

* [Sync Rules](/usage/sync-rules) as defined for the To-Do List demo application found in [Demo Apps / Example Projects](/resources/demo-apps-example-projects).

If you are running the demo To-Do List application, you can jump to Step 4 and simply deploy the PowerSync Service.
</Note>
</Step>
<Step title="Update environment variables">
Navigate to the `Environment Variables` tab and update the environment variables as per your requirements. For more information on what environment variables are available, see
[Environment Variables](/self-hosting/installation/coolify#environment-variables).
<Frame>
<img src="/images/coolify/powersync_env.png"/>
</Frame>
</Step>
<Step title="Update config files">
Navigate to the `Storages` tab and update the `sync_rules.yaml` and `powersync.yaml` files as needed.
For more information see [Sync Rules](/usage/sync-rules) and
the skeleton config file in [PowerSync Service Setup](/self-hosting/installation/powersync-service-setup).
<Frame>
<img src="/images/coolify/powersync_storage.png"/>
</Frame>
<Note>
You can expand the content by dragging the bottom right corner of the editor.
<Frame>
<img src="/images/coolify/expand_content.png"/>
</Frame>
</Note>
* Update the `sync_rules.yaml` file:
<Frame>
<img src="/images/coolify/powersync_sync_rules.png"/>
</Frame>
* Update the `powersync.yaml` file:
<Frame>
<img src="/images/coolify/powersync_config.png"/>
</Frame>
</Step>
<Step>
Click on the `Deploy` button to deploy the PowerSync Service.
<Frame>
<img src="/images/coolify/powersync_deploy.png"/>
</Frame>
The PowerSync Service will now be available at
* `http://localhost:8080` if default config was used, or
* `http://{your_coolify_domain}:{PS_PORT}` if a custom domain or port was specified.
</Step>
</Steps>

## Environment Variables

<table>
<thead>
<tr>
<th>Environment Variable</th>
<th>Description</th>
<th>Example</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>POWERSYNC_CONFIG_PATH</code></td>
<td>This is the path (inside the container) to the YAML config file</td>
<td>/home/config/powersync.yaml</td>
</tr>
<tr>
<td><code>PS_DATABASE_TYPE</code></td>
<td>Database replication type</td>
<td>postgresql</td>
</tr>
<tr>
<td><code>PS_BACKEND_DATABASE_URI</code></td>
<td>Database connection URI</td>
<td>postgresql://postgres:postgres@localhost:5432/postgres</td>
</tr>
<tr>
<td><code>PS_PORT</code></td>
<td>The port the PowerSync API is accessible on</td>
<td>8080</td>
</tr>
<tr>
<td><code>PS_MONGO_URI</code></td>
<td>The MongoDB URI used internally by the PowerSync Service</td>
<td>mongodb://mongo:27017</td>
</tr>
<tr>
<td><code>PS_JWKS_URL</code></td>
<td>Auth URL</td>
<td>http://localhost:6060/api/auth/keys</td>
</tr>
</tbody>
</table>

## Health checks

For more information on checking the health of the PowerSync Service, see [Healthchecks](/self-hosting/lifecycle-maintenance/healthchecks).