pglite Docker & Self-Hosted Deployment

GitHub

Embeddable Postgres with real-time, reactive bindings.

15,513 stars TypeScript TypeScript 1 file ยท ~15,498 tokens #database#postgres#wasm
RAW Compose
1. Pull Image (DOCKERHUB) docker pull electricsql/electric
2. Docker Run (1-Click Launch) docker run -d --name pglite -p 54321:54321 --restart always electricsql/electric
3. Podman Run podman run -d --name pglite -p 54321:54321 --restart always electricsql/electric
4. Skopeo Inspect (Zero-Pull Manifest) skopeo inspect docker://docker.io/electricsql/electric:latest
5. ORAS Pull (OCI Artifact) oras pull electricsql/electric
6. Compose Deployment docker compose up -d
packages/pglite-sync/example/docker-compose.yaml
Download .yml
version: "3.3"
name: "electric_quickstart"

services:
  postgres:
    image: postgres:16
    environment:
      POSTGRES_DB: electric
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: password
    ports:
      - 54321:5432
    tmpfs:
      - /var/lib/postgresql/data
      - /tmp
    volumes:
      - ./init.sql:/docker-entrypoint-initdb.d/init.sql
    command:
      - -c
      - listen_addresses=*
      - -c
      - wal_level=logical

  electric:
    image: electricsql/electric
    environment:
      DATABASE_URL: postgresql://postgres:password@postgres:5432/electric?sslmode=disable
      # Not suitable for production. Only use insecure mode in development or if you've otherwise secured the Electric API.
      # See https://electric-sql.com/docs/guides/security
      ELECTRIC_INSECURE: true
    ports:
      - "3000:3000"
    depends_on:
      - postgres