Skip to main content
s2-lite is an open source server implementation of core S2 APIs. It’s a single binary designed to run as a single instance, making self-hosting straightforward. Thanks to its SlateDB engine, s2-lite can provide the same durability guarantee as the managed service — every write durable on object storage before acknowledgment. See the README for more on its internals and quickstart for running it via the s2 CLI or Docker. A Helm chart is also available for deploying to Kubernetes. The SDKs and CLI can connect to s2-lite by overriding the default endpoints. See SDK: Endpoints and CLI: Configuration for details.

Terraform

You can also manage a local s2-lite instance with the Terraform provider. Set these environment variables before running Terraform:
export S2_ACCOUNT_ENDPOINT="localhost:<port>"
export S2_ACCESS_TOKEN="test"

Use for testing

Even if you plan to exclusively use the managed service, s2-lite is useful as a local service emulator for integration tests and CI/CD pipelines. It implements the same API surface, so your tests run against a real S2 instance without needing network access or credentials.

Init file

s2-lite can pre-create basins and streams at startup from a JSON spec file using the same format used by s2 apply.
s2 lite --init-file init.json
Or set the environment variable:
S2LITE_INIT_FILE=init.json s2 lite
The spec is applied with create-or-reconfigure semantics. Resources that already exist are reconfigured to match the spec, and only the fields present in the spec are updated. Example init.json:
{
  "$schema": "https://raw.githubusercontent.com/s2-streamstore/s2/main/cli/schema.json",
  "basins": [
    {
      "name": "my-basin",
      "config": {
        "create_stream_on_append": true
      },
      "streams": [
        { "name": "events" }
      ]
    }
  ]
}
See CLI: Apply for the full spec file format reference.