Skip to content

Get started

Installation

Klyro is a single static binary with one dependency. Install it from npm, run the published image, bring it up with Compose, or build it from source.

npm

The shortest path from nothing to a running server. npm downloads a prebuilt binary for your machine; no Rust toolchain and no container runtime are involved.

npx klyro-db                # port 7171, dump file klyro.dump
npx klyro-db 7200           # a different port
npx klyro-db klyro.conf     # a config file

klyro-db includes the typed TypeScript client and the CLI launcher. The native binaries ship as separate packages, and npm installs only the one that matches your platform:

PlatformPackage
macOS, Apple siliconklyro-db-darwin-arm64
macOS, Intelklyro-db-darwin-x64
Linux arm64, glibcklyro-db-linux-arm64
Linux x64, glibcklyro-db-linux-x64

Typed client packages

These packages connect application code to a running Klyro server and cover every current MEM.* command with typed inputs and decoded replies.

npm install klyro-db@0.1.1

Docker

Every merge to main publishes an image, so there is usually nothing to build.

terminal
docker run -d --name klyro -p 7171:7171 -v klyro-data:/data \
  ghcr.io/hitesh-s0lanki/klyro:latest

Tags are latest, the version from Cargo.toml (0.1.1 and 0.1), and sha-<commit> for a specific build. Pin the version tag for anything you care about.

Container environment

VariableDefaultMeaning
KLYRO_PORT7171Port to listen on, inside the container
KLYRO_DUMP/data/klyro.dumpPath of the snapshot file
KLYRO_CONFIGunsetConfig file to load, e.g. a mounted klyro.conf
a config file from the host
docker run -d -p 6380:6380 \
  -e KLYRO_PORT=6380 \
  -e KLYRO_CONFIG=/etc/klyro/klyro.conf \
  -v $PWD/klyro.conf:/etc/klyro/klyro.conf:ro \
  -v klyro-data:/data \
  klyro

KLYRO_PORT is passed on the command line, so it overrides a port line inside KLYRO_CONFIG. Arguments given to docker run after the image name bypass all three and go straight to the binary.

Docker Compose

Compose sets up the port and the volume for you:

terminal
docker compose up -d

The image is a two-stage build, a static musl binary from rust:1-alpine copied onto bare Alpine, so it lands around 15 MB. It runs as an unprivileged user (uid 10001), keeps the dump in the /data volume, and carries a healthcheck that PINGs over the real protocol.

From source

git clone https://github.com/Hitesh-s0lanki/klyro
cd klyro
cargo build --release
./target/release/klyro

Settings come from a config file, the command line, or both. Command line arguments are applied last, so they win. Copy klyro.conf.sample to get started; it documents every parameter at its default value. See configuration.

Verify the install

redis-cli -p 7171
PING
+PONG

INFO server
# server
klyro_version:0.1.1
tcp_port:7171

MEM.CREATE smoke:test MODE HYBRID DIM 4
+OK
DEL smoke:test
:1