|
| 1 | +--- |
| 2 | +title: "Coolify" |
| 3 | +description: "Configuration details for deploying the PowerSync Service on Coolify" |
| 4 | +--- |
| 5 | + |
| 6 | +[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. |
| 7 | +Think of it as a self-hosted alternative to platforms like Heroku or Netlify. |
| 8 | + |
| 9 | +<Warning> |
| 10 | + Before deploying the Powersync Service on Coolify, it is highly recommended to read through the [PowerSync Service Setup](/self-hosting/installation/powersync-service-setup) |
| 11 | + guide to understand the requirements and configuration options. |
| 12 | +</Warning> |
| 13 | + |
| 14 | + |
| 15 | +## Deploying PowerSync on Coolify |
| 16 | + |
| 17 | +<Steps> |
| 18 | + <Step title="Deploy PowerSync"> |
| 19 | + Add the PowerSync Service resource to your project by either scrolling through the `Services` section or by searching powersync in the search bar. |
| 20 | + <Frame> |
| 21 | + <img src="/images/coolify/powersync_resource.png"/> |
| 22 | + </Frame> |
| 23 | + </Step> |
| 24 | + <Step title="Update environment variables"> |
| 25 | + 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 |
| 26 | + [Environment Variables](/self-hosting/installation/coolify#environment-variables). |
| 27 | + <Frame> |
| 28 | + <img src="/images/coolify/powersync_env.png"/> |
| 29 | + </Frame> |
| 30 | + </Step> |
| 31 | + <Step title="Update config files"> |
| 32 | + Navigate to the `Storages` tab and update the `sync_rules.yaml` and `powersync.yaml` files as needed. |
| 33 | + For more information see [Sync Rules](/usage/sync-rules) and |
| 34 | + the skeleton config file in [PowerSync Service Setup](/self-hosting/installation/powersync-service-setup). |
| 35 | + <Frame> |
| 36 | + <img src="/images/coolify/powersync_storage.png"/> |
| 37 | + </Frame> |
| 38 | + <Note> |
| 39 | + You can expand the content by dragging the bottom right corner of the editor. |
| 40 | + <Frame> |
| 41 | + <img src="/images/coolify/expand_content.png"/> |
| 42 | + </Frame> |
| 43 | + </Note> |
| 44 | + * Update the `sync_rules.yaml` file: |
| 45 | + <Frame> |
| 46 | + <img src="/images/coolify/powersync_sync_rules.png"/> |
| 47 | + </Frame> |
| 48 | + * Update the `powersync.yaml` file: |
| 49 | + <Frame> |
| 50 | + <img src="/images/coolify/powersync_config.png"/> |
| 51 | + </Frame> |
| 52 | + </Step> |
| 53 | + <Step> |
| 54 | + Click on the `Deploy` button to deploy the PowerSync Service. |
| 55 | + <Frame> |
| 56 | + <img src="/images/coolify/powersync_deploy.png"/> |
| 57 | + </Frame> |
| 58 | + </Step> |
| 59 | +</Steps> |
| 60 | + |
| 61 | + |
| 62 | +## Configuration |
| 63 | + |
| 64 | +The PowerSync Service requires two configuration files to run - `powersync.yaml` and `sync_rules.yaml` |
| 65 | + |
| 66 | +### Environment Variables |
| 67 | + |
| 68 | +<table> |
| 69 | + <thead> |
| 70 | + <tr> |
| 71 | + <th>Environment Variable</th> |
| 72 | + <th>Description</th> |
| 73 | + <th>Example</th> |
| 74 | + </tr> |
| 75 | + </thead> |
| 76 | + <tbody> |
| 77 | + <tr> |
| 78 | + <td><code>POWERSYNC_CONFIG_PATH</code></td> |
| 79 | + <td>This is the path (inside the container) to the YAML config file</td> |
| 80 | + <td>/config/powersync.yaml</td> |
| 81 | + </tr> |
| 82 | + <tr> |
| 83 | + <td><code>DATABASE_HOSTNAME</code></td> |
| 84 | + <td>The host on which the database is running</td> |
| 85 | + <td>localhost</td> |
| 86 | + </tr> |
| 87 | + <tr> |
| 88 | + <td><code>DATABASE_NAME</code></td> |
| 89 | + <td>The database name</td> |
| 90 | + <td>postgres</td> |
| 91 | + </tr> |
| 92 | + <tr> |
| 93 | + <td><code>DATABASE_PORT</code></td> |
| 94 | + <td>Port on which the DB is accessible from</td> |
| 95 | + <td>5432</td> |
| 96 | + </tr> |
| 97 | + <tr> |
| 98 | + <td><code>DATABASE_USER</code></td> |
| 99 | + <td>DB User</td> |
| 100 | + <td>postgres</td> |
| 101 | + </tr> |
| 102 | + <tr> |
| 103 | + <td><code>DATABASE_PASSWORD</code></td> |
| 104 | + <td>DB user password</td> |
| 105 | + <td>postgres</td> |
| 106 | + </tr> |
| 107 | + <tr> |
| 108 | + <td><code>DATA_SOURCE_URI</code></td> |
| 109 | + <td>The datasource connection URI</td> |
| 110 | + <td>postgres</td> |
| 111 | + </tr> |
| 112 | + <tr> |
| 113 | + <td><code>POWERSYNC_PORT</code></td> |
| 114 | + <td>The port the PowerSync API is accessible on</td> |
| 115 | + <td>8080</td> |
| 116 | + </tr> |
| 117 | + </tbody> |
| 118 | +</table> |
| 119 | +## Health checks |
| 120 | + |
| 121 | +For more information on checking the health of the PowerSync Service, see [Healthchecks](/self-hosting/lifecycle-maintenance/healthchecks). |
0 commit comments