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. It delivers database changes efficiently to frontend and edge applications.
Pigsty provides the app/electric template (conf/app/electric.yml). It configures the database, containers, and ingress in one workflow.
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 betruefor development. Disable it in production and configure 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)