# PGSync Generated on 10 Dec 2025 from [the PGSync catalog page](https://marketplace.digitalocean.com/apps/pgsync) [PGSync](https://pgsync.com) is a Python service that streams changes from PostgreSQL into Elasticsearch/OpenSearch using Postgres WAL. It’s designed for low-latency indexing, large tables, and resilient checkpointing via Redis/Valkey. **This 1-Click Droplet** boots a hardened Ubuntu image with [PGSync](https://pgsync.com) preinstalled and a first-boot wizard that asks for: - `SCHEMA_URL:` URL to your schema.json mapping (e.g., raw GitHub URL). - `PG_URL:` Postgres connection string. - `ELASTICSEARCH_URL:` OpenSearch/Elasticsearch endpoint. - `REDIS_URL:` Valkey/Redis endpoint (used for checkpoints). [PGSync](https://pgsync.com) runs as a systemd service under a non-root user (pgsync), with logs in journalctl. Firewall (UFW) allows only SSH by default. Optional: offer a Managed Database at launch; if a customer selects it, credentials are auto-injected and available at /root/.digitalocean\_dbaas\_credentials, and a `DATABASE_URL` env is set for convenience. ## Software Included | Package | Version | License | |---|---|---| | pgsync | 6.0.0 | MIT | | Python | 3.11.0 | PSF License | ## Creating an App using the Control Panel Click the **Deploy to DigitalOcean** button to create a Droplet based on this 1-Click App. If you aren’t logged in, this link will prompt you to log in with your DigitalOcean account. [![Deploy to DO](https://www.deploytodo.com/do-btn-blue.svg)](https://cloud.digitalocean.com/droplets/new?image=pgsync) ## Creating an App using the API In addition to creating a Droplet from the PGSync 1-Click App using the control panel, you can also use the [DigitalOcean API](https://docs.digitalocean.com/reference/api). As an example, to create a 4GB PGSync Droplet in the SFO2 region, you can use the following `curl` command. You need to either save your [API access token](https://docs.digitalocean.com/reference/api/create-personal-access-token/index.html.md) to an environment variable or substitute it in the command below. ```shell curl -X POST -H 'Content-Type: application/json' \ -H 'Authorization: Bearer '$TOKEN'' -d \ '{"name":"choose_a_name","region":"sfo2","size":"s-2vcpu-4gb","image":"pgsync"}' \ "https://api.digitalocean.com/v2/droplets" ``` ## Getting Started After Deploying PGSync After the Droplet boots, SSH in and run: `sudo pgsync-setup` Enter: - `SCHEMA_URL:` (e.g., [https://raw.githubusercontent.com////schema.json](https://raw.githubusercontent.com////schema.json)) - `PG_URL:` (Fully qualified Postgres connection string) - `ELASTICSEARCH_URL:` (Fully qualified OpenSearch/Elasticsearch endpoint) - `REDIS_URL:` (Fully qualified Valkey/Redis endpoint) PGSync runs as a systemd service (“pgsync”). Check logs: `journalctl -u pgsync.service -f` Update settings: edit /etc/pgsync/pgsync.env then: `sudo systemctl restart pgsync.service` Firewall: UFW allows SSH only.