Lux Docs

Build on Lux without guessing.

Lux Cloud + OSS core

Product docs for the Lux runtime: tables, cache, vectors, realtime, time series, auth, HTTP, SDK, CLI, and self-hosting.

Quick Start

The fastest path is a Lux Cloud project plus the SDK. Use direct protocol access when you want raw commands or Redis-compatible tooling.

1. Install the CLI

The CLI manages Cloud projects, local project files, migrations, seeds, and direct command execution.

Install
curl -fsSL https://luxdb.dev/install.sh | sh
lux login

2. Create or link a project

lux env pull writes the values your app needs: project URL, auth URL, publishable key, secret key, and direct Lux URL.

Cloud project
lux create my-app --accept-charges
lux link my-app
lux env pull

3. Add schema and seed data

Lux migrations are .lux files. They run against your linked project by default, or against any direct lux:// URL you pass in.

Migrations
lux init
lux migrate new create_messages

# edit lux/migrations/<timestamp>_create_messages.lux
TCREATE messages "id INT PRIMARY KEY," "body STR," "owner STR," "created_at STR"

lux migrate run
lux seed run

4. Use the SDK

Browser and server project clients go through the Cloud gateway and return { data, error } results.

TypeScript
import { createBrowserClient } from "@luxdb/sdk";

const lux = createBrowserClient(
  import.meta.env.VITE_LUX_URL,
  import.meta.env.VITE_LUX_PUBLISHABLE_KEY
);

const { data, error } = await lux
  .table("messages")
  .select()
  .order("id", { ascending: false })
  .limit(20);

if (error) throw error;
console.log(data);

Auth

If Auth is enabled for the project, the same client can sign users in and attach their JWT to future project requests.

Auth
const { data, error } = await lux.auth.signInWithPassword({
  email: "user@example.com",
  password: "correct horse battery staple",
});

Run Lux locally

For local self-hosting or direct Redis-compatible tests, run the open-source runtime with a persistent data volume.

Docker
docker run -d --name lux -p 6379:6379 -v lux-data:/data ghcr.io/lux-db/lux:latest
redis-cli
redis-cli -h 127.0.0.1 -p 6379
Verify
127.0.0.1:6379> SET hello world
OK
127.0.0.1:6379> GET hello
"world"

Next

Read the SDK guide, CLI guide, Auth guide, and Tables guide.