---
title: "Deploy ZeroSync"
description: "Rocicorp's ZeroSync engine for local-first apps"
category: "Other"
url: https://railway.com/deploy/Z-5ubo
---

# Deploy ZeroSync

Rocicorp's ZeroSync engine for local-first apps

**[Deploy ZeroSync on Railway](https://railway.com/template/Z-5ubo)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/Z-5ubo/manifest.json

- **Creator:** Marcelo Perrella's Projects
- **Category:** Other
- **Total deploys:** 7

## Template content

### ZeroSync https://iili.io/2pbxEhu.png

- **Image:** rocicorp/zero:0.15.2025021402
- **Public domain:** Yes

## Documentation

## Initial setup

This template only creates the sync engine. You will need to bring your own Postgres instance.

Before deploying for the first time,

- Manually set the `PG_DATABASE_URL` environment variable. This should be the private URL.
- Next you will need to update your Postgres' instance WAL level to `logical`.
  - You can follow the [official documentation here](https://zero.rocicorp.dev/docs/connecting-to-postgres#configuration) for a more detailed explanation on how to do it. If you are comfortable with Postgres and SQL, here is the short version:
  - Connect to your existing Postgres instance, and run `"ALTER SYSTEM SET wal_level = 'logical'`. Next restart your running Postgres instance.

After deploying for the first time,

- Open the generated public endpoint in a new tab. If you see an `ok` it means everything is working.
- To connect to Zero via your web application, you can use the `ZERO_PUBLIC_URL`.

## Permissions

In Zero, access is denied by default. To be able to sync data to your application, you will first need to set up permissions. It's best to read this [page](https://zero.rocicorp.dev/docs/permissions) to understand how it works.

Although you describe permissions by calling functions in Typescript, permissions are actually compiled into JSON and then uploaded to your Postgres instance. Once you defined your permissions, you will have to run the following command:

```
npx zero-deploy-permissions -p ./path/to/schema --upstream-db ${DATABASE_PUBLIC_URL}
```

Note that `DATABASE_PUBLIC_URL` is the public URL to your database, not the private URL that you set up before deploying.

## Configuration

You may have to play around with the `ZERO_NUM_SYNC_WORKERS` to figure out what works best depending on the your service's allocated resources. Decrease/increase this value depending on how many upstream connections your service resources allow.

## Similar templates

- [Rocky Linux](https://railway.com/deploy/rocky-linux) — Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀
- [Foundry Virtual Tabletop](https://railway.com/deploy/X5tR6G) — A Self-Hosted & Modern Roleplaying Platform
- [Letta Code Remote](https://railway.com/deploy/letta-code-remote) — Run a Letta Code agent 24/7. No inbound ports, just deploy.

Open this page in a browser: https://railway.com/deploy/Z-5ubo
