Skip to main content
S2 Lite can be deployed in various environments, from Docker containers to Kubernetes clusters. This guide covers deployment best practices and options.

Deployment Modes

Docker

Single container deployment

Kubernetes

Scalable cluster deployment

Bare Metal

Direct binary deployment

Docker Deployment

Basic Container

The official S2 Lite Docker image is based on distroless and runs as a non-root user (UID 65532).

Docker Compose

Create a docker-compose.yml:
docker-compose.yml
Start the service:

With TLS

For production deployments, enable TLS:
When TLS is enabled, the default port changes from 80 to 443. Use --port to override.

With Init File

Mount an init file to pre-create basins and streams:

Bare Metal Deployment

Binary Installation

1

Download the binary

2

Create a systemd service

Create /etc/systemd/system/s2-lite.service:
/etc/systemd/system/s2-lite.service
3

Create user and directories

4

Configure AWS credentials

Create /etc/s2-lite/config.env:
/etc/s2-lite/config.env
Secure the file:
5

Start the service

Cloud Provider Specific

AWS with IAM Role

When running on EC2 or ECS, use IAM roles instead of static credentials.
1

Create IAM policy

Create a policy with S3 access:
s2-lite-policy.json
2

Attach to IAM role

Attach the policy to your EC2 instance profile or ECS task role.
3

Run without credentials

S2 Lite will automatically use the IAM role:
No AWS_ACCESS_KEY_ID or AWS_SECRET_ACCESS_KEY needed!

AWS with S3 Express One Zone

For ultra-low latency, use S3 Express:
S2 Lite automatically detects and uses the appropriate S3 endpoint for Express One Zone buckets.

Scaling Considerations

Single Instance

S2 Lite is designed as a single-instance deployment. Only one instance should write to a given bucket path at a time.
S2 Lite uses SlateDB, which relies on object storage for coordination. Running multiple instances against the same bucket path will cause data corruption.

Fencing

When restarting S2 Lite, it waits for the manifest poll interval (default from SlateDB settings) to ensure the previous instance is fenced out:
This prevents split-brain scenarios.

High Availability

For high availability:
  1. Use Kubernetes with a single replica and proper health checks
  2. Use a process manager like systemd with automatic restart
  3. Monitor health endpoint (/health) and restart on failure
  4. Keep restart delays to allow proper fencing
S2 Lite’s design prioritizes consistency over availability. A brief downtime during restarts is expected and safe.

Health Checks

S2 Lite exposes a /health endpoint for health monitoring:
Returns:
  • 200 OK with body "OK" when healthy
  • 503 Service Unavailable when the database status check fails

Health Check Configuration

Docker:
Kubernetes:

Security

Running as Non-Root

The Docker image runs as user 65532 (nonroot). For bare metal:

TLS Best Practices

  1. Use valid certificates from Let’s Encrypt or your CA
  2. Rotate certificates regularly
  3. Disable CORS in production with --no-cors
  4. Use a reverse proxy (nginx, Traefik) for advanced TLS configuration

Network Security

  1. Firewall rules: Restrict access to trusted networks
  2. VPC/Security Groups: Use cloud network security features
  3. Private networks: Deploy in private subnets with load balancer

Next Steps

Kubernetes

Deploy with Helm to Kubernetes

Monitoring

Set up Prometheus monitoring

Configuration

Detailed configuration reference