> ## Documentation Index
> Fetch the complete documentation index at: https://schedy.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Install & Run

> Run Schedy with Docker, Docker Compose, a prebuilt binary, on Kubernetes, or build it from source.

## Docker

```bash theme={null}
docker run -p 8080:8080 ghcr.io/ksamirdev/schedy:latest
```

Also available on Docker Hub as `ksamirdev/schedy`, and pinned to a version tag:

```bash theme={null}
docker run -p 8080:8080 ghcr.io/ksamirdev/schedy:v1.0.0
```

To keep your tasks across restarts, mount a volume at `/data` (where Schedy stores its database):

```bash theme={null}
docker run -p 8080:8080 -v schedy-data:/data ghcr.io/ksamirdev/schedy:latest
```

## Docker Compose

For a persistent, self-restarting deployment, use Compose. Save this as `docker-compose.yml`:

```yaml theme={null}
services:
  schedy:
    image: ghcr.io/ksamirdev/schedy:latest
    # Pin a release tag for production, e.g. ghcr.io/ksamirdev/schedy:v1.0.0
    ports:
      - "8080:8080"
    environment:
      # Strongly recommended: set a key so every endpoint requires X-API-Key.
      # Leave unset to run open - fine for a local trial, not for the internet.
      SCHEDY_API_KEY: ${SCHEDY_API_KEY:-}
      SCHEDY_HISTORY_TTL: ${SCHEDY_HISTORY_TTL:-72h}
    volumes:
      - schedy-data:/data
    restart: unless-stopped
    healthcheck:
      # /readyz returns 200 only when the store is reachable (no auth needed).
      test: ["CMD", "wget", "-q", "-O", "/dev/null", "http://localhost:8080/readyz"]
      interval: 30s
      timeout: 5s
      retries: 3
      start_period: 5s

volumes:
  schedy-data:
```

Then start it in the background:

```bash theme={null}
docker compose up -d
```

Your tasks live in the named `schedy-data` volume, so they survive `docker compose down` followed by `docker compose up`. Only `docker compose down -v` (which deletes volumes) wipes them.

To require an API key, put it in a `.env` file next to `docker-compose.yml`:

```bash theme={null}
# .env
SCHEDY_API_KEY=your-secret
```

Compose reads `.env` automatically, and every endpoint then needs the `X-API-Key` header. See [Configuration](/configuration) for all environment variables and [Backup & Restore](/backup) for snapshotting the volume safely.

## Binary

Grab a prebuilt binary from the [Releases](https://github.com/ksamirdev/schedy/releases) page, or build from source:

```bash theme={null}
go build -o schedy ./cmd/schedy
./schedy --port 8080
```

Requires Go 1.23+.

## Kubernetes

Deploy Schedy on Kubernetes with health probes:

```yaml theme={null}
apiVersion: apps/v1
kind: Deployment
metadata:
  name: schedy
spec:
  replicas: 1
  selector:
    matchLabels:
      app: schedy
  template:
    metadata:
      labels:
        app: schedy
    spec:
      containers:
      - name: schedy
        image: ghcr.io/ksamirdev/schedy:v1.0.0
        ports:
        - containerPort: 8080
        env:
        - name: SCHEDY_API_KEY
          valueFrom:
            secretKeyRef:
              name: schedy-secrets
              key: api-key
        livenessProbe:
          httpGet:
            path: /healthz
            port: 8080
          initialDelaySeconds: 10
          periodSeconds: 10
        readinessProbe:
          httpGet:
            path: /readyz
            port: 8080
          initialDelaySeconds: 5
          periodSeconds: 5
        volumeMounts:
        - name: data
          mountPath: /data
      volumes:
      - name: data
        persistentVolumeClaim:
          claimName: schedy-data
```

For more details on health probes, see [Health checks](/api/health).

## Persistence

Data persists to the `data/` directory (BadgerDB), so tasks survive restarts. To preserve scheduled work, take a safe online snapshot rather than copying the live directory - see [Backup & Restore](/backup).
