Skip to main content

Docker

The Electric sync service is packaged using Docker and published to Docker Hub at hub.docker.com/r/electricsql/electric.

See Usage -> Installation -> Sync service to get familiar with configuring and running the sync service with Docker. An example invocation would be:

docker run \
-e "DATABASE_URL=postgresql://..." \
-e "ELECTRIC_WRITE_TO_PG_MODE=direct_writes" \
-e "PG_PROXY_PASSWORD=..." \
-e "AUTH_JWT_ALG=HS512" \
-e "AUTH_JWT_KEY=..." \
-p 5133:5133 \
-p 5433:5433 \
-p 65432:65432 \
-t \
electricsql/electric

Alternatively, using Docker Compose we can configure an instance of the Electric sync service in a compose.yaml file stored locally and deploy it to a remote machine that has the Docker daemon running. See instructions for deploying Electric to a Digital Ocean Droplet for an example of such setup.