Electric: PostgreSQL Sync Engine
Self-host Electric with Pigsty to sync PostgreSQL data to frontend apps with partial replication and real-time delivery.
Electric is a PostgreSQL sync engine focused on efficiently delivering database changes to frontend and edge applications.
Pigsty provides the app/electric template (conf/app/electric.yml) to bootstrap database, container, and ingress settings in one flow.
Quick Start
Default endpoints:
http://<IP>:8002http://elec.pigsty(default domain in the template)
Metrics port defaults to 8003 (ELECTRIC_PROMETHEUS_PORT).
Key Settings
conf/app/electric.yml writes apps.electric.conf into /opt/electric/.env. Common parameters:
DATABASE_URL: PostgreSQL connection string used by Electric (replication privileges required)ELECTRIC_PORT: Electric HTTP port (default8002)ELECTRIC_PROMETHEUS_PORT: metrics port (default8003)ELECTRIC_INSECURE: can betruein dev; disable in prod and use proper secrets
Operations
References
- Electric website: https://electric-sql.com/
- Electric docs: https://electric-sql.com/docs
- Pigsty template: https://github.com/pgsty/pigsty/blob/main/conf/app/electric.yml
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)